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 * The contents of CResult_RouteHopDecodeErrorZ
3162 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
3164 * A pointer to the contents in the success state.
3165 * Reading from this pointer when `result_ok` is not set is undefined.
3167 struct LDKRouteHop *result;
3169 * A pointer to the contents in the error state.
3170 * Reading from this pointer when `result_ok` is set is undefined.
3172 struct LDKDecodeError *err;
3173 } LDKCResult_RouteHopDecodeErrorZPtr;
3176 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
3177 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
3178 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3180 typedef struct LDKCResult_RouteHopDecodeErrorZ {
3182 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
3183 * `err` or `result` depending on the state of `result_ok`.
3185 union LDKCResult_RouteHopDecodeErrorZPtr contents;
3187 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
3190 } LDKCResult_RouteHopDecodeErrorZ;
3193 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
3194 * This corresponds to std::vector in C++
3196 typedef struct LDKCVec_RouteHopZ {
3198 * The elements in the array.
3199 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3201 struct LDKRouteHop *data;
3203 * The number of elements pointed to by `data`.
3206 } LDKCVec_RouteHopZ;
3209 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
3210 * This corresponds to std::vector in C++
3212 typedef struct LDKCVec_CVec_RouteHopZZ {
3214 * The elements in the array.
3215 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3217 struct LDKCVec_RouteHopZ *data;
3219 * The number of elements pointed to by `data`.
3222 } LDKCVec_CVec_RouteHopZZ;
3227 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
3228 * it can take multiple paths. Each path is composed of one or more hops through the network.
3230 typedef struct MUST_USE_STRUCT LDKRoute {
3232 * A pointer to the opaque Rust object.
3233 * Nearly everywhere, inner must be non-null, however in places where
3234 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3236 LDKnativeRoute *inner;
3238 * Indicates that this is the only struct which contains the same pointer.
3239 * Rust functions which take ownership of an object provided via an argument require
3240 * this to be true and invalidate the object pointed to by inner.
3246 * The contents of CResult_RouteDecodeErrorZ
3248 typedef union LDKCResult_RouteDecodeErrorZPtr {
3250 * A pointer to the contents in the success state.
3251 * Reading from this pointer when `result_ok` is not set is undefined.
3253 struct LDKRoute *result;
3255 * A pointer to the contents in the error state.
3256 * Reading from this pointer when `result_ok` is set is undefined.
3258 struct LDKDecodeError *err;
3259 } LDKCResult_RouteDecodeErrorZPtr;
3262 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
3263 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
3264 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3266 typedef struct LDKCResult_RouteDecodeErrorZ {
3268 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
3269 * `err` or `result` depending on the state of `result_ok`.
3271 union LDKCResult_RouteDecodeErrorZPtr contents;
3273 * Whether this CResult_RouteDecodeErrorZ represents a success state.
3276 } LDKCResult_RouteDecodeErrorZ;
3281 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
3283 typedef struct MUST_USE_STRUCT LDKChannelDetails {
3285 * A pointer to the opaque Rust object.
3286 * Nearly everywhere, inner must be non-null, however in places where
3287 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3289 LDKnativeChannelDetails *inner;
3291 * Indicates that this is the only struct which contains the same pointer.
3292 * Rust functions which take ownership of an object provided via an argument require
3293 * this to be true and invalidate the object pointed to by inner.
3296 } LDKChannelDetails;
3299 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
3300 * This corresponds to std::vector in C++
3302 typedef struct LDKCVec_ChannelDetailsZ {
3304 * The elements in the array.
3305 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3307 struct LDKChannelDetails *data;
3309 * The number of elements pointed to by `data`.
3312 } LDKCVec_ChannelDetailsZ;
3317 * An Err type for failure to process messages.
3319 typedef struct MUST_USE_STRUCT LDKLightningError {
3321 * A pointer to the opaque Rust object.
3322 * Nearly everywhere, inner must be non-null, however in places where
3323 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3325 LDKnativeLightningError *inner;
3327 * Indicates that this is the only struct which contains the same pointer.
3328 * Rust functions which take ownership of an object provided via an argument require
3329 * this to be true and invalidate the object pointed to by inner.
3332 } LDKLightningError;
3335 * The contents of CResult_RouteLightningErrorZ
3337 typedef union LDKCResult_RouteLightningErrorZPtr {
3339 * A pointer to the contents in the success state.
3340 * Reading from this pointer when `result_ok` is not set is undefined.
3342 struct LDKRoute *result;
3344 * A pointer to the contents in the error state.
3345 * Reading from this pointer when `result_ok` is set is undefined.
3347 struct LDKLightningError *err;
3348 } LDKCResult_RouteLightningErrorZPtr;
3351 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
3352 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
3353 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3355 typedef struct LDKCResult_RouteLightningErrorZ {
3357 * The contents of this CResult_RouteLightningErrorZ, accessible via either
3358 * `err` or `result` depending on the state of `result_ok`.
3360 union LDKCResult_RouteLightningErrorZPtr contents;
3362 * Whether this CResult_RouteLightningErrorZ represents a success state.
3365 } LDKCResult_RouteLightningErrorZ;
3370 * An accept_channel message to be sent or received from a peer
3372 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
3374 * A pointer to the opaque Rust object.
3375 * Nearly everywhere, inner must be non-null, however in places where
3376 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3378 LDKnativeAcceptChannel *inner;
3380 * Indicates that this is the only struct which contains the same pointer.
3381 * Rust functions which take ownership of an object provided via an argument require
3382 * this to be true and invalidate the object pointed to by inner.
3390 * An open_channel message to be sent or received from a peer
3392 typedef struct MUST_USE_STRUCT LDKOpenChannel {
3394 * A pointer to the opaque Rust object.
3395 * Nearly everywhere, inner must be non-null, however in places where
3396 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3398 LDKnativeOpenChannel *inner;
3400 * Indicates that this is the only struct which contains the same pointer.
3401 * Rust functions which take ownership of an object provided via an argument require
3402 * this to be true and invalidate the object pointed to by inner.
3410 * A funding_created message to be sent or received from a peer
3412 typedef struct MUST_USE_STRUCT LDKFundingCreated {
3414 * A pointer to the opaque Rust object.
3415 * Nearly everywhere, inner must be non-null, however in places where
3416 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3418 LDKnativeFundingCreated *inner;
3420 * Indicates that this is the only struct which contains the same pointer.
3421 * Rust functions which take ownership of an object provided via an argument require
3422 * this to be true and invalidate the object pointed to by inner.
3425 } LDKFundingCreated;
3430 * A funding_signed message to be sent or received from a peer
3432 typedef struct MUST_USE_STRUCT LDKFundingSigned {
3434 * A pointer to the opaque Rust object.
3435 * Nearly everywhere, inner must be non-null, however in places where
3436 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3438 LDKnativeFundingSigned *inner;
3440 * Indicates that this is the only struct which contains the same pointer.
3441 * Rust functions which take ownership of an object provided via an argument require
3442 * this to be true and invalidate the object pointed to by inner.
3450 * A funding_locked message to be sent or received from a peer
3452 typedef struct MUST_USE_STRUCT LDKFundingLocked {
3454 * A pointer to the opaque Rust object.
3455 * Nearly everywhere, inner must be non-null, however in places where
3456 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3458 LDKnativeFundingLocked *inner;
3460 * Indicates that this is the only struct which contains the same pointer.
3461 * Rust functions which take ownership of an object provided via an argument require
3462 * this to be true and invalidate the object pointed to by inner.
3470 * An announcement_signatures message to be sent or received from a peer
3472 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
3474 * A pointer to the opaque Rust object.
3475 * Nearly everywhere, inner must be non-null, however in places where
3476 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3478 LDKnativeAnnouncementSignatures *inner;
3480 * Indicates that this is the only struct which contains the same pointer.
3481 * Rust functions which take ownership of an object provided via an argument require
3482 * this to be true and invalidate the object pointed to by inner.
3485 } LDKAnnouncementSignatures;
3490 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
3491 * transaction updates if they were pending.
3493 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
3495 * A pointer to the opaque Rust object.
3496 * Nearly everywhere, inner must be non-null, however in places where
3497 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3499 LDKnativeCommitmentUpdate *inner;
3501 * Indicates that this is the only struct which contains the same pointer.
3502 * Rust functions which take ownership of an object provided via an argument require
3503 * this to be true and invalidate the object pointed to by inner.
3506 } LDKCommitmentUpdate;
3511 * A revoke_and_ack message to be sent or received from a peer
3513 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
3515 * A pointer to the opaque Rust object.
3516 * Nearly everywhere, inner must be non-null, however in places where
3517 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3519 LDKnativeRevokeAndACK *inner;
3521 * Indicates that this is the only struct which contains the same pointer.
3522 * Rust functions which take ownership of an object provided via an argument require
3523 * this to be true and invalidate the object pointed to by inner.
3531 * A closing_signed message to be sent or received from a peer
3533 typedef struct MUST_USE_STRUCT LDKClosingSigned {
3535 * A pointer to the opaque Rust object.
3536 * Nearly everywhere, inner must be non-null, however in places where
3537 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3539 LDKnativeClosingSigned *inner;
3541 * Indicates that this is the only struct which contains the same pointer.
3542 * Rust functions which take ownership of an object provided via an argument require
3543 * this to be true and invalidate the object pointed to by inner.
3551 * A shutdown message to be sent or received from a peer
3553 typedef struct MUST_USE_STRUCT LDKShutdown {
3555 * A pointer to the opaque Rust object.
3556 * Nearly everywhere, inner must be non-null, however in places where
3557 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3559 LDKnativeShutdown *inner;
3561 * Indicates that this is the only struct which contains the same pointer.
3562 * Rust functions which take ownership of an object provided via an argument require
3563 * this to be true and invalidate the object pointed to by inner.
3571 * A channel_reestablish message to be sent or received from a peer
3573 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
3575 * A pointer to the opaque Rust object.
3576 * Nearly everywhere, inner must be non-null, however in places where
3577 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3579 LDKnativeChannelReestablish *inner;
3581 * Indicates that this is the only struct which contains the same pointer.
3582 * Rust functions which take ownership of an object provided via an argument require
3583 * this to be true and invalidate the object pointed to by inner.
3586 } LDKChannelReestablish;
3591 * A channel_announcement message to be sent or received from a peer
3593 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
3595 * A pointer to the opaque Rust object.
3596 * Nearly everywhere, inner must be non-null, however in places where
3597 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3599 LDKnativeChannelAnnouncement *inner;
3601 * Indicates that this is the only struct which contains the same pointer.
3602 * Rust functions which take ownership of an object provided via an argument require
3603 * this to be true and invalidate the object pointed to by inner.
3606 } LDKChannelAnnouncement;
3611 * A channel_update message to be sent or received from a peer
3613 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
3615 * A pointer to the opaque Rust object.
3616 * Nearly everywhere, inner must be non-null, however in places where
3617 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3619 LDKnativeChannelUpdate *inner;
3621 * Indicates that this is the only struct which contains the same pointer.
3622 * Rust functions which take ownership of an object provided via an argument require
3623 * this to be true and invalidate the object pointed to by inner.
3631 * A node_announcement message to be sent or received from a peer
3633 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
3635 * A pointer to the opaque Rust object.
3636 * Nearly everywhere, inner must be non-null, however in places where
3637 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3639 LDKnativeNodeAnnouncement *inner;
3641 * Indicates that this is the only struct which contains the same pointer.
3642 * Rust functions which take ownership of an object provided via an argument require
3643 * this to be true and invalidate the object pointed to by inner.
3646 } LDKNodeAnnouncement;
3651 * An error message to be sent or received from a peer
3653 typedef struct MUST_USE_STRUCT LDKErrorMessage {
3655 * A pointer to the opaque Rust object.
3656 * Nearly everywhere, inner must be non-null, however in places where
3657 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3659 LDKnativeErrorMessage *inner;
3661 * Indicates that this is the only struct which contains the same pointer.
3662 * Rust functions which take ownership of an object provided via an argument require
3663 * this to be true and invalidate the object pointed to by inner.
3669 * Used to put an error message in a LightningError
3671 typedef enum LDKErrorAction_Tag {
3673 * The peer took some action which made us think they were useless. Disconnect them.
3675 LDKErrorAction_DisconnectPeer,
3677 * The peer did something harmless that we weren't able to process, just log and ignore
3679 LDKErrorAction_IgnoreError,
3681 * The peer did something incorrect. Tell them.
3683 LDKErrorAction_SendErrorMessage,
3685 * Must be last for serialization purposes
3687 LDKErrorAction_Sentinel,
3688 } LDKErrorAction_Tag;
3690 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
3692 * An error message which we should make an effort to send before we disconnect.
3694 struct LDKErrorMessage msg;
3695 } LDKErrorAction_LDKDisconnectPeer_Body;
3697 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
3699 * The message to send.
3701 struct LDKErrorMessage msg;
3702 } LDKErrorAction_LDKSendErrorMessage_Body;
3704 typedef struct MUST_USE_STRUCT LDKErrorAction {
3705 LDKErrorAction_Tag tag;
3707 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
3708 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
3713 * The information we received from a peer along the route of a payment we originated. This is
3714 * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
3715 * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
3717 typedef enum LDKHTLCFailChannelUpdate_Tag {
3719 * We received an error which included a full ChannelUpdate message.
3721 LDKHTLCFailChannelUpdate_ChannelUpdateMessage,
3723 * We received an error which indicated only that a channel has been closed
3725 LDKHTLCFailChannelUpdate_ChannelClosed,
3727 * We received an error which indicated only that a node has failed
3729 LDKHTLCFailChannelUpdate_NodeFailure,
3731 * Must be last for serialization purposes
3733 LDKHTLCFailChannelUpdate_Sentinel,
3734 } LDKHTLCFailChannelUpdate_Tag;
3736 typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
3738 * The unwrapped message we received
3740 struct LDKChannelUpdate msg;
3741 } LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
3743 typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
3745 * The short_channel_id which has now closed.
3747 uint64_t short_channel_id;
3749 * when this true, this channel should be permanently removed from the
3750 * consideration. Otherwise, this channel can be restored as new channel_update is received
3753 } LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
3755 typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
3757 * The node_id that has failed.
3759 struct LDKPublicKey node_id;
3761 * when this true, node should be permanently removed from the
3762 * consideration. Otherwise, the channels connected to this node can be
3763 * restored as new channel_update is received
3766 } LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
3768 typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
3769 LDKHTLCFailChannelUpdate_Tag tag;
3771 LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
3772 LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
3773 LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
3775 } LDKHTLCFailChannelUpdate;
3780 * A query_channel_range message is used to query a peer for channel
3781 * UTXOs in a range of blocks. The recipient of a query makes a best
3782 * effort to reply to the query using one or more reply_channel_range
3785 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
3787 * A pointer to the opaque Rust object.
3788 * Nearly everywhere, inner must be non-null, however in places where
3789 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3791 LDKnativeQueryChannelRange *inner;
3793 * Indicates that this is the only struct which contains the same pointer.
3794 * Rust functions which take ownership of an object provided via an argument require
3795 * this to be true and invalidate the object pointed to by inner.
3798 } LDKQueryChannelRange;
3803 * A query_short_channel_ids message is used to query a peer for
3804 * routing gossip messages related to one or more short_channel_ids.
3805 * The query recipient will reply with the latest, if available,
3806 * channel_announcement, channel_update and node_announcement messages
3807 * it maintains for the requested short_channel_ids followed by a
3808 * reply_short_channel_ids_end message. The short_channel_ids sent in
3809 * this query are encoded. We only support encoding_type=0 uncompressed
3810 * serialization and do not support encoding_type=1 zlib serialization.
3812 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
3814 * A pointer to the opaque Rust object.
3815 * Nearly everywhere, inner must be non-null, however in places where
3816 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3818 LDKnativeQueryShortChannelIds *inner;
3820 * Indicates that this is the only struct which contains the same pointer.
3821 * Rust functions which take ownership of an object provided via an argument require
3822 * this to be true and invalidate the object pointed to by inner.
3825 } LDKQueryShortChannelIds;
3830 * A reply_channel_range message is a reply to a query_channel_range
3831 * message. Multiple reply_channel_range messages can be sent in reply
3832 * to a single query_channel_range message. The query recipient makes a
3833 * best effort to respond based on their local network view which may
3834 * not be a perfect view of the network. The short_channel_ids in the
3835 * reply are encoded. We only support encoding_type=0 uncompressed
3836 * serialization and do not support encoding_type=1 zlib serialization.
3838 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
3840 * A pointer to the opaque Rust object.
3841 * Nearly everywhere, inner must be non-null, however in places where
3842 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3844 LDKnativeReplyChannelRange *inner;
3846 * Indicates that this is the only struct which contains the same pointer.
3847 * Rust functions which take ownership of an object provided via an argument require
3848 * this to be true and invalidate the object pointed to by inner.
3851 } LDKReplyChannelRange;
3854 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
3855 * broadcast to most peers).
3856 * These events are handled by PeerManager::process_events if you are using a PeerManager.
3858 typedef enum LDKMessageSendEvent_Tag {
3860 * Used to indicate that we've accepted a channel open and should send the accept_channel
3861 * message provided to the given peer.
3863 LDKMessageSendEvent_SendAcceptChannel,
3865 * Used to indicate that we've initiated a channel open and should send the open_channel
3866 * message provided to the given peer.
3868 LDKMessageSendEvent_SendOpenChannel,
3870 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
3872 LDKMessageSendEvent_SendFundingCreated,
3874 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
3876 LDKMessageSendEvent_SendFundingSigned,
3878 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
3880 LDKMessageSendEvent_SendFundingLocked,
3882 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
3884 LDKMessageSendEvent_SendAnnouncementSignatures,
3886 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
3887 * message should be sent to the peer with the given node_id.
3889 LDKMessageSendEvent_UpdateHTLCs,
3891 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
3893 LDKMessageSendEvent_SendRevokeAndACK,
3895 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
3897 LDKMessageSendEvent_SendClosingSigned,
3899 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
3901 LDKMessageSendEvent_SendShutdown,
3903 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
3905 LDKMessageSendEvent_SendChannelReestablish,
3907 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
3908 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
3910 * Note that after doing so, you very likely (unless you did so very recently) want to call
3911 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
3912 * This ensures that any nodes which see our channel_announcement also have a relevant
3913 * node_announcement, including relevant feature flags which may be important for routing
3916 LDKMessageSendEvent_BroadcastChannelAnnouncement,
3918 * Used to indicate that a node_announcement should be broadcast to all peers.
3920 LDKMessageSendEvent_BroadcastNodeAnnouncement,
3922 * Used to indicate that a channel_update should be broadcast to all peers.
3924 LDKMessageSendEvent_BroadcastChannelUpdate,
3926 * Broadcast an error downstream to be handled
3928 LDKMessageSendEvent_HandleError,
3930 * When a payment fails we may receive updates back from the hop where it failed. In such
3931 * cases this event is generated so that we can inform the network graph of this information.
3933 LDKMessageSendEvent_PaymentFailureNetworkUpdate,
3935 * Query a peer for channels with funding transaction UTXOs in a block range.
3937 LDKMessageSendEvent_SendChannelRangeQuery,
3939 * Request routing gossip messages from a peer for a list of channels identified by
3940 * their short_channel_ids.
3942 LDKMessageSendEvent_SendShortIdsQuery,
3944 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
3945 * emitted during processing of the query.
3947 LDKMessageSendEvent_SendReplyChannelRange,
3949 * Must be last for serialization purposes
3951 LDKMessageSendEvent_Sentinel,
3952 } LDKMessageSendEvent_Tag;
3954 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_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 LDKAcceptChannel msg;
3963 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
3965 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
3967 * The node_id of the node which should receive this message
3969 struct LDKPublicKey node_id;
3971 * The message which should be sent.
3973 struct LDKOpenChannel msg;
3974 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
3976 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
3978 * The node_id of the node which should receive this message
3980 struct LDKPublicKey node_id;
3982 * The message which should be sent.
3984 struct LDKFundingCreated msg;
3985 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
3987 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
3989 * The node_id of the node which should receive this message
3991 struct LDKPublicKey node_id;
3993 * The message which should be sent.
3995 struct LDKFundingSigned msg;
3996 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
3998 typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
4000 * The node_id of the node which should receive these message(s)
4002 struct LDKPublicKey node_id;
4004 * The funding_locked message which should be sent.
4006 struct LDKFundingLocked msg;
4007 } LDKMessageSendEvent_LDKSendFundingLocked_Body;
4009 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
4011 * The node_id of the node which should receive these message(s)
4013 struct LDKPublicKey node_id;
4015 * The announcement_signatures message which should be sent.
4017 struct LDKAnnouncementSignatures msg;
4018 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
4020 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
4022 * The node_id of the node which should receive these message(s)
4024 struct LDKPublicKey node_id;
4026 * The update messages which should be sent. ALL messages in the struct should be sent!
4028 struct LDKCommitmentUpdate updates;
4029 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
4031 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_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 LDKRevokeAndACK msg;
4040 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
4042 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
4044 * The node_id of the node which should receive this message
4046 struct LDKPublicKey node_id;
4048 * The message which should be sent.
4050 struct LDKClosingSigned msg;
4051 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
4053 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
4055 * The node_id of the node which should receive this message
4057 struct LDKPublicKey node_id;
4059 * The message which should be sent.
4061 struct LDKShutdown msg;
4062 } LDKMessageSendEvent_LDKSendShutdown_Body;
4064 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
4066 * The node_id of the node which should receive this message
4068 struct LDKPublicKey node_id;
4070 * The message which should be sent.
4072 struct LDKChannelReestablish msg;
4073 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
4075 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
4077 * The channel_announcement which should be sent.
4079 struct LDKChannelAnnouncement msg;
4081 * The followup channel_update which should be sent.
4083 struct LDKChannelUpdate update_msg;
4084 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
4086 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
4088 * The node_announcement which should be sent.
4090 struct LDKNodeAnnouncement msg;
4091 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
4093 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
4095 * The channel_update which should be sent.
4097 struct LDKChannelUpdate msg;
4098 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
4100 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
4102 * The node_id of the node which should receive this message
4104 struct LDKPublicKey node_id;
4106 * The action which should be taken.
4108 struct LDKErrorAction action;
4109 } LDKMessageSendEvent_LDKHandleError_Body;
4111 typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
4113 * The channel/node update which should be sent to NetGraphMsgHandler
4115 struct LDKHTLCFailChannelUpdate update;
4116 } LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
4118 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
4120 * The node_id of this message recipient
4122 struct LDKPublicKey node_id;
4124 * The query_channel_range which should be sent.
4126 struct LDKQueryChannelRange msg;
4127 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
4129 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
4131 * The node_id of this message recipient
4133 struct LDKPublicKey node_id;
4135 * The query_short_channel_ids which should be sent.
4137 struct LDKQueryShortChannelIds msg;
4138 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
4140 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
4142 * The node_id of this message recipient
4144 struct LDKPublicKey node_id;
4146 * The reply_channel_range which should be sent.
4148 struct LDKReplyChannelRange msg;
4149 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
4151 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
4152 LDKMessageSendEvent_Tag tag;
4154 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
4155 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
4156 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
4157 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
4158 LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
4159 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
4160 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
4161 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
4162 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
4163 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
4164 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
4165 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
4166 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
4167 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
4168 LDKMessageSendEvent_LDKHandleError_Body handle_error;
4169 LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
4170 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
4171 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
4172 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
4174 } LDKMessageSendEvent;
4177 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
4178 * This corresponds to std::vector in C++
4180 typedef struct LDKCVec_MessageSendEventZ {
4182 * The elements in the array.
4183 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4185 struct LDKMessageSendEvent *data;
4187 * The number of elements pointed to by `data`.
4190 } LDKCVec_MessageSendEventZ;
4193 * The contents of CResult_boolLightningErrorZ
4195 typedef union LDKCResult_boolLightningErrorZPtr {
4197 * A pointer to the contents in the success state.
4198 * Reading from this pointer when `result_ok` is not set is undefined.
4202 * A pointer to the contents in the error state.
4203 * Reading from this pointer when `result_ok` is set is undefined.
4205 struct LDKLightningError *err;
4206 } LDKCResult_boolLightningErrorZPtr;
4209 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
4210 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
4211 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4213 typedef struct LDKCResult_boolLightningErrorZ {
4215 * The contents of this CResult_boolLightningErrorZ, accessible via either
4216 * `err` or `result` depending on the state of `result_ok`.
4218 union LDKCResult_boolLightningErrorZPtr contents;
4220 * Whether this CResult_boolLightningErrorZ represents a success state.
4223 } LDKCResult_boolLightningErrorZ;
4226 * A tuple of 3 elements. See the individual fields for the types contained.
4228 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
4230 * The element at position 0
4232 struct LDKChannelAnnouncement a;
4234 * The element at position 1
4236 struct LDKChannelUpdate b;
4238 * The element at position 2
4240 struct LDKChannelUpdate c;
4241 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
4244 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
4245 * This corresponds to std::vector in C++
4247 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
4249 * The elements in the array.
4250 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4252 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
4254 * The number of elements pointed to by `data`.
4257 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
4260 * A dynamically-allocated array of crate::lightning::ln::msgs::NodeAnnouncements of arbitrary size.
4261 * This corresponds to std::vector in C++
4263 typedef struct LDKCVec_NodeAnnouncementZ {
4265 * The elements in the array.
4266 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4268 struct LDKNodeAnnouncement *data;
4270 * The number of elements pointed to by `data`.
4273 } LDKCVec_NodeAnnouncementZ;
4276 * The contents of CResult_NoneLightningErrorZ
4278 typedef union LDKCResult_NoneLightningErrorZPtr {
4280 * Note that this value is always NULL, as there are no contents in the OK variant
4284 * A pointer to the contents in the error state.
4285 * Reading from this pointer when `result_ok` is set is undefined.
4287 struct LDKLightningError *err;
4288 } LDKCResult_NoneLightningErrorZPtr;
4291 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
4292 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
4293 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4295 typedef struct LDKCResult_NoneLightningErrorZ {
4297 * The contents of this CResult_NoneLightningErrorZ, accessible via either
4298 * `err` or `result` depending on the state of `result_ok`.
4300 union LDKCResult_NoneLightningErrorZPtr contents;
4302 * Whether this CResult_NoneLightningErrorZ represents a success state.
4305 } LDKCResult_NoneLightningErrorZ;
4308 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
4309 * This corresponds to std::vector in C++
4311 typedef struct LDKCVec_PublicKeyZ {
4313 * The elements in the array.
4314 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4316 struct LDKPublicKey *data;
4318 * The number of elements pointed to by `data`.
4321 } LDKCVec_PublicKeyZ;
4326 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
4327 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
4330 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
4332 * A pointer to the opaque Rust object.
4333 * Nearly everywhere, inner must be non-null, however in places where
4334 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4336 LDKnativePeerHandleError *inner;
4338 * Indicates that this is the only struct which contains the same pointer.
4339 * Rust functions which take ownership of an object provided via an argument require
4340 * this to be true and invalidate the object pointed to by inner.
4343 } LDKPeerHandleError;
4346 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
4348 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
4350 * A pointer to the contents in the success state.
4351 * Reading from this pointer when `result_ok` is not set is undefined.
4353 struct LDKCVec_u8Z *result;
4355 * A pointer to the contents in the error state.
4356 * Reading from this pointer when `result_ok` is set is undefined.
4358 struct LDKPeerHandleError *err;
4359 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
4362 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
4363 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
4364 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4366 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
4368 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
4369 * `err` or `result` depending on the state of `result_ok`.
4371 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
4373 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
4376 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
4379 * The contents of CResult_NonePeerHandleErrorZ
4381 typedef union LDKCResult_NonePeerHandleErrorZPtr {
4383 * Note that this value is always NULL, as there are no contents in the OK variant
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_NonePeerHandleErrorZPtr;
4394 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
4395 * containing a () 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_NonePeerHandleErrorZ {
4400 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
4401 * `err` or `result` depending on the state of `result_ok`.
4403 union LDKCResult_NonePeerHandleErrorZPtr contents;
4405 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
4408 } LDKCResult_NonePeerHandleErrorZ;
4411 * The contents of CResult_boolPeerHandleErrorZ
4413 typedef union LDKCResult_boolPeerHandleErrorZPtr {
4415 * A pointer to the contents in the success state.
4416 * Reading from this pointer when `result_ok` is not set is undefined.
4420 * A pointer to the contents in the error state.
4421 * Reading from this pointer when `result_ok` is set is undefined.
4423 struct LDKPeerHandleError *err;
4424 } LDKCResult_boolPeerHandleErrorZPtr;
4427 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
4428 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
4429 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4431 typedef struct LDKCResult_boolPeerHandleErrorZ {
4433 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
4434 * `err` or `result` depending on the state of `result_ok`.
4436 union LDKCResult_boolPeerHandleErrorZPtr contents;
4438 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
4441 } LDKCResult_boolPeerHandleErrorZ;
4444 * The contents of CResult_TxOutAccessErrorZ
4446 typedef union LDKCResult_TxOutAccessErrorZPtr {
4448 * A pointer to the contents in the success state.
4449 * Reading from this pointer when `result_ok` is not set is undefined.
4451 struct LDKTxOut *result;
4453 * A pointer to the contents in the error state.
4454 * Reading from this pointer when `result_ok` is set is undefined.
4456 enum LDKAccessError *err;
4457 } LDKCResult_TxOutAccessErrorZPtr;
4460 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
4461 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
4462 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4464 typedef struct LDKCResult_TxOutAccessErrorZ {
4466 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
4467 * `err` or `result` depending on the state of `result_ok`.
4469 union LDKCResult_TxOutAccessErrorZPtr contents;
4471 * Whether this CResult_TxOutAccessErrorZ represents a success state.
4474 } LDKCResult_TxOutAccessErrorZ;
4477 * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not
4479 typedef enum LDKCOption_C2Tuple_usizeTransactionZZ_Tag {
4481 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ
4483 LDKCOption_C2Tuple_usizeTransactionZZ_Some,
4485 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing
4487 LDKCOption_C2Tuple_usizeTransactionZZ_None,
4489 * Must be last for serialization purposes
4491 LDKCOption_C2Tuple_usizeTransactionZZ_Sentinel,
4492 } LDKCOption_C2Tuple_usizeTransactionZZ_Tag;
4494 typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
4495 LDKCOption_C2Tuple_usizeTransactionZZ_Tag tag;
4498 struct LDKC2Tuple_usizeTransactionZ some;
4501 } LDKCOption_C2Tuple_usizeTransactionZZ;
4506 * Details about one direction of a channel. Received
4507 * within a channel update.
4509 typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
4511 * A pointer to the opaque Rust object.
4512 * Nearly everywhere, inner must be non-null, however in places where
4513 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4515 LDKnativeDirectionalChannelInfo *inner;
4517 * Indicates that this is the only struct which contains the same pointer.
4518 * Rust functions which take ownership of an object provided via an argument require
4519 * this to be true and invalidate the object pointed to by inner.
4522 } LDKDirectionalChannelInfo;
4525 * The contents of CResult_DirectionalChannelInfoDecodeErrorZ
4527 typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr {
4529 * A pointer to the contents in the success state.
4530 * Reading from this pointer when `result_ok` is not set is undefined.
4532 struct LDKDirectionalChannelInfo *result;
4534 * A pointer to the contents in the error state.
4535 * Reading from this pointer when `result_ok` is set is undefined.
4537 struct LDKDecodeError *err;
4538 } LDKCResult_DirectionalChannelInfoDecodeErrorZPtr;
4541 * A CResult_DirectionalChannelInfoDecodeErrorZ represents the result of a fallible operation,
4542 * containing a crate::lightning::routing::network_graph::DirectionalChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4543 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4545 typedef struct LDKCResult_DirectionalChannelInfoDecodeErrorZ {
4547 * The contents of this CResult_DirectionalChannelInfoDecodeErrorZ, accessible via either
4548 * `err` or `result` depending on the state of `result_ok`.
4550 union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents;
4552 * Whether this CResult_DirectionalChannelInfoDecodeErrorZ represents a success state.
4555 } LDKCResult_DirectionalChannelInfoDecodeErrorZ;
4560 * Details about a channel (both directions).
4561 * Received within a channel announcement.
4563 typedef struct MUST_USE_STRUCT LDKChannelInfo {
4565 * A pointer to the opaque Rust object.
4566 * Nearly everywhere, inner must be non-null, however in places where
4567 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4569 LDKnativeChannelInfo *inner;
4571 * Indicates that this is the only struct which contains the same pointer.
4572 * Rust functions which take ownership of an object provided via an argument require
4573 * this to be true and invalidate the object pointed to by inner.
4579 * The contents of CResult_ChannelInfoDecodeErrorZ
4581 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
4583 * A pointer to the contents in the success state.
4584 * Reading from this pointer when `result_ok` is not set is undefined.
4586 struct LDKChannelInfo *result;
4588 * A pointer to the contents in the error state.
4589 * Reading from this pointer when `result_ok` is set is undefined.
4591 struct LDKDecodeError *err;
4592 } LDKCResult_ChannelInfoDecodeErrorZPtr;
4595 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
4596 * containing a crate::lightning::routing::network_graph::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4597 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4599 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
4601 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
4602 * `err` or `result` depending on the state of `result_ok`.
4604 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
4606 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
4609 } LDKCResult_ChannelInfoDecodeErrorZ;
4614 * Fees for routing via a given channel or a node
4616 typedef struct MUST_USE_STRUCT LDKRoutingFees {
4618 * A pointer to the opaque Rust object.
4619 * Nearly everywhere, inner must be non-null, however in places where
4620 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4622 LDKnativeRoutingFees *inner;
4624 * Indicates that this is the only struct which contains the same pointer.
4625 * Rust functions which take ownership of an object provided via an argument require
4626 * this to be true and invalidate the object pointed to by inner.
4632 * The contents of CResult_RoutingFeesDecodeErrorZ
4634 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
4636 * A pointer to the contents in the success state.
4637 * Reading from this pointer when `result_ok` is not set is undefined.
4639 struct LDKRoutingFees *result;
4641 * A pointer to the contents in the error state.
4642 * Reading from this pointer when `result_ok` is set is undefined.
4644 struct LDKDecodeError *err;
4645 } LDKCResult_RoutingFeesDecodeErrorZPtr;
4648 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
4649 * containing a crate::lightning::routing::network_graph::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
4650 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4652 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
4654 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
4655 * `err` or `result` depending on the state of `result_ok`.
4657 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
4659 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
4662 } LDKCResult_RoutingFeesDecodeErrorZ;
4665 * A 4-byte byte array.
4667 typedef struct LDKFourBytes {
4675 * A 16-byte byte array.
4677 typedef struct LDKSixteenBytes {
4685 * A 10-byte byte array.
4687 typedef struct LDKTenBytes {
4695 * An address which can be used to connect to a remote peer
4697 typedef enum LDKNetAddress_Tag {
4699 * An IPv4 address/port on which the peer is listening.
4703 * An IPv6 address/port on which the peer is listening.
4707 * An old-style Tor onion address/port on which the peer is listening.
4709 LDKNetAddress_OnionV2,
4711 * A new-style Tor onion address/port on which the peer is listening.
4712 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
4713 * wrap as base32 and append \".onion\".
4715 LDKNetAddress_OnionV3,
4717 * Must be last for serialization purposes
4719 LDKNetAddress_Sentinel,
4720 } LDKNetAddress_Tag;
4722 typedef struct LDKNetAddress_LDKIPv4_Body {
4724 * The 4-byte IPv4 address
4726 struct LDKFourBytes addr;
4728 * The port on which the node is listening
4731 } LDKNetAddress_LDKIPv4_Body;
4733 typedef struct LDKNetAddress_LDKIPv6_Body {
4735 * The 16-byte IPv6 address
4737 struct LDKSixteenBytes addr;
4739 * The port on which the node is listening
4742 } LDKNetAddress_LDKIPv6_Body;
4744 typedef struct LDKNetAddress_LDKOnionV2_Body {
4746 * The bytes (usually encoded in base32 with \".onion\" appended)
4748 struct LDKTenBytes addr;
4750 * The port on which the node is listening
4753 } LDKNetAddress_LDKOnionV2_Body;
4755 typedef struct LDKNetAddress_LDKOnionV3_Body {
4757 * The ed25519 long-term public key of the peer
4759 struct LDKThirtyTwoBytes ed25519_pubkey;
4761 * The checksum of the pubkey and version, as included in the onion address
4765 * The version byte, as defined by the Tor Onion v3 spec.
4769 * The port on which the node is listening
4772 } LDKNetAddress_LDKOnionV3_Body;
4774 typedef struct MUST_USE_STRUCT LDKNetAddress {
4775 LDKNetAddress_Tag tag;
4777 LDKNetAddress_LDKIPv4_Body i_pv4;
4778 LDKNetAddress_LDKIPv6_Body i_pv6;
4779 LDKNetAddress_LDKOnionV2_Body onion_v2;
4780 LDKNetAddress_LDKOnionV3_Body onion_v3;
4785 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
4786 * This corresponds to std::vector in C++
4788 typedef struct LDKCVec_NetAddressZ {
4790 * The elements in the array.
4791 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4793 struct LDKNetAddress *data;
4795 * The number of elements pointed to by `data`.
4798 } LDKCVec_NetAddressZ;
4803 * Information received in the latest node_announcement from this node.
4805 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
4807 * A pointer to the opaque Rust object.
4808 * Nearly everywhere, inner must be non-null, however in places where
4809 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4811 LDKnativeNodeAnnouncementInfo *inner;
4813 * Indicates that this is the only struct which contains the same pointer.
4814 * Rust functions which take ownership of an object provided via an argument require
4815 * this to be true and invalidate the object pointed to by inner.
4818 } LDKNodeAnnouncementInfo;
4821 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
4823 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
4825 * A pointer to the contents in the success state.
4826 * Reading from this pointer when `result_ok` is not set is undefined.
4828 struct LDKNodeAnnouncementInfo *result;
4830 * A pointer to the contents in the error state.
4831 * Reading from this pointer when `result_ok` is set is undefined.
4833 struct LDKDecodeError *err;
4834 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
4837 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
4838 * containing a crate::lightning::routing::network_graph::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4839 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4841 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
4843 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
4844 * `err` or `result` depending on the state of `result_ok`.
4846 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
4848 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
4851 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
4854 * A dynamically-allocated array of u64s of arbitrary size.
4855 * This corresponds to std::vector in C++
4857 typedef struct LDKCVec_u64Z {
4859 * The elements in the array.
4860 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4864 * The number of elements pointed to by `data`.
4872 * Details about a node in the network, known from the network announcement.
4874 typedef struct MUST_USE_STRUCT LDKNodeInfo {
4876 * A pointer to the opaque Rust object.
4877 * Nearly everywhere, inner must be non-null, however in places where
4878 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4880 LDKnativeNodeInfo *inner;
4882 * Indicates that this is the only struct which contains the same pointer.
4883 * Rust functions which take ownership of an object provided via an argument require
4884 * this to be true and invalidate the object pointed to by inner.
4890 * The contents of CResult_NodeInfoDecodeErrorZ
4892 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
4894 * A pointer to the contents in the success state.
4895 * Reading from this pointer when `result_ok` is not set is undefined.
4897 struct LDKNodeInfo *result;
4899 * A pointer to the contents in the error state.
4900 * Reading from this pointer when `result_ok` is set is undefined.
4902 struct LDKDecodeError *err;
4903 } LDKCResult_NodeInfoDecodeErrorZPtr;
4906 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
4907 * containing a crate::lightning::routing::network_graph::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4908 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4910 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
4912 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
4913 * `err` or `result` depending on the state of `result_ok`.
4915 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
4917 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
4920 } LDKCResult_NodeInfoDecodeErrorZ;
4925 * Represents the network as nodes and channels between them
4927 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4929 * A pointer to the opaque Rust object.
4930 * Nearly everywhere, inner must be non-null, however in places where
4931 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4933 LDKnativeNetworkGraph *inner;
4935 * Indicates that this is the only struct which contains the same pointer.
4936 * Rust functions which take ownership of an object provided via an argument require
4937 * this to be true and invalidate the object pointed to by inner.
4943 * The contents of CResult_NetworkGraphDecodeErrorZ
4945 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
4947 * A pointer to the contents in the success state.
4948 * Reading from this pointer when `result_ok` is not set is undefined.
4950 struct LDKNetworkGraph *result;
4952 * A pointer to the contents in the error state.
4953 * Reading from this pointer when `result_ok` is set is undefined.
4955 struct LDKDecodeError *err;
4956 } LDKCResult_NetworkGraphDecodeErrorZPtr;
4959 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
4960 * containing a crate::lightning::routing::network_graph::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
4961 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4963 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
4965 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
4966 * `err` or `result` depending on the state of `result_ok`.
4968 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
4970 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
4973 } LDKCResult_NetworkGraphDecodeErrorZ;
4978 * Features used within an `init` message.
4980 typedef struct MUST_USE_STRUCT LDKInitFeatures {
4982 * A pointer to the opaque Rust object.
4983 * Nearly everywhere, inner must be non-null, however in places where
4984 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4986 LDKnativeInitFeatures *inner;
4988 * Indicates that this is the only struct which contains the same pointer.
4989 * Rust functions which take ownership of an object provided via an argument require
4990 * this to be true and invalidate the object pointed to by inner.
4996 * The contents of CResult_InitFeaturesDecodeErrorZ
4998 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
5000 * A pointer to the contents in the success state.
5001 * Reading from this pointer when `result_ok` is not set is undefined.
5003 struct LDKInitFeatures *result;
5005 * A pointer to the contents in the error state.
5006 * Reading from this pointer when `result_ok` is set is undefined.
5008 struct LDKDecodeError *err;
5009 } LDKCResult_InitFeaturesDecodeErrorZPtr;
5012 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
5013 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5014 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5016 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
5018 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
5019 * `err` or `result` depending on the state of `result_ok`.
5021 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
5023 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
5026 } LDKCResult_InitFeaturesDecodeErrorZ;
5031 * Features used within a `node_announcement` message.
5033 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
5035 * A pointer to the opaque Rust object.
5036 * Nearly everywhere, inner must be non-null, however in places where
5037 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5039 LDKnativeNodeFeatures *inner;
5041 * Indicates that this is the only struct which contains the same pointer.
5042 * Rust functions which take ownership of an object provided via an argument require
5043 * this to be true and invalidate the object pointed to by inner.
5049 * The contents of CResult_NodeFeaturesDecodeErrorZ
5051 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
5053 * A pointer to the contents in the success state.
5054 * Reading from this pointer when `result_ok` is not set is undefined.
5056 struct LDKNodeFeatures *result;
5058 * A pointer to the contents in the error state.
5059 * Reading from this pointer when `result_ok` is set is undefined.
5061 struct LDKDecodeError *err;
5062 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
5065 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
5066 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5067 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5069 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
5071 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
5072 * `err` or `result` depending on the state of `result_ok`.
5074 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
5076 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
5079 } LDKCResult_NodeFeaturesDecodeErrorZ;
5084 * Features used within a `channel_announcement` message.
5086 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
5088 * A pointer to the opaque Rust object.
5089 * Nearly everywhere, inner must be non-null, however in places where
5090 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5092 LDKnativeChannelFeatures *inner;
5094 * Indicates that this is the only struct which contains the same pointer.
5095 * Rust functions which take ownership of an object provided via an argument require
5096 * this to be true and invalidate the object pointed to by inner.
5099 } LDKChannelFeatures;
5102 * The contents of CResult_ChannelFeaturesDecodeErrorZ
5104 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
5106 * A pointer to the contents in the success state.
5107 * Reading from this pointer when `result_ok` is not set is undefined.
5109 struct LDKChannelFeatures *result;
5111 * A pointer to the contents in the error state.
5112 * Reading from this pointer when `result_ok` is set is undefined.
5114 struct LDKDecodeError *err;
5115 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
5118 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
5119 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5120 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5122 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
5124 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
5125 * `err` or `result` depending on the state of `result_ok`.
5127 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
5129 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
5132 } LDKCResult_ChannelFeaturesDecodeErrorZ;
5137 * Features used within an invoice.
5139 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
5141 * A pointer to the opaque Rust object.
5142 * Nearly everywhere, inner must be non-null, however in places where
5143 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5145 LDKnativeInvoiceFeatures *inner;
5147 * Indicates that this is the only struct which contains the same pointer.
5148 * Rust functions which take ownership of an object provided via an argument require
5149 * this to be true and invalidate the object pointed to by inner.
5152 } LDKInvoiceFeatures;
5155 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
5157 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
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 LDKInvoiceFeatures *result;
5164 * A pointer to the contents in the error state.
5165 * Reading from this pointer when `result_ok` is set is undefined.
5167 struct LDKDecodeError *err;
5168 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
5171 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
5172 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5173 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5175 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
5177 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
5178 * `err` or `result` depending on the state of `result_ok`.
5180 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
5182 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
5185 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
5188 * The contents of CResult_NetAddressu8Z
5190 typedef union LDKCResult_NetAddressu8ZPtr {
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 LDKNetAddress *result;
5197 * A pointer to the contents in the error state.
5198 * Reading from this pointer when `result_ok` is set is undefined.
5201 } LDKCResult_NetAddressu8ZPtr;
5204 * A CResult_NetAddressu8Z represents the result of a fallible operation,
5205 * containing a crate::lightning::ln::msgs::NetAddress on success and a u8 on failure.
5206 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5208 typedef struct LDKCResult_NetAddressu8Z {
5210 * The contents of this CResult_NetAddressu8Z, accessible via either
5211 * `err` or `result` depending on the state of `result_ok`.
5213 union LDKCResult_NetAddressu8ZPtr contents;
5215 * Whether this CResult_NetAddressu8Z represents a success state.
5218 } LDKCResult_NetAddressu8Z;
5221 * The contents of CResult_CResult_NetAddressu8ZDecodeErrorZ
5223 typedef union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr {
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 LDKCResult_NetAddressu8Z *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_CResult_NetAddressu8ZDecodeErrorZPtr;
5237 * A CResult_CResult_NetAddressu8ZDecodeErrorZ represents the result of a fallible operation,
5238 * containing a crate::c_types::derived::CResult_NetAddressu8Z 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_CResult_NetAddressu8ZDecodeErrorZ {
5243 * The contents of this CResult_CResult_NetAddressu8ZDecodeErrorZ, accessible via either
5244 * `err` or `result` depending on the state of `result_ok`.
5246 union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr contents;
5248 * Whether this CResult_CResult_NetAddressu8ZDecodeErrorZ represents a success state.
5251 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZ;
5254 * The contents of CResult_NetAddressDecodeErrorZ
5256 typedef union LDKCResult_NetAddressDecodeErrorZPtr {
5258 * A pointer to the contents in the success state.
5259 * Reading from this pointer when `result_ok` is not set is undefined.
5261 struct LDKNetAddress *result;
5263 * A pointer to the contents in the error state.
5264 * Reading from this pointer when `result_ok` is set is undefined.
5266 struct LDKDecodeError *err;
5267 } LDKCResult_NetAddressDecodeErrorZPtr;
5270 * A CResult_NetAddressDecodeErrorZ represents the result of a fallible operation,
5271 * containing a crate::lightning::ln::msgs::NetAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
5272 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5274 typedef struct LDKCResult_NetAddressDecodeErrorZ {
5276 * The contents of this CResult_NetAddressDecodeErrorZ, accessible via either
5277 * `err` or `result` depending on the state of `result_ok`.
5279 union LDKCResult_NetAddressDecodeErrorZPtr contents;
5281 * Whether this CResult_NetAddressDecodeErrorZ represents a success state.
5284 } LDKCResult_NetAddressDecodeErrorZ;
5289 * An update_add_htlc message to be sent or received from a peer
5291 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
5293 * A pointer to the opaque Rust object.
5294 * Nearly everywhere, inner must be non-null, however in places where
5295 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5297 LDKnativeUpdateAddHTLC *inner;
5299 * Indicates that this is the only struct which contains the same pointer.
5300 * Rust functions which take ownership of an object provided via an argument require
5301 * this to be true and invalidate the object pointed to by inner.
5307 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
5308 * This corresponds to std::vector in C++
5310 typedef struct LDKCVec_UpdateAddHTLCZ {
5312 * The elements in the array.
5313 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5315 struct LDKUpdateAddHTLC *data;
5317 * The number of elements pointed to by `data`.
5320 } LDKCVec_UpdateAddHTLCZ;
5325 * An update_fulfill_htlc message to be sent or received from a peer
5327 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
5329 * A pointer to the opaque Rust object.
5330 * Nearly everywhere, inner must be non-null, however in places where
5331 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5333 LDKnativeUpdateFulfillHTLC *inner;
5335 * Indicates that this is the only struct which contains the same pointer.
5336 * Rust functions which take ownership of an object provided via an argument require
5337 * this to be true and invalidate the object pointed to by inner.
5340 } LDKUpdateFulfillHTLC;
5343 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
5344 * This corresponds to std::vector in C++
5346 typedef struct LDKCVec_UpdateFulfillHTLCZ {
5348 * The elements in the array.
5349 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5351 struct LDKUpdateFulfillHTLC *data;
5353 * The number of elements pointed to by `data`.
5356 } LDKCVec_UpdateFulfillHTLCZ;
5361 * An update_fail_htlc message to be sent or received from a peer
5363 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
5365 * A pointer to the opaque Rust object.
5366 * Nearly everywhere, inner must be non-null, however in places where
5367 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5369 LDKnativeUpdateFailHTLC *inner;
5371 * Indicates that this is the only struct which contains the same pointer.
5372 * Rust functions which take ownership of an object provided via an argument require
5373 * this to be true and invalidate the object pointed to by inner.
5376 } LDKUpdateFailHTLC;
5379 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
5380 * This corresponds to std::vector in C++
5382 typedef struct LDKCVec_UpdateFailHTLCZ {
5384 * The elements in the array.
5385 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5387 struct LDKUpdateFailHTLC *data;
5389 * The number of elements pointed to by `data`.
5392 } LDKCVec_UpdateFailHTLCZ;
5397 * An update_fail_malformed_htlc message to be sent or received from a peer
5399 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
5401 * A pointer to the opaque Rust object.
5402 * Nearly everywhere, inner must be non-null, however in places where
5403 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5405 LDKnativeUpdateFailMalformedHTLC *inner;
5407 * Indicates that this is the only struct which contains the same pointer.
5408 * Rust functions which take ownership of an object provided via an argument require
5409 * this to be true and invalidate the object pointed to by inner.
5412 } LDKUpdateFailMalformedHTLC;
5415 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
5416 * This corresponds to std::vector in C++
5418 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
5420 * The elements in the array.
5421 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5423 struct LDKUpdateFailMalformedHTLC *data;
5425 * The number of elements pointed to by `data`.
5428 } LDKCVec_UpdateFailMalformedHTLCZ;
5431 * The contents of CResult_AcceptChannelDecodeErrorZ
5433 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
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 LDKAcceptChannel *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_AcceptChannelDecodeErrorZPtr;
5447 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
5448 * containing a crate::lightning::ln::msgs::AcceptChannel 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_AcceptChannelDecodeErrorZ {
5453 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
5454 * `err` or `result` depending on the state of `result_ok`.
5456 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
5458 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
5461 } LDKCResult_AcceptChannelDecodeErrorZ;
5464 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
5466 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
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 LDKAnnouncementSignatures *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_AnnouncementSignaturesDecodeErrorZPtr;
5480 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
5481 * containing a crate::lightning::ln::msgs::AnnouncementSignatures 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_AnnouncementSignaturesDecodeErrorZ {
5486 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
5487 * `err` or `result` depending on the state of `result_ok`.
5489 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
5491 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
5494 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
5497 * The contents of CResult_ChannelReestablishDecodeErrorZ
5499 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
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 LDKChannelReestablish *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_ChannelReestablishDecodeErrorZPtr;
5513 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
5514 * containing a crate::lightning::ln::msgs::ChannelReestablish 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_ChannelReestablishDecodeErrorZ {
5519 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
5520 * `err` or `result` depending on the state of `result_ok`.
5522 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
5524 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
5527 } LDKCResult_ChannelReestablishDecodeErrorZ;
5530 * The contents of CResult_ClosingSignedDecodeErrorZ
5532 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
5534 * A pointer to the contents in the success state.
5535 * Reading from this pointer when `result_ok` is not set is undefined.
5537 struct LDKClosingSigned *result;
5539 * A pointer to the contents in the error state.
5540 * Reading from this pointer when `result_ok` is set is undefined.
5542 struct LDKDecodeError *err;
5543 } LDKCResult_ClosingSignedDecodeErrorZPtr;
5546 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
5547 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
5548 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5550 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
5552 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
5553 * `err` or `result` depending on the state of `result_ok`.
5555 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
5557 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
5560 } LDKCResult_ClosingSignedDecodeErrorZ;
5565 * A commitment_signed message to be sent or received from a peer
5567 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
5569 * A pointer to the opaque Rust object.
5570 * Nearly everywhere, inner must be non-null, however in places where
5571 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5573 LDKnativeCommitmentSigned *inner;
5575 * Indicates that this is the only struct which contains the same pointer.
5576 * Rust functions which take ownership of an object provided via an argument require
5577 * this to be true and invalidate the object pointed to by inner.
5580 } LDKCommitmentSigned;
5583 * The contents of CResult_CommitmentSignedDecodeErrorZ
5585 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
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 LDKCommitmentSigned *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_CommitmentSignedDecodeErrorZPtr;
5599 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
5600 * containing a crate::lightning::ln::msgs::CommitmentSigned 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_CommitmentSignedDecodeErrorZ {
5605 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
5606 * `err` or `result` depending on the state of `result_ok`.
5608 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
5610 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
5613 } LDKCResult_CommitmentSignedDecodeErrorZ;
5616 * The contents of CResult_FundingCreatedDecodeErrorZ
5618 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
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 LDKFundingCreated *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_FundingCreatedDecodeErrorZPtr;
5632 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
5633 * containing a crate::lightning::ln::msgs::FundingCreated 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_FundingCreatedDecodeErrorZ {
5638 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
5639 * `err` or `result` depending on the state of `result_ok`.
5641 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
5643 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
5646 } LDKCResult_FundingCreatedDecodeErrorZ;
5649 * The contents of CResult_FundingSignedDecodeErrorZ
5651 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
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 LDKFundingSigned *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_FundingSignedDecodeErrorZPtr;
5665 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
5666 * containing a crate::lightning::ln::msgs::FundingSigned 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_FundingSignedDecodeErrorZ {
5671 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
5672 * `err` or `result` depending on the state of `result_ok`.
5674 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
5676 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
5679 } LDKCResult_FundingSignedDecodeErrorZ;
5682 * The contents of CResult_FundingLockedDecodeErrorZ
5684 typedef union LDKCResult_FundingLockedDecodeErrorZPtr {
5686 * A pointer to the contents in the success state.
5687 * Reading from this pointer when `result_ok` is not set is undefined.
5689 struct LDKFundingLocked *result;
5691 * A pointer to the contents in the error state.
5692 * Reading from this pointer when `result_ok` is set is undefined.
5694 struct LDKDecodeError *err;
5695 } LDKCResult_FundingLockedDecodeErrorZPtr;
5698 * A CResult_FundingLockedDecodeErrorZ represents the result of a fallible operation,
5699 * containing a crate::lightning::ln::msgs::FundingLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
5700 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5702 typedef struct LDKCResult_FundingLockedDecodeErrorZ {
5704 * The contents of this CResult_FundingLockedDecodeErrorZ, accessible via either
5705 * `err` or `result` depending on the state of `result_ok`.
5707 union LDKCResult_FundingLockedDecodeErrorZPtr contents;
5709 * Whether this CResult_FundingLockedDecodeErrorZ represents a success state.
5712 } LDKCResult_FundingLockedDecodeErrorZ;
5717 * An init message to be sent or received from a peer
5719 typedef struct MUST_USE_STRUCT LDKInit {
5721 * A pointer to the opaque Rust object.
5722 * Nearly everywhere, inner must be non-null, however in places where
5723 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5725 LDKnativeInit *inner;
5727 * Indicates that this is the only struct which contains the same pointer.
5728 * Rust functions which take ownership of an object provided via an argument require
5729 * this to be true and invalidate the object pointed to by inner.
5735 * The contents of CResult_InitDecodeErrorZ
5737 typedef union LDKCResult_InitDecodeErrorZPtr {
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 LDKInit *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_InitDecodeErrorZPtr;
5751 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
5752 * containing a crate::lightning::ln::msgs::Init 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_InitDecodeErrorZ {
5757 * The contents of this CResult_InitDecodeErrorZ, accessible via either
5758 * `err` or `result` depending on the state of `result_ok`.
5760 union LDKCResult_InitDecodeErrorZPtr contents;
5762 * Whether this CResult_InitDecodeErrorZ represents a success state.
5765 } LDKCResult_InitDecodeErrorZ;
5768 * The contents of CResult_OpenChannelDecodeErrorZ
5770 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
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 LDKOpenChannel *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_OpenChannelDecodeErrorZPtr;
5784 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
5785 * containing a crate::lightning::ln::msgs::OpenChannel 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_OpenChannelDecodeErrorZ {
5790 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
5791 * `err` or `result` depending on the state of `result_ok`.
5793 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
5795 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
5798 } LDKCResult_OpenChannelDecodeErrorZ;
5801 * The contents of CResult_RevokeAndACKDecodeErrorZ
5803 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
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 LDKRevokeAndACK *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_RevokeAndACKDecodeErrorZPtr;
5817 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
5818 * containing a crate::lightning::ln::msgs::RevokeAndACK 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_RevokeAndACKDecodeErrorZ {
5823 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
5824 * `err` or `result` depending on the state of `result_ok`.
5826 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
5828 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
5831 } LDKCResult_RevokeAndACKDecodeErrorZ;
5834 * The contents of CResult_ShutdownDecodeErrorZ
5836 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
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 LDKShutdown *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_ShutdownDecodeErrorZPtr;
5850 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
5851 * containing a crate::lightning::ln::msgs::Shutdown 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_ShutdownDecodeErrorZ {
5856 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
5857 * `err` or `result` depending on the state of `result_ok`.
5859 union LDKCResult_ShutdownDecodeErrorZPtr contents;
5861 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
5864 } LDKCResult_ShutdownDecodeErrorZ;
5867 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
5869 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
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 LDKUpdateFailHTLC *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_UpdateFailHTLCDecodeErrorZPtr;
5883 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
5884 * containing a crate::lightning::ln::msgs::UpdateFailHTLC 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_UpdateFailHTLCDecodeErrorZ {
5889 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
5890 * `err` or `result` depending on the state of `result_ok`.
5892 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
5894 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
5897 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
5900 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
5902 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5904 * A pointer to the contents in the success state.
5905 * Reading from this pointer when `result_ok` is not set is undefined.
5907 struct LDKUpdateFailMalformedHTLC *result;
5909 * A pointer to the contents in the error state.
5910 * Reading from this pointer when `result_ok` is set is undefined.
5912 struct LDKDecodeError *err;
5913 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
5916 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
5917 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5918 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5920 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
5922 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
5923 * `err` or `result` depending on the state of `result_ok`.
5925 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
5927 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
5930 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
5935 * An update_fee message to be sent or received from a peer
5937 typedef struct MUST_USE_STRUCT LDKUpdateFee {
5939 * A pointer to the opaque Rust object.
5940 * Nearly everywhere, inner must be non-null, however in places where
5941 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5943 LDKnativeUpdateFee *inner;
5945 * Indicates that this is the only struct which contains the same pointer.
5946 * Rust functions which take ownership of an object provided via an argument require
5947 * this to be true and invalidate the object pointed to by inner.
5953 * The contents of CResult_UpdateFeeDecodeErrorZ
5955 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
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 LDKUpdateFee *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_UpdateFeeDecodeErrorZPtr;
5969 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
5970 * containing a crate::lightning::ln::msgs::UpdateFee 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_UpdateFeeDecodeErrorZ {
5975 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
5976 * `err` or `result` depending on the state of `result_ok`.
5978 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
5980 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
5983 } LDKCResult_UpdateFeeDecodeErrorZ;
5986 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
5988 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
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 LDKUpdateFulfillHTLC *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_UpdateFulfillHTLCDecodeErrorZPtr;
6002 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
6003 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC 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_UpdateFulfillHTLCDecodeErrorZ {
6008 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
6009 * `err` or `result` depending on the state of `result_ok`.
6011 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
6013 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
6016 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
6019 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
6021 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
6023 * A pointer to the contents in the success state.
6024 * Reading from this pointer when `result_ok` is not set is undefined.
6026 struct LDKUpdateAddHTLC *result;
6028 * A pointer to the contents in the error state.
6029 * Reading from this pointer when `result_ok` is set is undefined.
6031 struct LDKDecodeError *err;
6032 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
6035 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
6036 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
6037 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6039 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
6041 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
6042 * `err` or `result` depending on the state of `result_ok`.
6044 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
6046 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
6049 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
6054 * A ping message to be sent or received from a peer
6056 typedef struct MUST_USE_STRUCT LDKPing {
6058 * A pointer to the opaque Rust object.
6059 * Nearly everywhere, inner must be non-null, however in places where
6060 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6062 LDKnativePing *inner;
6064 * Indicates that this is the only struct which contains the same pointer.
6065 * Rust functions which take ownership of an object provided via an argument require
6066 * this to be true and invalidate the object pointed to by inner.
6072 * The contents of CResult_PingDecodeErrorZ
6074 typedef union LDKCResult_PingDecodeErrorZPtr {
6076 * A pointer to the contents in the success state.
6077 * Reading from this pointer when `result_ok` is not set is undefined.
6079 struct LDKPing *result;
6081 * A pointer to the contents in the error state.
6082 * Reading from this pointer when `result_ok` is set is undefined.
6084 struct LDKDecodeError *err;
6085 } LDKCResult_PingDecodeErrorZPtr;
6088 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
6089 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
6090 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6092 typedef struct LDKCResult_PingDecodeErrorZ {
6094 * The contents of this CResult_PingDecodeErrorZ, accessible via either
6095 * `err` or `result` depending on the state of `result_ok`.
6097 union LDKCResult_PingDecodeErrorZPtr contents;
6099 * Whether this CResult_PingDecodeErrorZ represents a success state.
6102 } LDKCResult_PingDecodeErrorZ;
6107 * A pong message to be sent or received from a peer
6109 typedef struct MUST_USE_STRUCT LDKPong {
6111 * A pointer to the opaque Rust object.
6112 * Nearly everywhere, inner must be non-null, however in places where
6113 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6115 LDKnativePong *inner;
6117 * Indicates that this is the only struct which contains the same pointer.
6118 * Rust functions which take ownership of an object provided via an argument require
6119 * this to be true and invalidate the object pointed to by inner.
6125 * The contents of CResult_PongDecodeErrorZ
6127 typedef union LDKCResult_PongDecodeErrorZPtr {
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 LDKPong *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_PongDecodeErrorZPtr;
6141 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
6142 * containing a crate::lightning::ln::msgs::Pong 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_PongDecodeErrorZ {
6147 * The contents of this CResult_PongDecodeErrorZ, accessible via either
6148 * `err` or `result` depending on the state of `result_ok`.
6150 union LDKCResult_PongDecodeErrorZPtr contents;
6152 * Whether this CResult_PongDecodeErrorZ represents a success state.
6155 } LDKCResult_PongDecodeErrorZ;
6158 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
6160 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
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 LDKUnsignedChannelAnnouncement *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_UnsignedChannelAnnouncementDecodeErrorZPtr;
6174 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
6175 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement 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_UnsignedChannelAnnouncementDecodeErrorZ {
6180 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
6181 * `err` or `result` depending on the state of `result_ok`.
6183 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
6185 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
6188 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
6191 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
6193 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
6195 * A pointer to the contents in the success state.
6196 * Reading from this pointer when `result_ok` is not set is undefined.
6198 struct LDKChannelAnnouncement *result;
6200 * A pointer to the contents in the error state.
6201 * Reading from this pointer when `result_ok` is set is undefined.
6203 struct LDKDecodeError *err;
6204 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
6207 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
6208 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
6209 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6211 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
6213 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
6214 * `err` or `result` depending on the state of `result_ok`.
6216 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
6218 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
6221 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
6226 * The unsigned part of a channel_update
6228 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
6230 * A pointer to the opaque Rust object.
6231 * Nearly everywhere, inner must be non-null, however in places where
6232 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6234 LDKnativeUnsignedChannelUpdate *inner;
6236 * Indicates that this is the only struct which contains the same pointer.
6237 * Rust functions which take ownership of an object provided via an argument require
6238 * this to be true and invalidate the object pointed to by inner.
6241 } LDKUnsignedChannelUpdate;
6244 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
6246 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
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 LDKUnsignedChannelUpdate *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_UnsignedChannelUpdateDecodeErrorZPtr;
6260 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
6261 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate 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_UnsignedChannelUpdateDecodeErrorZ {
6266 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
6267 * `err` or `result` depending on the state of `result_ok`.
6269 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
6271 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
6274 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
6277 * The contents of CResult_ChannelUpdateDecodeErrorZ
6279 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
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 LDKChannelUpdate *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_ChannelUpdateDecodeErrorZPtr;
6293 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
6294 * containing a crate::lightning::ln::msgs::ChannelUpdate 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_ChannelUpdateDecodeErrorZ {
6299 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
6300 * `err` or `result` depending on the state of `result_ok`.
6302 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
6304 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
6307 } LDKCResult_ChannelUpdateDecodeErrorZ;
6310 * The contents of CResult_ErrorMessageDecodeErrorZ
6312 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
6314 * A pointer to the contents in the success state.
6315 * Reading from this pointer when `result_ok` is not set is undefined.
6317 struct LDKErrorMessage *result;
6319 * A pointer to the contents in the error state.
6320 * Reading from this pointer when `result_ok` is set is undefined.
6322 struct LDKDecodeError *err;
6323 } LDKCResult_ErrorMessageDecodeErrorZPtr;
6326 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
6327 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
6328 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6330 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
6332 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
6333 * `err` or `result` depending on the state of `result_ok`.
6335 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
6337 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
6340 } LDKCResult_ErrorMessageDecodeErrorZ;
6345 * The unsigned part of a node_announcement
6347 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
6349 * A pointer to the opaque Rust object.
6350 * Nearly everywhere, inner must be non-null, however in places where
6351 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6353 LDKnativeUnsignedNodeAnnouncement *inner;
6355 * Indicates that this is the only struct which contains the same pointer.
6356 * Rust functions which take ownership of an object provided via an argument require
6357 * this to be true and invalidate the object pointed to by inner.
6360 } LDKUnsignedNodeAnnouncement;
6363 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
6365 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
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 LDKUnsignedNodeAnnouncement *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_UnsignedNodeAnnouncementDecodeErrorZPtr;
6379 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
6380 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement 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_UnsignedNodeAnnouncementDecodeErrorZ {
6385 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
6386 * `err` or `result` depending on the state of `result_ok`.
6388 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
6390 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
6393 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
6396 * The contents of CResult_NodeAnnouncementDecodeErrorZ
6398 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
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 LDKNodeAnnouncement *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_NodeAnnouncementDecodeErrorZPtr;
6412 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
6413 * containing a crate::lightning::ln::msgs::NodeAnnouncement 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_NodeAnnouncementDecodeErrorZ {
6418 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
6419 * `err` or `result` depending on the state of `result_ok`.
6421 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
6423 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
6426 } LDKCResult_NodeAnnouncementDecodeErrorZ;
6429 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
6431 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
6433 * A pointer to the contents in the success state.
6434 * Reading from this pointer when `result_ok` is not set is undefined.
6436 struct LDKQueryShortChannelIds *result;
6438 * A pointer to the contents in the error state.
6439 * Reading from this pointer when `result_ok` is set is undefined.
6441 struct LDKDecodeError *err;
6442 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
6445 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
6446 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
6447 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6449 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
6451 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
6452 * `err` or `result` depending on the state of `result_ok`.
6454 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
6456 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
6459 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
6464 * A reply_short_channel_ids_end message is sent as a reply to a
6465 * query_short_channel_ids message. The query recipient makes a best
6466 * effort to respond based on their local network view which may not be
6467 * a perfect view of the network.
6469 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
6471 * A pointer to the opaque Rust object.
6472 * Nearly everywhere, inner must be non-null, however in places where
6473 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6475 LDKnativeReplyShortChannelIdsEnd *inner;
6477 * Indicates that this is the only struct which contains the same pointer.
6478 * Rust functions which take ownership of an object provided via an argument require
6479 * this to be true and invalidate the object pointed to by inner.
6482 } LDKReplyShortChannelIdsEnd;
6485 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
6487 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
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 LDKReplyShortChannelIdsEnd *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_ReplyShortChannelIdsEndDecodeErrorZPtr;
6501 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
6502 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd 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_ReplyShortChannelIdsEndDecodeErrorZ {
6507 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
6508 * `err` or `result` depending on the state of `result_ok`.
6510 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
6512 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
6515 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
6518 * The contents of CResult_QueryChannelRangeDecodeErrorZ
6520 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
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 LDKQueryChannelRange *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_QueryChannelRangeDecodeErrorZPtr;
6534 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
6535 * containing a crate::lightning::ln::msgs::QueryChannelRange 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_QueryChannelRangeDecodeErrorZ {
6540 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
6541 * `err` or `result` depending on the state of `result_ok`.
6543 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
6545 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
6548 } LDKCResult_QueryChannelRangeDecodeErrorZ;
6551 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
6553 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
6555 * A pointer to the contents in the success state.
6556 * Reading from this pointer when `result_ok` is not set is undefined.
6558 struct LDKReplyChannelRange *result;
6560 * A pointer to the contents in the error state.
6561 * Reading from this pointer when `result_ok` is set is undefined.
6563 struct LDKDecodeError *err;
6564 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
6567 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
6568 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
6569 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6571 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
6573 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
6574 * `err` or `result` depending on the state of `result_ok`.
6576 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
6578 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
6581 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
6586 * A gossip_timestamp_filter message is used by a node to request
6587 * gossip relay for messages in the requested time range when the
6588 * gossip_queries feature has been negotiated.
6590 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
6592 * A pointer to the opaque Rust object.
6593 * Nearly everywhere, inner must be non-null, however in places where
6594 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6596 LDKnativeGossipTimestampFilter *inner;
6598 * Indicates that this is the only struct which contains the same pointer.
6599 * Rust functions which take ownership of an object provided via an argument require
6600 * this to be true and invalidate the object pointed to by inner.
6603 } LDKGossipTimestampFilter;
6606 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
6608 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
6610 * A pointer to the contents in the success state.
6611 * Reading from this pointer when `result_ok` is not set is undefined.
6613 struct LDKGossipTimestampFilter *result;
6615 * A pointer to the contents in the error state.
6616 * Reading from this pointer when `result_ok` is set is undefined.
6618 struct LDKDecodeError *err;
6619 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
6622 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
6623 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
6624 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6626 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
6628 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
6629 * `err` or `result` depending on the state of `result_ok`.
6631 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
6633 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
6636 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
6639 * When signing using a fallible method either an user-supplied `SignError` or a `CreationError`
6642 typedef enum LDKSignOrCreationError_Tag {
6644 * An error occurred during signing
6646 LDKSignOrCreationError_SignError,
6648 * An error occurred while building the transaction
6650 LDKSignOrCreationError_CreationError,
6652 * Must be last for serialization purposes
6654 LDKSignOrCreationError_Sentinel,
6655 } LDKSignOrCreationError_Tag;
6657 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
6658 LDKSignOrCreationError_Tag tag;
6661 enum LDKCreationError creation_error;
6664 } LDKSignOrCreationError;
6667 * The contents of CResult_InvoiceSignOrCreationErrorZ
6669 typedef union LDKCResult_InvoiceSignOrCreationErrorZPtr {
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 LDKInvoice *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 LDKSignOrCreationError *err;
6680 } LDKCResult_InvoiceSignOrCreationErrorZPtr;
6683 * A CResult_InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
6684 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
6685 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6687 typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
6689 * The contents of this CResult_InvoiceSignOrCreationErrorZ, accessible via either
6690 * `err` or `result` depending on the state of `result_ok`.
6692 union LDKCResult_InvoiceSignOrCreationErrorZPtr contents;
6694 * Whether this CResult_InvoiceSignOrCreationErrorZ represents a success state.
6697 } LDKCResult_InvoiceSignOrCreationErrorZ;
6700 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
6702 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
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 LDKDelayedPaymentOutputDescriptor *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_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
6716 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
6717 * containing a crate::lightning::chain::keysinterface::DelayedPaymentOutputDescriptor 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_DelayedPaymentOutputDescriptorDecodeErrorZ {
6722 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
6723 * `err` or `result` depending on the state of `result_ok`.
6725 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
6727 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
6730 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
6733 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
6735 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
6737 * A pointer to the contents in the success state.
6738 * Reading from this pointer when `result_ok` is not set is undefined.
6740 struct LDKStaticPaymentOutputDescriptor *result;
6742 * A pointer to the contents in the error state.
6743 * Reading from this pointer when `result_ok` is set is undefined.
6745 struct LDKDecodeError *err;
6746 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
6749 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
6750 * containing a crate::lightning::chain::keysinterface::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
6751 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6753 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
6755 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
6756 * `err` or `result` depending on the state of `result_ok`.
6758 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
6760 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
6763 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
6766 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
6768 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
6770 * A pointer to the contents in the success state.
6771 * Reading from this pointer when `result_ok` is not set is undefined.
6773 struct LDKSpendableOutputDescriptor *result;
6775 * A pointer to the contents in the error state.
6776 * Reading from this pointer when `result_ok` is set is undefined.
6778 struct LDKDecodeError *err;
6779 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
6782 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
6783 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
6784 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6786 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
6788 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
6789 * `err` or `result` depending on the state of `result_ok`.
6791 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
6793 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
6796 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
6799 * The contents of CResult_SignDecodeErrorZ
6801 typedef union LDKCResult_SignDecodeErrorZPtr {
6803 * A pointer to the contents in the success state.
6804 * Reading from this pointer when `result_ok` is not set is undefined.
6806 struct LDKSign *result;
6808 * A pointer to the contents in the error state.
6809 * Reading from this pointer when `result_ok` is set is undefined.
6811 struct LDKDecodeError *err;
6812 } LDKCResult_SignDecodeErrorZPtr;
6815 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
6816 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
6817 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6819 typedef struct LDKCResult_SignDecodeErrorZ {
6821 * The contents of this CResult_SignDecodeErrorZ, accessible via either
6822 * `err` or `result` depending on the state of `result_ok`.
6824 union LDKCResult_SignDecodeErrorZPtr contents;
6826 * Whether this CResult_SignDecodeErrorZ represents a success state.
6829 } LDKCResult_SignDecodeErrorZ;
6832 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
6833 * allows recovering the exact public key which created the signature given the message.
6835 typedef struct LDKRecoverableSignature {
6837 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
6840 uint8_t serialized_form[68];
6841 } LDKRecoverableSignature;
6844 * The contents of CResult_RecoverableSignatureNoneZ
6846 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
6848 * A pointer to the contents in the success state.
6849 * Reading from this pointer when `result_ok` is not set is undefined.
6851 struct LDKRecoverableSignature *result;
6853 * Note that this value is always NULL, as there are no contents in the Err variant
6856 } LDKCResult_RecoverableSignatureNoneZPtr;
6859 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
6860 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
6861 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6863 typedef struct LDKCResult_RecoverableSignatureNoneZ {
6865 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
6866 * `err` or `result` depending on the state of `result_ok`.
6868 union LDKCResult_RecoverableSignatureNoneZPtr contents;
6870 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
6873 } LDKCResult_RecoverableSignatureNoneZ;
6876 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
6877 * This corresponds to std::vector in C++
6879 typedef struct LDKCVec_CVec_u8ZZ {
6881 * The elements in the array.
6882 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6884 struct LDKCVec_u8Z *data;
6886 * The number of elements pointed to by `data`.
6889 } LDKCVec_CVec_u8ZZ;
6892 * The contents of CResult_CVec_CVec_u8ZZNoneZ
6894 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
6896 * A pointer to the contents in the success state.
6897 * Reading from this pointer when `result_ok` is not set is undefined.
6899 struct LDKCVec_CVec_u8ZZ *result;
6901 * Note that this value is always NULL, as there are no contents in the Err variant
6904 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
6907 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
6908 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
6909 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6911 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
6913 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
6914 * `err` or `result` depending on the state of `result_ok`.
6916 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
6918 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
6921 } LDKCResult_CVec_CVec_u8ZZNoneZ;
6926 * A simple implementation of Sign that just keeps the private keys in memory.
6928 * This implementation performs no policy checks and is insufficient by itself as
6929 * a secure external signer.
6931 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
6933 * A pointer to the opaque Rust object.
6934 * Nearly everywhere, inner must be non-null, however in places where
6935 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6937 LDKnativeInMemorySigner *inner;
6939 * Indicates that this is the only struct which contains the same pointer.
6940 * Rust functions which take ownership of an object provided via an argument require
6941 * this to be true and invalidate the object pointed to by inner.
6944 } LDKInMemorySigner;
6947 * The contents of CResult_InMemorySignerDecodeErrorZ
6949 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
6951 * A pointer to the contents in the success state.
6952 * Reading from this pointer when `result_ok` is not set is undefined.
6954 struct LDKInMemorySigner *result;
6956 * A pointer to the contents in the error state.
6957 * Reading from this pointer when `result_ok` is set is undefined.
6959 struct LDKDecodeError *err;
6960 } LDKCResult_InMemorySignerDecodeErrorZPtr;
6963 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
6964 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
6965 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6967 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
6969 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
6970 * `err` or `result` depending on the state of `result_ok`.
6972 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
6974 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
6977 } LDKCResult_InMemorySignerDecodeErrorZ;
6980 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
6981 * This corresponds to std::vector in C++
6983 typedef struct LDKCVec_TxOutZ {
6985 * The elements in the array.
6986 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6988 struct LDKTxOut *data;
6990 * The number of elements pointed to by `data`.
6996 * The contents of CResult_TransactionNoneZ
6998 typedef union LDKCResult_TransactionNoneZPtr {
7000 * A pointer to the contents in the success state.
7001 * Reading from this pointer when `result_ok` is not set is undefined.
7003 struct LDKTransaction *result;
7005 * Note that this value is always NULL, as there are no contents in the Err variant
7008 } LDKCResult_TransactionNoneZPtr;
7011 * A CResult_TransactionNoneZ represents the result of a fallible operation,
7012 * containing a crate::c_types::Transaction on success and a () on failure.
7013 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7015 typedef struct LDKCResult_TransactionNoneZ {
7017 * The contents of this CResult_TransactionNoneZ, accessible via either
7018 * `err` or `result` depending on the state of `result_ok`.
7020 union LDKCResult_TransactionNoneZPtr contents;
7022 * Whether this CResult_TransactionNoneZ represents a success state.
7025 } LDKCResult_TransactionNoneZ;
7028 * The contents of CResult_NoneErrorZ
7030 typedef union LDKCResult_NoneErrorZPtr {
7032 * Note that this value is always NULL, as there are no contents in the OK variant
7036 * A pointer to the contents in the error state.
7037 * Reading from this pointer when `result_ok` is set is undefined.
7039 enum LDKIOError *err;
7040 } LDKCResult_NoneErrorZPtr;
7043 * A CResult_NoneErrorZ represents the result of a fallible operation,
7044 * containing a () on success and a crate::c_types::IOError on failure.
7045 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7047 typedef struct LDKCResult_NoneErrorZ {
7049 * The contents of this CResult_NoneErrorZ, accessible via either
7050 * `err` or `result` depending on the state of `result_ok`.
7052 union LDKCResult_NoneErrorZPtr contents;
7054 * Whether this CResult_NoneErrorZ represents a success state.
7057 } LDKCResult_NoneErrorZ;
7060 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
7061 * This corresponds to std::vector in C++
7063 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
7065 * The elements in the array.
7066 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7068 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
7070 * The number of elements pointed to by `data`.
7073 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
7076 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
7078 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
7080 * A pointer to the contents in the success state.
7081 * Reading from this pointer when `result_ok` is not set is undefined.
7083 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
7085 * A pointer to the contents in the error state.
7086 * Reading from this pointer when `result_ok` is set is undefined.
7088 enum LDKIOError *err;
7089 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
7092 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
7093 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
7094 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7096 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
7098 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
7099 * `err` or `result` depending on the state of `result_ok`.
7101 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
7103 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
7106 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
7109 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
7112 typedef enum LDKAPIError_Tag {
7114 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
7115 * are documented, but generally indicates some precondition of a function was violated.
7117 LDKAPIError_APIMisuseError,
7119 * Due to a high feerate, we were unable to complete the request.
7120 * For example, this may be returned if the feerate implies we cannot open a channel at the
7121 * requested value, but opening a larger channel would succeed.
7123 LDKAPIError_FeeRateTooHigh,
7125 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
7126 * too-many-hops, etc).
7128 LDKAPIError_RouteError,
7130 * We were unable to complete the request as the Channel required to do so is unable to
7131 * complete the request (or was not found). This can take many forms, including disconnected
7132 * peer, channel at capacity, channel shutting down, etc.
7134 LDKAPIError_ChannelUnavailable,
7136 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
7137 * attempted action to fail.
7139 LDKAPIError_MonitorUpdateFailed,
7141 * Must be last for serialization purposes
7143 LDKAPIError_Sentinel,
7146 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
7148 * A human-readable error message
7151 } LDKAPIError_LDKAPIMisuseError_Body;
7153 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
7155 * A human-readable error message
7159 * The feerate which was too high.
7162 } LDKAPIError_LDKFeeRateTooHigh_Body;
7164 typedef struct LDKAPIError_LDKRouteError_Body {
7166 * A human-readable error message
7169 } LDKAPIError_LDKRouteError_Body;
7171 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
7173 * A human-readable error message
7176 } LDKAPIError_LDKChannelUnavailable_Body;
7178 typedef struct MUST_USE_STRUCT LDKAPIError {
7179 LDKAPIError_Tag tag;
7181 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
7182 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
7183 LDKAPIError_LDKRouteError_Body route_error;
7184 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
7189 * The contents of CResult_NoneAPIErrorZ
7191 typedef union LDKCResult_NoneAPIErrorZPtr {
7193 * Note that this value is always NULL, as there are no contents in the OK variant
7197 * A pointer to the contents in the error state.
7198 * Reading from this pointer when `result_ok` is set is undefined.
7200 struct LDKAPIError *err;
7201 } LDKCResult_NoneAPIErrorZPtr;
7204 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
7205 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
7206 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7208 typedef struct LDKCResult_NoneAPIErrorZ {
7210 * The contents of this CResult_NoneAPIErrorZ, accessible via either
7211 * `err` or `result` depending on the state of `result_ok`.
7213 union LDKCResult_NoneAPIErrorZPtr contents;
7215 * Whether this CResult_NoneAPIErrorZ represents a success state.
7218 } LDKCResult_NoneAPIErrorZ;
7221 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
7222 * This corresponds to std::vector in C++
7224 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
7226 * The elements in the array.
7227 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7229 struct LDKCResult_NoneAPIErrorZ *data;
7231 * The number of elements pointed to by `data`.
7234 } LDKCVec_CResult_NoneAPIErrorZZ;
7237 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
7238 * This corresponds to std::vector in C++
7240 typedef struct LDKCVec_APIErrorZ {
7242 * The elements in the array.
7243 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7245 struct LDKAPIError *data;
7247 * The number of elements pointed to by `data`.
7250 } LDKCVec_APIErrorZ;
7253 * If a payment fails to send, it can be in one of several states. This enum is returned as the
7254 * Err() type describing which state the payment is in, see the description of individual enum
7257 typedef enum LDKPaymentSendFailure_Tag {
7259 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
7260 * send the payment at all. No channel state has been changed or messages sent to peers, and
7261 * once you've changed the parameter at error, you can freely retry the payment in full.
7263 LDKPaymentSendFailure_ParameterError,
7265 * A parameter in a single path which was passed to send_payment was invalid, preventing us
7266 * from attempting to send the payment at all. No channel state has been changed or messages
7267 * sent to peers, and once you've changed the parameter at error, you can freely retry the
7270 * The results here are ordered the same as the paths in the route object which was passed to
7273 LDKPaymentSendFailure_PathParameterError,
7275 * All paths which were attempted failed to send, with no channel state change taking place.
7276 * You can freely retry the payment in full (though you probably want to do so over different
7277 * paths than the ones selected).
7279 LDKPaymentSendFailure_AllFailedRetrySafe,
7281 * Some paths which were attempted failed to send, though possibly not all. At least some
7282 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
7283 * in over-/re-payment.
7285 * The results here are ordered the same as the paths in the route object which was passed to
7286 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
7287 * retried (though there is currently no API with which to do so).
7289 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
7290 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
7291 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
7292 * with the latest update_id.
7294 LDKPaymentSendFailure_PartialFailure,
7296 * Must be last for serialization purposes
7298 LDKPaymentSendFailure_Sentinel,
7299 } LDKPaymentSendFailure_Tag;
7301 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
7302 LDKPaymentSendFailure_Tag tag;
7305 struct LDKAPIError parameter_error;
7308 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
7311 struct LDKCVec_APIErrorZ all_failed_retry_safe;
7314 struct LDKCVec_CResult_NoneAPIErrorZZ partial_failure;
7317 } LDKPaymentSendFailure;
7320 * The contents of CResult_NonePaymentSendFailureZ
7322 typedef union LDKCResult_NonePaymentSendFailureZPtr {
7324 * Note that this value is always NULL, as there are no contents in the OK variant
7328 * A pointer to the contents in the error state.
7329 * Reading from this pointer when `result_ok` is set is undefined.
7331 struct LDKPaymentSendFailure *err;
7332 } LDKCResult_NonePaymentSendFailureZPtr;
7335 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
7336 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
7337 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7339 typedef struct LDKCResult_NonePaymentSendFailureZ {
7341 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
7342 * `err` or `result` depending on the state of `result_ok`.
7344 union LDKCResult_NonePaymentSendFailureZPtr contents;
7346 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
7349 } LDKCResult_NonePaymentSendFailureZ;
7352 * A tuple of 2 elements. See the individual fields for the types contained.
7354 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
7356 * The element at position 0
7358 struct LDKThirtyTwoBytes a;
7360 * The element at position 1
7362 struct LDKThirtyTwoBytes b;
7363 } LDKC2Tuple_PaymentHashPaymentSecretZ;
7366 * The contents of CResult_PaymentSecretAPIErrorZ
7368 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
7370 * A pointer to the contents in the success state.
7371 * Reading from this pointer when `result_ok` is not set is undefined.
7373 struct LDKThirtyTwoBytes *result;
7375 * A pointer to the contents in the error state.
7376 * Reading from this pointer when `result_ok` is set is undefined.
7378 struct LDKAPIError *err;
7379 } LDKCResult_PaymentSecretAPIErrorZPtr;
7382 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
7383 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7384 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7386 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
7388 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
7389 * `err` or `result` depending on the state of `result_ok`.
7391 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
7393 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
7396 } LDKCResult_PaymentSecretAPIErrorZ;
7399 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
7400 * This corresponds to std::vector in C++
7402 typedef struct LDKCVec_ChannelMonitorZ {
7404 * The elements in the array.
7405 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7407 struct LDKChannelMonitor *data;
7409 * The number of elements pointed to by `data`.
7412 } LDKCVec_ChannelMonitorZ;
7415 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
7416 * blocks are connected and disconnected.
7418 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
7419 * responsible for maintaining a set of monitors such that they can be updated accordingly as
7420 * channel state changes and HTLCs are resolved. See method documentation for specific
7423 * Implementations **must** ensure that updates are successfully applied and persisted upon method
7424 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
7425 * without taking any further action such as persisting the current state.
7427 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
7428 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
7429 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
7430 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
7431 * multiple instances.
7433 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
7434 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
7435 * [`PermanentFailure`]: channelmonitor::ChannelMonitorUpdateErr::PermanentFailure
7437 typedef struct LDKWatch {
7439 * An opaque pointer which is passed to your function implementations as an argument.
7440 * This has no meaning in the LDK, and can be NULL or any other value.
7444 * Watches a channel identified by `funding_txo` using `monitor`.
7446 * Implementations are responsible for watching the chain for the funding transaction along
7447 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
7448 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
7450 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
7451 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
7452 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
7454 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
7456 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
7458 * Implementations must call [`update_monitor`] with the given update. See
7459 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
7461 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
7462 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
7464 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
7466 * Returns any monitor events since the last call. Subsequent calls must only return new
7469 struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
7471 * Frees any resources associated with this object given its this_arg pointer.
7472 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7474 void (*free)(void *this_arg);
7478 * An interface to send a transaction to the Bitcoin network.
7480 typedef struct LDKBroadcasterInterface {
7482 * An opaque pointer which is passed to your function implementations as an argument.
7483 * This has no meaning in the LDK, and can be NULL or any other value.
7487 * Sends a transaction out to (hopefully) be mined.
7489 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
7491 * Frees any resources associated with this object given its this_arg pointer.
7492 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7494 void (*free)(void *this_arg);
7495 } LDKBroadcasterInterface;
7498 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
7499 * own the memory pointed to by data.
7501 typedef struct LDKu8slice {
7503 * A pointer to the byte buffer
7505 const uint8_t *data;
7507 * The number of bytes pointed to by `data`.
7513 * A trait to describe an object which can get user secrets and key material.
7515 typedef struct LDKKeysInterface {
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.
7522 * Get node secret key (aka node_id or network_key).
7524 * This method must return the same value each time it is called.
7526 struct LDKSecretKey (*get_node_secret)(const void *this_arg);
7528 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
7530 * This method should return a different value each time it is called, to avoid linking
7531 * on-chain funds across channels as controlled to the same user.
7533 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
7535 * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
7538 * This method should return a different value each time it is called, to avoid linking
7539 * on-chain funds across channels as controlled to the same user.
7541 struct LDKPublicKey (*get_shutdown_pubkey)(const void *this_arg);
7543 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
7544 * restarted with some stale data!
7546 * This method must return a different value each time it is called.
7548 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
7550 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
7551 * onion packets and for temporary channel IDs. There is no requirement that these be
7552 * persisted anywhere, though they must be unique across restarts.
7554 * This method must return a different value each time it is called.
7556 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
7558 * Reads a `Signer` for this `KeysInterface` from the given input stream.
7559 * This is only called during deserialization of other objects which contain
7560 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
7561 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
7562 * contain no versioning scheme. You may wish to include your own version prefix and ensure
7563 * you've read all of the provided bytes to ensure no corruption occurred.
7565 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
7567 * Sign an invoice's preimage (note that this is the preimage of the invoice, not the HTLC's
7568 * preimage). By parameterizing by the preimage instead of the hash, we allow implementors of
7569 * this trait to parse the invoice and make sure they're signing what they expect, rather than
7570 * blindly signing the hash.
7572 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKCVec_u8Z invoice_preimage);
7574 * Frees any resources associated with this object given its this_arg pointer.
7575 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7577 void (*free)(void *this_arg);
7581 * A trait which should be implemented to provide feerate information on a number of time
7584 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
7585 * called from inside the library in response to chain events, P2P events, or timer events).
7587 typedef struct LDKFeeEstimator {
7589 * An opaque pointer which is passed to your function implementations as an argument.
7590 * This has no meaning in the LDK, and can be NULL or any other value.
7594 * Gets estimated satoshis of fee required per 1000 Weight-Units.
7596 * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
7597 * don't put us below 1 satoshi-per-byte).
7599 * This translates to:
7600 * * satoshis-per-byte * 250
7601 * * ceil(satoshis-per-kbyte / 4)
7603 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
7605 * Frees any resources associated with this object given its this_arg pointer.
7606 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7608 void (*free)(void *this_arg);
7612 * A trait encapsulating the operations required of a logger
7614 typedef struct LDKLogger {
7616 * An opaque pointer which is passed to your function implementations as an argument.
7617 * This has no meaning in the LDK, and can be NULL or any other value.
7623 void (*log)(const void *this_arg, const char *record);
7625 * Frees any resources associated with this object given its this_arg pointer.
7626 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7628 void (*free)(void *this_arg);
7634 * Manager which keeps track of a number of channels and sends messages to the appropriate
7635 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
7637 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
7638 * to individual Channels.
7640 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
7641 * all peers during write/read (though does not modify this instance, only the instance being
7642 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
7643 * called funding_transaction_generated for outbound channels).
7645 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
7646 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
7647 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
7648 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
7649 * the serialization process). If the deserialized version is out-of-date compared to the
7650 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
7651 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
7653 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
7654 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
7655 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
7656 * block_connected() to step towards your best block) upon deserialization before using the
7659 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
7660 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
7661 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
7662 * offline for a full minute. In order to track this, you must call
7663 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
7665 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
7666 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
7667 * essentially you should default to using a SimpleRefChannelManager, and use a
7668 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
7669 * you're using lightning-net-tokio.
7671 typedef struct MUST_USE_STRUCT LDKChannelManager {
7673 * A pointer to the opaque Rust object.
7674 * Nearly everywhere, inner must be non-null, however in places where
7675 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7677 LDKnativeChannelManager *inner;
7679 * Indicates that this is the only struct which contains the same pointer.
7680 * Rust functions which take ownership of an object provided via an argument require
7681 * this to be true and invalidate the object pointed to by inner.
7684 } LDKChannelManager;
7687 * A tuple of 2 elements. See the individual fields for the types contained.
7689 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
7691 * The element at position 0
7693 struct LDKThirtyTwoBytes a;
7695 * The element at position 1
7697 struct LDKChannelManager b;
7698 } LDKC2Tuple_BlockHashChannelManagerZ;
7701 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
7703 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
7705 * A pointer to the contents in the success state.
7706 * Reading from this pointer when `result_ok` is not set is undefined.
7708 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
7710 * A pointer to the contents in the error state.
7711 * Reading from this pointer when `result_ok` is set is undefined.
7713 struct LDKDecodeError *err;
7714 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
7717 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
7718 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
7719 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7721 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
7723 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
7724 * `err` or `result` depending on the state of `result_ok`.
7726 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
7728 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
7731 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
7734 * A trait indicating an object may generate message send events
7736 typedef struct LDKMessageSendEventsProvider {
7738 * An opaque pointer which is passed to your function implementations as an argument.
7739 * This has no meaning in the LDK, and can be NULL or any other value.
7743 * Gets the list of pending events which were generated by previous actions, clearing the list
7746 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
7748 * Frees any resources associated with this object given its this_arg pointer.
7749 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7751 void (*free)(void *this_arg);
7752 } LDKMessageSendEventsProvider;
7755 * A trait implemented for objects handling events from [`EventsProvider`].
7757 typedef struct LDKEventHandler {
7759 * An opaque pointer which is passed to your function implementations as an argument.
7760 * This has no meaning in the LDK, and can be NULL or any other value.
7764 * Handles the given [`Event`].
7766 * See [`EventsProvider`] for details that must be considered when implementing this method.
7768 void (*handle_event)(const void *this_arg, struct LDKEvent event);
7770 * Frees any resources associated with this object given its this_arg pointer.
7771 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7773 void (*free)(void *this_arg);
7777 * A trait indicating an object may generate events.
7779 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
7783 * See [`process_pending_events`] for requirements around event processing.
7785 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
7786 * event since the last invocation. The handler must either act upon the event immediately
7787 * or preserve it for later handling.
7789 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
7790 * consult the provider's documentation on the implication of processing events and how a handler
7791 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
7792 * [`ChainMonitor::process_pending_events`]).
7794 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
7797 * [`process_pending_events`]: Self::process_pending_events
7798 * [`handle_event`]: EventHandler::handle_event
7799 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
7800 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
7802 typedef struct LDKEventsProvider {
7804 * An opaque pointer which is passed to your function implementations as an argument.
7805 * This has no meaning in the LDK, and can be NULL or any other value.
7809 * Processes any events generated since the last call using the given event handler.
7811 * Subsequent calls must only process new events. However, handlers must be capable of handling
7812 * duplicate events across process restarts. This may occur if the provider was recovered from
7813 * an old state (i.e., it hadn't been successfully persisted after processing pending events).
7815 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
7817 * Frees any resources associated with this object given its this_arg pointer.
7818 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7820 void (*free)(void *this_arg);
7821 } LDKEventsProvider;
7826 * Configuration we set when applicable.
7828 * Default::default() provides sane defaults.
7830 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
7832 * A pointer to the opaque Rust object.
7833 * Nearly everywhere, inner must be non-null, however in places where
7834 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7836 LDKnativeChannelHandshakeConfig *inner;
7838 * Indicates that this is the only struct which contains the same pointer.
7839 * Rust functions which take ownership of an object provided via an argument require
7840 * this to be true and invalidate the object pointed to by inner.
7843 } LDKChannelHandshakeConfig;
7848 * Optional channel limits which are applied during channel creation.
7850 * These limits are only applied to our counterparty's limits, not our own.
7852 * Use 0/<type>::max_value() as appropriate to skip checking.
7854 * Provides sane defaults for most configurations.
7856 * Most additional limits are disabled except those with which specify a default in individual
7857 * field documentation. Note that this may result in barely-usable channels, but since they
7858 * are applied mostly only to incoming channels that's not much of a problem.
7860 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
7862 * A pointer to the opaque Rust object.
7863 * Nearly everywhere, inner must be non-null, however in places where
7864 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7866 LDKnativeChannelHandshakeLimits *inner;
7868 * Indicates that this is the only struct which contains the same pointer.
7869 * Rust functions which take ownership of an object provided via an argument require
7870 * this to be true and invalidate the object pointed to by inner.
7873 } LDKChannelHandshakeLimits;
7878 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
7880 * Default::default() provides sane defaults for most configurations
7881 * (but currently with 0 relay fees!)
7883 typedef struct MUST_USE_STRUCT LDKUserConfig {
7885 * A pointer to the opaque Rust object.
7886 * Nearly everywhere, inner must be non-null, however in places where
7887 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7889 LDKnativeUserConfig *inner;
7891 * Indicates that this is the only struct which contains the same pointer.
7892 * Rust functions which take ownership of an object provided via an argument require
7893 * this to be true and invalidate the object pointed to by inner.
7899 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
7902 typedef struct LDKAccess {
7904 * An opaque pointer which is passed to your function implementations as an argument.
7905 * This has no meaning in the LDK, and can be NULL or any other value.
7909 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
7910 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
7913 * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
7915 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
7917 * Frees any resources associated with this object given its this_arg pointer.
7918 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7920 void (*free)(void *this_arg);
7924 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
7927 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
7928 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
7929 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
7932 typedef struct LDKListen {
7934 * An opaque pointer which is passed to your function implementations as an argument.
7935 * This has no meaning in the LDK, and can be NULL or any other value.
7939 * Notifies the listener that a block was added at the given height.
7941 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
7943 * Notifies the listener that a block was removed at the given height.
7945 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
7947 * Frees any resources associated with this object given its this_arg pointer.
7948 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7950 void (*free)(void *this_arg);
7954 * The `Confirm` trait is used to notify when transactions have been confirmed on chain or
7955 * unconfirmed during a chain reorganization.
7957 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
7958 * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity
7959 * related to registered transactions and outputs. Upon notification, it would pass along the
7960 * matching transactions using this interface.
7964 * The intended use is as follows:
7965 * - Call [`transactions_confirmed`] to process any on-chain activity of interest.
7966 * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`]
7967 * that has been reorganized out of the chain.
7968 * - Call [`best_block_updated`] whenever a new chain tip becomes available.
7972 * Clients must call these methods in chain order. Specifically:
7973 * - Transactions confirmed in a block must be given before transactions confirmed in a later
7975 * - Dependent transactions within the same block must be given in topological order, possibly in
7977 * - Unconfirmed transactions must be given after the original confirmations and before any
7980 * See individual method documentation for further details.
7982 * [`transactions_confirmed`]: Self::transactions_confirmed
7983 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
7984 * [`best_block_updated`]: Self::best_block_updated
7985 * [`get_relevant_txids`]: Self::get_relevant_txids
7987 typedef struct LDKConfirm {
7989 * An opaque pointer which is passed to your function implementations as an argument.
7990 * This has no meaning in the LDK, and can be NULL or any other value.
7994 * Processes transactions confirmed in a block with a given header and height.
7996 * Should be called for any transactions registered by [`Filter::register_tx`] or any
7997 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
7998 * appearing in the same block do not need to be included in the same call; instead, multiple
7999 * calls with additional transactions may be made so long as they are made in [chain order].
8001 * May be called before or after [`best_block_updated`] for the corresponding block. However,
8002 * in the event of a chain reorganization, it must not be called with a `header` that is no
8003 * longer in the chain as of the last call to [`best_block_updated`].
8005 * [chain order]: Confirm#Order
8006 * [`best_block_updated`]: Self::best_block_updated
8008 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
8010 * Processes a transaction that is no longer confirmed as result of a chain reorganization.
8012 * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
8013 * reorganized out of the best chain. Once called, the given transaction should not be returned
8014 * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`].
8016 * [`get_relevant_txids`]: Self::get_relevant_txids
8017 * [`transactions_confirmed`]: Self::transactions_confirmed
8019 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
8021 * Processes an update to the best header connected at the given height.
8023 * Should be called when a new header is available but may be skipped for intermediary blocks
8024 * if they become available at the same time.
8026 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
8028 * Returns transactions that should be monitored for reorganization out of the chain.
8030 * Should include any transactions passed to [`transactions_confirmed`] that have insufficient
8031 * confirmations to be safe from a chain reorganization. Should not include any transactions
8032 * passed to [`transaction_unconfirmed`] unless later reconfirmed.
8034 * May be called to determine the subset of transactions that must still be monitored for
8035 * reorganization. Will be idempotent between calls but may change as a result of calls to the
8036 * other interface methods. Thus, this is useful to determine which transactions may need to be
8037 * given to [`transaction_unconfirmed`].
8039 * [`transactions_confirmed`]: Self::transactions_confirmed
8040 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
8042 struct LDKCVec_TxidZ (*get_relevant_txids)(const void *this_arg);
8044 * Frees any resources associated with this object given its this_arg pointer.
8045 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8047 void (*free)(void *this_arg);
8053 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
8055 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
8056 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
8057 * the return value of [`Filter::register_output`].
8059 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
8060 * may have been spent there. See [`Filter::register_output`] for details.
8062 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
8063 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
8065 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
8067 * A pointer to the opaque Rust object.
8068 * Nearly everywhere, inner must be non-null, however in places where
8069 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8071 LDKnativeWatchedOutput *inner;
8073 * Indicates that this is the only struct which contains the same pointer.
8074 * Rust functions which take ownership of an object provided via an argument require
8075 * this to be true and invalidate the object pointed to by inner.
8081 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
8084 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
8085 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
8086 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
8087 * receiving full blocks from a chain source, any further filtering is unnecessary.
8089 * After an output has been registered, subsequent block retrievals from the chain source must not
8090 * exclude any transactions matching the new criteria nor any in-block descendants of such
8093 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
8094 * should not block on I/O. Implementations should instead queue the newly monitored data to be
8095 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
8096 * invocation that has called the `Filter` must return [`TemporaryFailure`].
8098 * [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure
8099 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
8100 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
8102 typedef struct LDKFilter {
8104 * An opaque pointer which is passed to your function implementations as an argument.
8105 * This has no meaning in the LDK, and can be NULL or any other value.
8109 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
8110 * a spending condition.
8112 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
8114 * Registers interest in spends of a transaction output.
8116 * Optionally, when `output.block_hash` is set, should return any transaction spending the
8117 * output that is found in the corresponding block along with its index.
8119 * This return value is useful for Electrum clients in order to supply in-block descendant
8120 * transactions which otherwise were not included. This is not necessary for other clients if
8121 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
8124 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
8126 * Frees any resources associated with this object given its this_arg pointer.
8127 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8129 void (*free)(void *this_arg);
8133 * `Persist` defines behavior for persisting channel monitors: this could mean
8134 * writing once to disk, and/or uploading to one or more backup services.
8136 * Note that for every new monitor, you **must** persist the new `ChannelMonitor`
8137 * to disk/backups. And, on every update, you **must** persist either the
8138 * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk
8139 * of situations such as revoking a transaction, then crashing before this
8140 * revocation can be persisted, then unintentionally broadcasting a revoked
8141 * transaction and losing money. This is a risk because previous channel states
8142 * are toxic, so it's important that whatever channel state is persisted is
8145 typedef struct LDKPersist {
8147 * An opaque pointer which is passed to your function implementations as an argument.
8148 * This has no meaning in the LDK, and can be NULL or any other value.
8152 * Persist a new channel's data. The data can be stored any way you want, but
8153 * the identifier provided by Rust-Lightning is the channel's outpoint (and
8154 * it is up to you to maintain a correct mapping between the outpoint and the
8155 * stored channel data). Note that you **must** persist every new monitor to
8156 * disk. See the `Persist` trait documentation for more details.
8158 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
8159 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
8161 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data);
8163 * Update one channel's data. The provided `ChannelMonitor` has already
8164 * applied the given update.
8166 * Note that on every update, you **must** persist either the
8167 * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See
8168 * the `Persist` trait documentation for more details.
8170 * If an implementer chooses to persist the updates only, they need to make
8171 * sure that all the updates are applied to the `ChannelMonitors` *before*
8172 * the set of channel monitors is given to the `ChannelManager`
8173 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
8174 * applying a monitor update to a monitor. If full `ChannelMonitors` are
8175 * persisted, then there is no need to persist individual updates.
8177 * Note that there could be a performance tradeoff between persisting complete
8178 * channel monitors on every update vs. persisting only updates and applying
8179 * them in batches. The size of each monitor grows `O(number of state updates)`
8180 * whereas updates are small and `O(1)`.
8182 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
8183 * [`ChannelMonitorUpdate::write`] for writing out an update, and
8184 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
8186 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);
8188 * Frees any resources associated with this object given its this_arg pointer.
8189 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8191 void (*free)(void *this_arg);
8197 * An implementation of [`chain::Watch`] for monitoring channels.
8199 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
8200 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
8201 * or used independently to monitor channels remotely. See the [module-level documentation] for
8204 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
8205 * [module-level documentation]: crate::chain::chainmonitor
8207 typedef struct MUST_USE_STRUCT LDKChainMonitor {
8209 * A pointer to the opaque Rust object.
8210 * Nearly everywhere, inner must be non-null, however in places where
8211 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8213 LDKnativeChainMonitor *inner;
8215 * Indicates that this is the only struct which contains the same pointer.
8216 * Rust functions which take ownership of an object provided via an argument require
8217 * this to be true and invalidate the object pointed to by inner.
8225 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
8226 * and derives keys from that.
8228 * Your node_id is seed/0'
8229 * ChannelMonitor closes may use seed/1'
8230 * Cooperative closes may use seed/2'
8231 * The two close keys may be needed to claim on-chain funds!
8233 typedef struct MUST_USE_STRUCT LDKKeysManager {
8235 * A pointer to the opaque Rust object.
8236 * Nearly everywhere, inner must be non-null, however in places where
8237 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8239 LDKnativeKeysManager *inner;
8241 * Indicates that this is the only struct which contains the same pointer.
8242 * Rust functions which take ownership of an object provided via an argument require
8243 * this to be true and invalidate the object pointed to by inner.
8251 * Chain-related parameters used to construct a new `ChannelManager`.
8253 * Typically, the block-specific parameters are derived from the best block hash for the network,
8254 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
8255 * are not needed when deserializing a previously constructed `ChannelManager`.
8257 typedef struct MUST_USE_STRUCT LDKChainParameters {
8259 * A pointer to the opaque Rust object.
8260 * Nearly everywhere, inner must be non-null, however in places where
8261 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8263 LDKnativeChainParameters *inner;
8265 * Indicates that this is the only struct which contains the same pointer.
8266 * Rust functions which take ownership of an object provided via an argument require
8267 * this to be true and invalidate the object pointed to by inner.
8270 } LDKChainParameters;
8275 * The best known block as identified by its hash and height.
8277 typedef struct MUST_USE_STRUCT LDKBestBlock {
8279 * A pointer to the opaque Rust object.
8280 * Nearly everywhere, inner must be non-null, however in places where
8281 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8283 LDKnativeBestBlock *inner;
8285 * Indicates that this is the only struct which contains the same pointer.
8286 * Rust functions which take ownership of an object provided via an argument require
8287 * this to be true and invalidate the object pointed to by inner.
8293 * A 3-byte byte array.
8295 typedef struct LDKThreeBytes {
8303 * A trait to describe an object which can receive channel messages.
8305 * Messages MAY be called in parallel when they originate from different their_node_ids, however
8306 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
8308 typedef struct LDKChannelMessageHandler {
8310 * An opaque pointer which is passed to your function implementations as an argument.
8311 * This has no meaning in the LDK, and can be NULL or any other value.
8315 * Handle an incoming open_channel message from the given peer.
8317 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
8319 * Handle an incoming accept_channel message from the given peer.
8321 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
8323 * Handle an incoming funding_created message from the given peer.
8325 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
8327 * Handle an incoming funding_signed message from the given peer.
8329 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
8331 * Handle an incoming funding_locked message from the given peer.
8333 void (*handle_funding_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg);
8335 * Handle an incoming shutdown message from the given peer.
8337 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);
8339 * Handle an incoming closing_signed message from the given peer.
8341 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
8343 * Handle an incoming update_add_htlc message from the given peer.
8345 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
8347 * Handle an incoming update_fulfill_htlc message from the given peer.
8349 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
8351 * Handle an incoming update_fail_htlc message from the given peer.
8353 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
8355 * Handle an incoming update_fail_malformed_htlc message from the given peer.
8357 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
8359 * Handle an incoming commitment_signed message from the given peer.
8361 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
8363 * Handle an incoming revoke_and_ack message from the given peer.
8365 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
8367 * Handle an incoming update_fee message from the given peer.
8369 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
8371 * Handle an incoming announcement_signatures message from the given peer.
8373 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
8375 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
8376 * is believed to be possible in the future (eg they're sending us messages we don't
8377 * understand or indicate they require unknown feature bits), no_connection_possible is set
8378 * and any outstanding channels should be failed.
8380 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
8382 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
8384 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
8386 * Handle an incoming channel_reestablish message from the given peer.
8388 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
8390 * Handle an incoming channel update from the given peer.
8392 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
8394 * Handle an incoming error message from the given peer.
8396 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
8398 * Implementation of MessageSendEventsProvider for this object.
8400 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
8402 * Frees any resources associated with this object given its this_arg pointer.
8403 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8405 void (*free)(void *this_arg);
8406 } LDKChannelMessageHandler;
8411 * Arguments for the creation of a ChannelManager that are not deserialized.
8413 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
8415 * 1) Deserialize all stored ChannelMonitors.
8416 * 2) Deserialize the ChannelManager by filling in this struct and calling:
8417 * <(BlockHash, ChannelManager)>::read(reader, args)
8418 * This may result in closing some Channels if the ChannelMonitor is newer than the stored
8419 * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted.
8420 * 3) If you are not fetching full blocks, register all relevant ChannelMonitor outpoints the same
8421 * way you would handle a `chain::Filter` call using ChannelMonitor::get_outputs_to_watch() and
8422 * ChannelMonitor::get_funding_txo().
8423 * 4) Reconnect blocks on your ChannelMonitors.
8424 * 5) Disconnect/connect blocks on the ChannelManager.
8425 * 6) Move the ChannelMonitors into your local chain::Watch.
8427 * Note that the ordering of #4-6 is not of importance, however all three must occur before you
8428 * call any other methods on the newly-deserialized ChannelManager.
8430 * Note that because some channels may be closed during deserialization, it is critical that you
8431 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
8432 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
8433 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
8434 * not force-close the same channels but consider them live), you may end up revoking a state for
8435 * which you've already broadcasted the transaction.
8437 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
8439 * A pointer to the opaque Rust object.
8440 * Nearly everywhere, inner must be non-null, however in places where
8441 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8443 LDKnativeChannelManagerReadArgs *inner;
8445 * Indicates that this is the only struct which contains the same pointer.
8446 * Rust functions which take ownership of an object provided via an argument require
8447 * this to be true and invalidate the object pointed to by inner.
8450 } LDKChannelManagerReadArgs;
8455 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
8456 * This is used to convince the recipient that the channel is at a certain commitment
8457 * number even if they lost that data due to a local failure. Of course, the peer may lie
8458 * and even later commitments may have been revoked.
8460 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
8462 * A pointer to the opaque Rust object.
8463 * Nearly everywhere, inner must be non-null, however in places where
8464 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8466 LDKnativeDataLossProtect *inner;
8468 * Indicates that this is the only struct which contains the same pointer.
8469 * Rust functions which take ownership of an object provided via an argument require
8470 * this to be true and invalidate the object pointed to by inner.
8473 } LDKDataLossProtect;
8476 * A trait to describe an object which can receive routing messages.
8478 * # Implementor DoS Warnings
8480 * For `gossip_queries` messages there are potential DoS vectors when handling
8481 * inbound queries. Implementors using an on-disk network graph should be aware of
8482 * repeated disk I/O for queries accessing different parts of the network graph.
8484 typedef struct LDKRoutingMessageHandler {
8486 * An opaque pointer which is passed to your function implementations as an argument.
8487 * This has no meaning in the LDK, and can be NULL or any other value.
8491 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
8492 * false or returning an Err otherwise.
8494 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
8496 * Handle a channel_announcement message, returning true if it should be forwarded on, false
8497 * or returning an Err otherwise.
8499 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
8501 * Handle an incoming channel_update message, returning true if it should be forwarded on,
8502 * false or returning an Err otherwise.
8504 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
8506 * Handle some updates to the route graph that we learned due to an outbound failed payment.
8508 void (*handle_htlc_fail_channel_update)(const void *this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update);
8510 * Gets a subset of the channel announcements and updates required to dump our routing table
8511 * to a remote node, starting at the short_channel_id indicated by starting_point and
8512 * including the batch_amount entries immediately higher in numerical value than starting_point.
8514 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
8516 * Gets a subset of the node announcements required to dump our routing table to a remote node,
8517 * starting at the node *after* the provided publickey and including batch_amount entries
8518 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
8519 * If None is provided for starting_point, we start at the first node.
8521 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
8523 * Called when a connection is established with a peer. This can be used to
8524 * perform routing table synchronization using a strategy defined by the
8527 void (*sync_routing_table)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
8529 * Handles the reply of a query we initiated to learn about channels
8530 * for a given range of blocks. We can expect to receive one or more
8531 * replies to a single query.
8533 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
8535 * Handles the reply of a query we initiated asking for routing gossip
8536 * messages for a list of channels. We should receive this message when
8537 * a node has completed its best effort to send us the pertaining routing
8540 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
8542 * Handles when a peer asks us to send a list of short_channel_ids
8543 * for the requested range of blocks.
8545 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
8547 * Handles when a peer asks us to send routing gossip messages for a
8548 * list of short_channel_ids.
8550 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
8552 * Implementation of MessageSendEventsProvider for this object.
8554 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
8556 * Frees any resources associated with this object given its this_arg pointer.
8557 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8559 void (*free)(void *this_arg);
8560 } LDKRoutingMessageHandler;
8565 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
8566 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
8568 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
8570 * A pointer to the opaque Rust object.
8571 * Nearly everywhere, inner must be non-null, however in places where
8572 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8574 LDKnativeIgnoringMessageHandler *inner;
8576 * Indicates that this is the only struct which contains the same pointer.
8577 * Rust functions which take ownership of an object provided via an argument require
8578 * this to be true and invalidate the object pointed to by inner.
8581 } LDKIgnoringMessageHandler;
8586 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
8587 * You can provide one of these as the route_handler in a MessageHandler.
8589 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
8591 * A pointer to the opaque Rust object.
8592 * Nearly everywhere, inner must be non-null, however in places where
8593 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8595 LDKnativeErroringMessageHandler *inner;
8597 * Indicates that this is the only struct which contains the same pointer.
8598 * Rust functions which take ownership of an object provided via an argument require
8599 * this to be true and invalidate the object pointed to by inner.
8602 } LDKErroringMessageHandler;
8607 * Provides references to trait impls which handle different types of messages.
8609 typedef struct MUST_USE_STRUCT LDKMessageHandler {
8611 * A pointer to the opaque Rust object.
8612 * Nearly everywhere, inner must be non-null, however in places where
8613 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8615 LDKnativeMessageHandler *inner;
8617 * Indicates that this is the only struct which contains the same pointer.
8618 * Rust functions which take ownership of an object provided via an argument require
8619 * this to be true and invalidate the object pointed to by inner.
8622 } LDKMessageHandler;
8625 * Provides an object which can be used to send data to and which uniquely identifies a connection
8626 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
8627 * implement Hash to meet the PeerManager API.
8629 * For efficiency, Clone should be relatively cheap for this type.
8631 * You probably want to just extend an int and put a file descriptor in a struct and implement
8632 * send_data. Note that if you are using a higher-level net library that may call close() itself,
8633 * be careful to ensure you don't have races whereby you might register a new connection with an
8634 * fd which is the same as a previous one which has yet to be removed via
8635 * PeerManager::socket_disconnected().
8637 typedef struct LDKSocketDescriptor {
8639 * An opaque pointer which is passed to your function implementations as an argument.
8640 * This has no meaning in the LDK, and can be NULL or any other value.
8644 * Attempts to send some data from the given slice to the peer.
8646 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
8647 * Note that in the disconnected case, socket_disconnected must still fire and further write
8648 * attempts may occur until that time.
8650 * If the returned size is smaller than data.len(), a write_available event must
8651 * trigger the next time more data can be written. Additionally, until the a send_data event
8652 * completes fully, no further read_events should trigger on the same peer!
8654 * If a read_event on this descriptor had previously returned true (indicating that read
8655 * events should be paused to prevent DoS in the send buffer), resume_read may be set
8656 * indicating that read events on this descriptor should resume. A resume_read of false does
8657 * *not* imply that further read events should be paused.
8659 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
8661 * Disconnect the socket pointed to by this SocketDescriptor. Once this function returns, no
8662 * more calls to write_buffer_space_avail, read_event or socket_disconnected may be made with
8663 * this descriptor. No socket_disconnected call should be generated as a result of this call,
8664 * though races may occur whereby disconnect_socket is called after a call to
8665 * socket_disconnected but prior to socket_disconnected returning.
8667 void (*disconnect_socket)(void *this_arg);
8669 * Checks if two objects are equal given this object's this_arg pointer and another object.
8671 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
8673 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
8674 * This is used, for example, for inclusion of this object in a hash map.
8676 uint64_t (*hash)(const void *this_arg);
8678 * Creates a copy of the object pointed to by this_arg, for a copy of this SocketDescriptor.
8679 * Note that the ultimate copy of the SocketDescriptor will have all function pointers the same as the original.
8680 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new SocketDescriptor.
8682 void *(*clone)(const void *this_arg);
8684 * Frees any resources associated with this object given its this_arg pointer.
8685 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8687 void (*free)(void *this_arg);
8688 } LDKSocketDescriptor;
8693 * A PeerManager manages a set of peers, described by their SocketDescriptor and marshalls socket
8694 * events into messages which it passes on to its MessageHandlers.
8696 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
8697 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
8698 * essentially you should default to using a SimpleRefPeerManager, and use a
8699 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
8700 * you're using lightning-net-tokio.
8702 typedef struct MUST_USE_STRUCT LDKPeerManager {
8704 * A pointer to the opaque Rust object.
8705 * Nearly everywhere, inner must be non-null, however in places where
8706 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8708 LDKnativePeerManager *inner;
8710 * Indicates that this is the only struct which contains the same pointer.
8711 * Rust functions which take ownership of an object provided via an argument require
8712 * this to be true and invalidate the object pointed to by inner.
8720 * Static channel fields used to build transactions given per-commitment fields, organized by
8721 * broadcaster/countersignatory.
8723 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
8724 * as_holder_broadcastable and as_counterparty_broadcastable functions.
8726 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
8728 * A pointer to the opaque Rust object.
8729 * Nearly everywhere, inner must be non-null, however in places where
8730 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8732 LDKnativeDirectedChannelTransactionParameters *inner;
8734 * Indicates that this is the only struct which contains the same pointer.
8735 * Rust functions which take ownership of an object provided via an argument require
8736 * this to be true and invalidate the object pointed to by inner.
8739 } LDKDirectedChannelTransactionParameters;
8744 * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
8745 * This exists only to make accessing a RwLock<NetworkGraph> possible from
8746 * the C bindings, as it can be done directly in Rust code.
8748 typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
8750 * A pointer to the opaque Rust object.
8751 * Nearly everywhere, inner must be non-null, however in places where
8752 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8754 LDKnativeLockedNetworkGraph *inner;
8756 * Indicates that this is the only struct which contains the same pointer.
8757 * Rust functions which take ownership of an object provided via an argument require
8758 * this to be true and invalidate the object pointed to by inner.
8761 } LDKLockedNetworkGraph;
8766 * Receives and validates network updates from peers,
8767 * stores authentic and relevant data as a network graph.
8768 * This network graph is then used for routing payments.
8769 * Provides interface to help with initial routing sync by
8770 * serving historical announcements.
8772 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
8774 * A pointer to the opaque Rust object.
8775 * Nearly everywhere, inner must be non-null, however in places where
8776 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8778 LDKnativeNetGraphMsgHandler *inner;
8780 * Indicates that this is the only struct which contains the same pointer.
8781 * Rust functions which take ownership of an object provided via an argument require
8782 * this to be true and invalidate the object pointed to by inner.
8785 } LDKNetGraphMsgHandler;
8790 * FilesystemPersister persists channel data on disk, where each channel's
8791 * data is stored in a file named after its funding outpoint.
8793 * Warning: this module does the best it can with calls to persist data, but it
8794 * can only guarantee that the data is passed to the drive. It is up to the
8795 * drive manufacturers to do the actual persistence properly, which they often
8796 * don't (especially on consumer-grade hardware). Therefore, it is up to the
8797 * user to validate their entire storage stack, to ensure the writes are
8799 * Corollary: especially when dealing with larger amounts of money, it is best
8800 * practice to have multiple channel data backups and not rely only on one
8801 * FilesystemPersister.
8803 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
8805 * A pointer to the opaque Rust object.
8806 * Nearly everywhere, inner must be non-null, however in places where
8807 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8809 LDKnativeFilesystemPersister *inner;
8811 * Indicates that this is the only struct which contains the same pointer.
8812 * Rust functions which take ownership of an object provided via an argument require
8813 * this to be true and invalidate the object pointed to by inner.
8816 } LDKFilesystemPersister;
8821 * Data of the `RawInvoice` that is encoded in the data part
8823 typedef struct MUST_USE_STRUCT LDKRawDataPart {
8825 * A pointer to the opaque Rust object.
8826 * Nearly everywhere, inner must be non-null, however in places where
8827 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8829 LDKnativeRawDataPart *inner;
8831 * Indicates that this is the only struct which contains the same pointer.
8832 * Rust functions which take ownership of an object provided via an argument require
8833 * this to be true and invalidate the object pointed to by inner.
8843 typedef struct MUST_USE_STRUCT LDKSha256 {
8845 * A pointer to the opaque Rust object.
8846 * Nearly everywhere, inner must be non-null, however in places where
8847 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8849 LDKnativeSha256 *inner;
8851 * Indicates that this is the only struct which contains the same pointer.
8852 * Rust functions which take ownership of an object provided via an argument require
8853 * this to be true and invalidate the object pointed to by inner.
8861 * `min_final_cltv_expiry` to use for the last HTLC in the route
8863 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiry {
8865 * A pointer to the opaque Rust object.
8866 * Nearly everywhere, inner must be non-null, however in places where
8867 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8869 LDKnativeMinFinalCltvExpiry *inner;
8871 * Indicates that this is the only struct which contains the same pointer.
8872 * Rust functions which take ownership of an object provided via an argument require
8873 * this to be true and invalidate the object pointed to by inner.
8876 } LDKMinFinalCltvExpiry;
8879 * Integer in the range `0..32`
8881 typedef struct LDKu5 {
8886 * A 20-byte byte array.
8888 typedef struct LDKTwentyBytes {
8896 * Fallback address in case no LN payment is possible
8898 typedef enum LDKFallback_Tag {
8899 LDKFallback_SegWitProgram,
8900 LDKFallback_PubKeyHash,
8901 LDKFallback_ScriptHash,
8903 * Must be last for serialization purposes
8905 LDKFallback_Sentinel,
8908 typedef struct LDKFallback_LDKSegWitProgram_Body {
8909 struct LDKu5 version;
8910 struct LDKCVec_u8Z program;
8911 } LDKFallback_LDKSegWitProgram_Body;
8913 typedef struct MUST_USE_STRUCT LDKFallback {
8914 LDKFallback_Tag tag;
8916 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
8918 struct LDKTwentyBytes pub_key_hash;
8921 struct LDKTwentyBytes script_hash;
8926 extern const uintptr_t MAX_BUF_SIZE;
8928 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
8930 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
8932 extern const uint32_t ANTI_REORG_DELAY;
8934 extern const uint16_t BREAKDOWN_TIMEOUT;
8936 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
8938 extern const uint32_t MIN_FINAL_CLTV_EXPIRY;
8940 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
8942 extern const uint8_t TAG_PAYMENT_HASH;
8944 extern const uint8_t TAG_DESCRIPTION;
8946 extern const uint8_t TAG_PAYEE_PUB_KEY;
8948 extern const uint8_t TAG_DESCRIPTION_HASH;
8950 extern const uint8_t TAG_EXPIRY_TIME;
8952 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
8954 extern const uint8_t TAG_FALLBACK;
8956 extern const uint8_t TAG_ROUTE;
8958 extern const uint8_t TAG_PAYMENT_SECRET;
8960 extern const uint8_t TAG_FEATURES;
8962 struct LDKStr _ldk_get_compiled_version(void);
8964 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
8967 * Frees the data buffer, if data_is_owned is set and datalen > 0.
8969 void Transaction_free(struct LDKTransaction _res);
8972 * Frees the data pointed to by script_pubkey.
8974 void TxOut_free(struct LDKTxOut _res);
8977 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
8979 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
8982 * Frees the data buffer, if chars_is_owned is set and len > 0.
8984 void Str_free(struct LDKStr _res);
8987 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
8989 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
8992 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
8994 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
8997 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
8999 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
9002 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
9003 * but with all dynamically-allocated buffers duplicated in new buffers.
9005 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
9008 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
9010 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
9013 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
9015 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
9018 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
9020 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
9023 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
9024 * but with all dynamically-allocated buffers duplicated in new buffers.
9026 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
9029 * Creates a new CResult_SecretKeyErrorZ in the success state.
9031 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
9034 * Creates a new CResult_SecretKeyErrorZ in the error state.
9036 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
9039 * Frees any resources used by the CResult_SecretKeyErrorZ.
9041 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
9044 * Creates a new CResult_PublicKeyErrorZ in the success state.
9046 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
9049 * Creates a new CResult_PublicKeyErrorZ in the error state.
9051 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
9054 * Frees any resources used by the CResult_PublicKeyErrorZ.
9056 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
9059 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
9061 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
9064 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
9066 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
9069 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
9071 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
9074 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
9075 * but with all dynamically-allocated buffers duplicated in new buffers.
9077 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
9080 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
9082 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
9085 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
9087 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
9090 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
9092 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
9095 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
9096 * but with all dynamically-allocated buffers duplicated in new buffers.
9098 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
9101 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
9103 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
9106 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
9108 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
9111 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
9113 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
9116 * Constructs a new COption_u32Z containing a u32
9118 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
9121 * Constructs a new COption_u32Z containing nothing
9123 struct LDKCOption_u32Z COption_u32Z_none(void);
9126 * Frees any resources associated with the u32, if we are in the Some state
9128 void COption_u32Z_free(struct LDKCOption_u32Z _res);
9131 * Creates a new COption_u32Z which has the same data as `orig`
9132 * but with all dynamically-allocated buffers duplicated in new buffers.
9134 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
9137 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
9139 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
9142 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
9144 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
9147 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
9149 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
9152 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
9153 * but with all dynamically-allocated buffers duplicated in new buffers.
9155 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
9158 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
9160 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
9163 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
9165 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
9168 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
9170 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
9173 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
9174 * but with all dynamically-allocated buffers duplicated in new buffers.
9176 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
9179 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
9181 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
9184 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
9186 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
9189 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
9191 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
9194 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
9195 * but with all dynamically-allocated buffers duplicated in new buffers.
9197 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
9200 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9202 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
9205 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
9207 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
9210 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
9212 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9215 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
9217 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
9220 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
9221 * but with all dynamically-allocated buffers duplicated in new buffers.
9223 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9226 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
9228 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
9231 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
9233 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9236 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
9238 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
9241 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
9242 * but with all dynamically-allocated buffers duplicated in new buffers.
9244 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9247 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
9249 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
9252 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
9254 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9257 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
9259 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
9262 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
9263 * but with all dynamically-allocated buffers duplicated in new buffers.
9265 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9268 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
9270 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
9273 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
9275 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
9278 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
9280 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
9283 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
9285 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
9288 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
9290 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
9293 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
9295 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
9298 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
9299 * but with all dynamically-allocated buffers duplicated in new buffers.
9301 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
9304 * Creates a new CResult_SiPrefixNoneZ in the success state.
9306 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_ok(enum LDKSiPrefix o);
9309 * Creates a new CResult_SiPrefixNoneZ in the error state.
9311 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_err(void);
9314 * Frees any resources used by the CResult_SiPrefixNoneZ.
9316 void CResult_SiPrefixNoneZ_free(struct LDKCResult_SiPrefixNoneZ _res);
9319 * Creates a new CResult_SiPrefixNoneZ which has the same data as `orig`
9320 * but with all dynamically-allocated buffers duplicated in new buffers.
9322 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_clone(const struct LDKCResult_SiPrefixNoneZ *NONNULL_PTR orig);
9325 * Creates a new CResult_InvoiceNoneZ in the success state.
9327 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_ok(struct LDKInvoice o);
9330 * Creates a new CResult_InvoiceNoneZ in the error state.
9332 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_err(void);
9335 * Frees any resources used by the CResult_InvoiceNoneZ.
9337 void CResult_InvoiceNoneZ_free(struct LDKCResult_InvoiceNoneZ _res);
9340 * Creates a new CResult_InvoiceNoneZ which has the same data as `orig`
9341 * but with all dynamically-allocated buffers duplicated in new buffers.
9343 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_clone(const struct LDKCResult_InvoiceNoneZ *NONNULL_PTR orig);
9346 * Creates a new CResult_SignedRawInvoiceNoneZ in the success state.
9348 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_ok(struct LDKSignedRawInvoice o);
9351 * Creates a new CResult_SignedRawInvoiceNoneZ in the error state.
9353 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_err(void);
9356 * Frees any resources used by the CResult_SignedRawInvoiceNoneZ.
9358 void CResult_SignedRawInvoiceNoneZ_free(struct LDKCResult_SignedRawInvoiceNoneZ _res);
9361 * Creates a new CResult_SignedRawInvoiceNoneZ which has the same data as `orig`
9362 * but with all dynamically-allocated buffers duplicated in new buffers.
9364 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_clone(const struct LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR orig);
9367 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9369 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
9372 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
9374 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
9377 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
9379 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
9382 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
9384 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
9387 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
9389 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
9392 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
9394 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
9397 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9399 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
9402 * Constructs a new COption_u64Z containing a u64
9404 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
9407 * Constructs a new COption_u64Z containing nothing
9409 struct LDKCOption_u64Z COption_u64Z_none(void);
9412 * Frees any resources associated with the u64, if we are in the Some state
9414 void COption_u64Z_free(struct LDKCOption_u64Z _res);
9417 * Creates a new COption_u64Z which has the same data as `orig`
9418 * but with all dynamically-allocated buffers duplicated in new buffers.
9420 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
9423 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
9425 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
9428 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
9430 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
9433 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
9435 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
9438 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
9439 * but with all dynamically-allocated buffers duplicated in new buffers.
9441 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
9444 * Creates a new CResult_NoneSemanticErrorZ in the success state.
9446 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
9449 * Creates a new CResult_NoneSemanticErrorZ in the error state.
9451 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
9454 * Frees any resources used by the CResult_NoneSemanticErrorZ.
9456 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
9459 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
9460 * but with all dynamically-allocated buffers duplicated in new buffers.
9462 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
9465 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
9467 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
9470 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
9472 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
9475 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
9477 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
9480 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
9481 * but with all dynamically-allocated buffers duplicated in new buffers.
9483 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
9486 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
9488 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
9491 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
9493 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
9496 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
9498 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
9501 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
9502 * but with all dynamically-allocated buffers duplicated in new buffers.
9504 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
9507 * Creates a new CResult_ExpiryTimeCreationErrorZ in the success state.
9509 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_ok(struct LDKExpiryTime o);
9512 * Creates a new CResult_ExpiryTimeCreationErrorZ in the error state.
9514 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_err(enum LDKCreationError e);
9517 * Frees any resources used by the CResult_ExpiryTimeCreationErrorZ.
9519 void CResult_ExpiryTimeCreationErrorZ_free(struct LDKCResult_ExpiryTimeCreationErrorZ _res);
9522 * Creates a new CResult_ExpiryTimeCreationErrorZ which has the same data as `orig`
9523 * but with all dynamically-allocated buffers duplicated in new buffers.
9525 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_clone(const struct LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR orig);
9528 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9530 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
9533 * Creates a new CResult_RouteHintCreationErrorZ in the success state.
9535 struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_ok(struct LDKRouteHint o);
9538 * Creates a new CResult_RouteHintCreationErrorZ in the error state.
9540 struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_err(enum LDKCreationError e);
9543 * Frees any resources used by the CResult_RouteHintCreationErrorZ.
9545 void CResult_RouteHintCreationErrorZ_free(struct LDKCResult_RouteHintCreationErrorZ _res);
9548 * Creates a new CResult_RouteHintCreationErrorZ which has the same data as `orig`
9549 * but with all dynamically-allocated buffers duplicated in new buffers.
9551 struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_clone(const struct LDKCResult_RouteHintCreationErrorZ *NONNULL_PTR orig);
9554 * Creates a new CResult_StringErrorZ in the success state.
9556 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
9559 * Creates a new CResult_StringErrorZ in the error state.
9561 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
9564 * Frees any resources used by the CResult_StringErrorZ.
9566 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
9569 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
9571 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
9574 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
9576 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
9579 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
9581 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
9584 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
9585 * but with all dynamically-allocated buffers duplicated in new buffers.
9587 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
9590 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
9592 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
9595 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
9597 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
9600 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
9602 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
9605 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
9606 * but with all dynamically-allocated buffers duplicated in new buffers.
9608 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
9611 * Creates a new CResult_NoneMonitorUpdateErrorZ in the success state.
9613 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
9616 * Creates a new CResult_NoneMonitorUpdateErrorZ in the error state.
9618 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
9621 * Frees any resources used by the CResult_NoneMonitorUpdateErrorZ.
9623 void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res);
9626 * Creates a new CResult_NoneMonitorUpdateErrorZ which has the same data as `orig`
9627 * but with all dynamically-allocated buffers duplicated in new buffers.
9629 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
9632 * Creates a new tuple which has the same data as `orig`
9633 * but with all dynamically-allocated buffers duplicated in new buffers.
9635 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
9638 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
9640 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
9643 * Frees any resources used by the C2Tuple_OutPointScriptZ.
9645 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
9648 * Creates a new tuple which has the same data as `orig`
9649 * but with all dynamically-allocated buffers duplicated in new buffers.
9651 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
9654 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
9656 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
9659 * Frees any resources used by the C2Tuple_u32ScriptZ.
9661 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
9664 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9666 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
9669 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
9671 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
9674 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
9676 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
9679 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9681 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
9684 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9686 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
9689 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9691 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
9694 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9696 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
9699 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
9701 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
9704 * Frees any resources used by the C2Tuple_usizeTransactionZ.
9706 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
9709 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9711 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
9714 * Creates a new tuple which has the same data as `orig`
9715 * but with all dynamically-allocated buffers duplicated in new buffers.
9717 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
9720 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
9722 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
9725 * Frees any resources used by the C2Tuple_u32TxOutZ.
9727 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
9730 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9732 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
9735 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
9737 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
9740 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
9742 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
9745 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9747 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
9750 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9752 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
9755 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
9757 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
9760 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
9762 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
9765 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
9767 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
9770 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
9771 * but with all dynamically-allocated buffers duplicated in new buffers.
9773 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
9776 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
9778 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
9781 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
9783 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
9786 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
9788 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
9791 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
9793 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
9796 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
9798 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
9801 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
9803 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
9806 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
9808 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
9811 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
9813 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
9816 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
9817 * but with all dynamically-allocated buffers duplicated in new buffers.
9819 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
9822 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9824 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
9827 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9829 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
9832 * Creates a new CResult_RouteDecodeErrorZ in the success state.
9834 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
9837 * Creates a new CResult_RouteDecodeErrorZ in the error state.
9839 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
9842 * Frees any resources used by the CResult_RouteDecodeErrorZ.
9844 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
9847 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
9848 * but with all dynamically-allocated buffers duplicated in new buffers.
9850 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
9853 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9855 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
9858 * Creates a new CResult_RouteLightningErrorZ in the success state.
9860 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
9863 * Creates a new CResult_RouteLightningErrorZ in the error state.
9865 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
9868 * Frees any resources used by the CResult_RouteLightningErrorZ.
9870 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
9873 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
9874 * but with all dynamically-allocated buffers duplicated in new buffers.
9876 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
9879 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9881 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
9884 * Creates a new CResult_boolLightningErrorZ in the success state.
9886 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
9889 * Creates a new CResult_boolLightningErrorZ in the error state.
9891 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
9894 * Frees any resources used by the CResult_boolLightningErrorZ.
9896 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
9899 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
9900 * but with all dynamically-allocated buffers duplicated in new buffers.
9902 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
9905 * Creates a new tuple which has the same data as `orig`
9906 * but with all dynamically-allocated buffers duplicated in new buffers.
9908 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
9911 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
9913 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
9916 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
9918 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
9921 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9923 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
9926 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9928 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
9931 * Creates a new CResult_NoneLightningErrorZ in the success state.
9933 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
9936 * Creates a new CResult_NoneLightningErrorZ in the error state.
9938 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
9941 * Frees any resources used by the CResult_NoneLightningErrorZ.
9943 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
9946 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
9947 * but with all dynamically-allocated buffers duplicated in new buffers.
9949 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
9952 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9954 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
9957 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
9959 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
9962 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
9964 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
9967 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
9969 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
9972 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
9973 * but with all dynamically-allocated buffers duplicated in new buffers.
9975 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
9978 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
9980 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
9983 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
9985 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
9988 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
9990 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
9993 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
9994 * but with all dynamically-allocated buffers duplicated in new buffers.
9996 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
9999 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
10001 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
10004 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
10006 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
10009 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
10011 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
10014 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
10015 * but with all dynamically-allocated buffers duplicated in new buffers.
10017 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
10020 * Creates a new CResult_TxOutAccessErrorZ in the success state.
10022 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
10025 * Creates a new CResult_TxOutAccessErrorZ in the error state.
10027 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
10030 * Frees any resources used by the CResult_TxOutAccessErrorZ.
10032 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
10035 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
10036 * but with all dynamically-allocated buffers duplicated in new buffers.
10038 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
10041 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
10043 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
10046 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
10048 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
10051 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
10053 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
10056 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10058 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
10061 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the success state.
10063 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
10066 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the error state.
10068 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
10071 * Frees any resources used by the CResult_DirectionalChannelInfoDecodeErrorZ.
10073 void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
10076 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ which has the same data as `orig`
10077 * but with all dynamically-allocated buffers duplicated in new buffers.
10079 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
10082 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
10084 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
10087 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
10089 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
10092 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
10094 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
10097 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
10098 * but with all dynamically-allocated buffers duplicated in new buffers.
10100 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
10103 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
10105 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
10108 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
10110 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
10113 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
10115 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
10118 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
10119 * but with all dynamically-allocated buffers duplicated in new buffers.
10121 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
10124 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10126 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
10129 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
10131 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
10134 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
10136 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
10139 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
10141 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
10144 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
10145 * but with all dynamically-allocated buffers duplicated in new buffers.
10147 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
10150 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10152 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
10155 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
10157 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
10160 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
10162 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
10165 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
10167 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
10170 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
10171 * but with all dynamically-allocated buffers duplicated in new buffers.
10173 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
10176 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
10178 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
10181 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
10183 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
10186 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
10188 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
10191 * Creates a new CResult_NetworkGraphDecodeErrorZ which has the same data as `orig`
10192 * but with all dynamically-allocated buffers duplicated in new buffers.
10194 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
10197 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
10199 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
10202 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
10204 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
10207 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
10209 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
10212 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
10214 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
10217 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
10219 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
10222 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
10224 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
10227 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
10229 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
10232 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
10234 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
10237 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
10239 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
10242 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
10244 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
10247 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
10249 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
10252 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
10254 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
10257 * Creates a new CResult_NetAddressu8Z in the success state.
10259 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
10262 * Creates a new CResult_NetAddressu8Z in the error state.
10264 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
10267 * Frees any resources used by the CResult_NetAddressu8Z.
10269 void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
10272 * Creates a new CResult_NetAddressu8Z which has the same data as `orig`
10273 * but with all dynamically-allocated buffers duplicated in new buffers.
10275 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
10278 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the success state.
10280 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
10283 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the error state.
10285 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
10288 * Frees any resources used by the CResult_CResult_NetAddressu8ZDecodeErrorZ.
10290 void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
10293 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ which has the same data as `orig`
10294 * but with all dynamically-allocated buffers duplicated in new buffers.
10296 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
10299 * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
10301 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
10304 * Creates a new CResult_NetAddressDecodeErrorZ in the error state.
10306 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
10309 * Frees any resources used by the CResult_NetAddressDecodeErrorZ.
10311 void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
10314 * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig`
10315 * but with all dynamically-allocated buffers duplicated in new buffers.
10317 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
10320 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10322 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
10325 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10327 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
10330 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10332 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
10335 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10337 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
10340 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
10342 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
10345 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
10347 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
10350 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
10352 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
10355 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
10356 * but with all dynamically-allocated buffers duplicated in new buffers.
10358 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
10361 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
10363 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
10366 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
10368 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
10371 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
10373 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
10376 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
10377 * but with all dynamically-allocated buffers duplicated in new buffers.
10379 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
10382 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
10384 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
10387 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
10389 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
10392 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
10394 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
10397 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
10398 * but with all dynamically-allocated buffers duplicated in new buffers.
10400 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
10403 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
10405 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
10408 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
10410 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
10413 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
10415 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
10418 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
10419 * but with all dynamically-allocated buffers duplicated in new buffers.
10421 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
10424 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
10426 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
10429 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
10431 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
10434 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
10436 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
10439 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
10440 * but with all dynamically-allocated buffers duplicated in new buffers.
10442 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
10445 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
10447 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
10450 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
10452 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
10455 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
10457 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
10460 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
10461 * but with all dynamically-allocated buffers duplicated in new buffers.
10463 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
10466 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
10468 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
10471 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
10473 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
10476 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
10478 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
10481 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
10482 * but with all dynamically-allocated buffers duplicated in new buffers.
10484 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
10487 * Creates a new CResult_FundingLockedDecodeErrorZ in the success state.
10489 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
10492 * Creates a new CResult_FundingLockedDecodeErrorZ in the error state.
10494 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
10497 * Frees any resources used by the CResult_FundingLockedDecodeErrorZ.
10499 void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
10502 * Creates a new CResult_FundingLockedDecodeErrorZ which has the same data as `orig`
10503 * but with all dynamically-allocated buffers duplicated in new buffers.
10505 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
10508 * Creates a new CResult_InitDecodeErrorZ in the success state.
10510 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
10513 * Creates a new CResult_InitDecodeErrorZ in the error state.
10515 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
10518 * Frees any resources used by the CResult_InitDecodeErrorZ.
10520 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
10523 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
10524 * but with all dynamically-allocated buffers duplicated in new buffers.
10526 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
10529 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
10531 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
10534 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
10536 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
10539 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
10541 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
10544 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
10545 * but with all dynamically-allocated buffers duplicated in new buffers.
10547 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
10550 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
10552 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
10555 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
10557 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
10560 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
10562 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
10565 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
10566 * but with all dynamically-allocated buffers duplicated in new buffers.
10568 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
10571 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
10573 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
10576 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
10578 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
10581 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
10583 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
10586 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
10587 * but with all dynamically-allocated buffers duplicated in new buffers.
10589 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
10592 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
10594 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
10597 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
10599 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
10602 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
10604 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
10607 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
10608 * but with all dynamically-allocated buffers duplicated in new buffers.
10610 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
10613 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
10615 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
10618 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
10620 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
10623 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
10625 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
10628 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
10629 * but with all dynamically-allocated buffers duplicated in new buffers.
10631 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
10634 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
10636 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
10639 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
10641 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
10644 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
10646 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
10649 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
10650 * but with all dynamically-allocated buffers duplicated in new buffers.
10652 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
10655 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
10657 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
10660 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
10662 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
10665 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
10667 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
10670 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
10671 * but with all dynamically-allocated buffers duplicated in new buffers.
10673 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
10676 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
10678 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
10681 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
10683 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
10686 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
10688 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
10691 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
10692 * but with all dynamically-allocated buffers duplicated in new buffers.
10694 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
10697 * Creates a new CResult_PingDecodeErrorZ in the success state.
10699 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
10702 * Creates a new CResult_PingDecodeErrorZ in the error state.
10704 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
10707 * Frees any resources used by the CResult_PingDecodeErrorZ.
10709 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
10712 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
10713 * but with all dynamically-allocated buffers duplicated in new buffers.
10715 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
10718 * Creates a new CResult_PongDecodeErrorZ in the success state.
10720 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
10723 * Creates a new CResult_PongDecodeErrorZ in the error state.
10725 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
10728 * Frees any resources used by the CResult_PongDecodeErrorZ.
10730 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
10733 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
10734 * but with all dynamically-allocated buffers duplicated in new buffers.
10736 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
10739 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
10741 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
10744 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
10746 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
10749 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
10751 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
10754 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
10755 * but with all dynamically-allocated buffers duplicated in new buffers.
10757 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
10760 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
10762 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
10765 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
10767 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
10770 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
10772 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
10775 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
10776 * but with all dynamically-allocated buffers duplicated in new buffers.
10778 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
10781 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
10783 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
10786 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
10788 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
10791 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
10793 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
10796 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
10797 * but with all dynamically-allocated buffers duplicated in new buffers.
10799 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
10802 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
10804 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
10807 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
10809 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
10812 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
10814 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
10817 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
10818 * but with all dynamically-allocated buffers duplicated in new buffers.
10820 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
10823 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
10825 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
10828 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
10830 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
10833 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
10835 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
10838 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
10839 * but with all dynamically-allocated buffers duplicated in new buffers.
10841 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
10844 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
10846 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
10849 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
10851 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
10854 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
10856 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
10859 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
10860 * but with all dynamically-allocated buffers duplicated in new buffers.
10862 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
10865 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
10867 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
10870 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
10872 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
10875 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
10877 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
10880 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
10881 * but with all dynamically-allocated buffers duplicated in new buffers.
10883 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
10886 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
10888 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
10891 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
10893 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
10896 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
10898 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
10901 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
10902 * but with all dynamically-allocated buffers duplicated in new buffers.
10904 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
10907 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
10909 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
10912 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
10914 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
10917 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
10919 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
10922 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
10923 * but with all dynamically-allocated buffers duplicated in new buffers.
10925 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
10928 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
10930 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
10933 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
10935 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
10938 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
10940 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
10943 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
10944 * but with all dynamically-allocated buffers duplicated in new buffers.
10946 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
10949 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
10951 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
10954 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
10956 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
10959 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
10961 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
10964 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
10965 * but with all dynamically-allocated buffers duplicated in new buffers.
10967 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
10970 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
10972 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
10975 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
10977 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
10980 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
10982 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
10985 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
10986 * but with all dynamically-allocated buffers duplicated in new buffers.
10988 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
10991 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state.
10993 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o);
10996 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state.
10998 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
11001 * Frees any resources used by the CResult_InvoiceSignOrCreationErrorZ.
11003 void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res);
11006 * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig`
11007 * but with all dynamically-allocated buffers duplicated in new buffers.
11009 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
11012 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
11014 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
11017 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
11019 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
11022 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
11024 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
11027 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
11028 * but with all dynamically-allocated buffers duplicated in new buffers.
11030 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
11033 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
11035 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
11038 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
11040 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
11043 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
11045 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
11048 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
11049 * but with all dynamically-allocated buffers duplicated in new buffers.
11051 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
11054 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
11056 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
11059 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
11061 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
11064 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
11066 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
11069 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
11070 * but with all dynamically-allocated buffers duplicated in new buffers.
11072 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
11075 * Creates a new tuple which has the same data as `orig`
11076 * but with all dynamically-allocated buffers duplicated in new buffers.
11078 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
11081 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
11083 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
11086 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
11088 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
11091 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
11093 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
11096 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
11098 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
11101 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
11103 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
11106 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
11107 * but with all dynamically-allocated buffers duplicated in new buffers.
11109 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
11112 * Creates a new CResult_SignatureNoneZ in the success state.
11114 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
11117 * Creates a new CResult_SignatureNoneZ in the error state.
11119 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
11122 * Frees any resources used by the CResult_SignatureNoneZ.
11124 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
11127 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
11128 * but with all dynamically-allocated buffers duplicated in new buffers.
11130 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
11133 * Creates a new CResult_SignDecodeErrorZ in the success state.
11135 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
11138 * Creates a new CResult_SignDecodeErrorZ in the error state.
11140 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
11143 * Frees any resources used by the CResult_SignDecodeErrorZ.
11145 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
11148 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
11149 * but with all dynamically-allocated buffers duplicated in new buffers.
11151 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
11154 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
11156 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
11159 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
11161 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
11164 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
11166 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
11169 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
11170 * but with all dynamically-allocated buffers duplicated in new buffers.
11172 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
11175 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11177 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
11180 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
11182 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
11185 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
11187 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
11190 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
11192 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
11195 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
11196 * but with all dynamically-allocated buffers duplicated in new buffers.
11198 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
11201 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
11203 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
11206 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
11208 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
11211 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
11213 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
11216 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
11217 * but with all dynamically-allocated buffers duplicated in new buffers.
11219 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
11222 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11224 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
11227 * Creates a new CResult_TransactionNoneZ in the success state.
11229 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
11232 * Creates a new CResult_TransactionNoneZ in the error state.
11234 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
11237 * Frees any resources used by the CResult_TransactionNoneZ.
11239 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
11242 * Creates a new CResult_NoneErrorZ in the success state.
11244 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
11247 * Creates a new CResult_NoneErrorZ in the error state.
11249 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
11252 * Frees any resources used by the CResult_NoneErrorZ.
11254 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
11257 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11259 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
11262 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
11264 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
11267 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
11269 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
11272 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
11274 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
11277 * Creates a new CResult_NoneAPIErrorZ in the success state.
11279 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
11282 * Creates a new CResult_NoneAPIErrorZ in the error state.
11284 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
11287 * Frees any resources used by the CResult_NoneAPIErrorZ.
11289 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
11292 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
11293 * but with all dynamically-allocated buffers duplicated in new buffers.
11295 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
11298 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11300 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
11303 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11305 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
11308 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
11310 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
11313 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
11315 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
11318 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
11320 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
11323 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
11324 * but with all dynamically-allocated buffers duplicated in new buffers.
11326 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
11329 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
11331 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
11334 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
11336 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
11339 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
11341 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
11344 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
11346 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
11349 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
11351 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
11354 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11356 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
11359 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
11361 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
11364 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
11366 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
11369 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
11371 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
11374 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
11376 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
11379 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
11381 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
11384 * Frees any resources used by the Event
11386 void Event_free(struct LDKEvent this_ptr);
11389 * Creates a copy of the Event
11391 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
11394 * Serialize the Event object into a byte array which can be read by Event_read
11396 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
11399 * Frees any resources used by the MessageSendEvent
11401 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
11404 * Creates a copy of the MessageSendEvent
11406 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
11409 * Calls the free function if one is set
11411 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
11414 * Calls the free function if one is set
11416 void EventsProvider_free(struct LDKEventsProvider this_ptr);
11419 * Calls the free function if one is set
11421 void EventHandler_free(struct LDKEventHandler this_ptr);
11424 * Frees any resources used by the APIError
11426 void APIError_free(struct LDKAPIError this_ptr);
11429 * Creates a copy of the APIError
11431 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
11434 * Creates a digital signature of a message given a SecretKey, like the node's secret.
11435 * 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.
11436 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
11438 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, struct LDKSecretKey sk);
11441 * Recovers the PublicKey of the signer of the message given the message and the signature.
11443 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
11446 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
11447 * and the PublicKey.
11449 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
11452 * Creates a copy of the Level
11454 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
11457 * Checks if two Levels contain equal inner contents.
11458 * This ignores pointers and is_owned flags and looks at the values in fields.
11460 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
11463 * Checks if two Levels contain equal inner contents.
11465 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
11468 * Returns the most verbose logging level.
11470 MUST_USE_RES enum LDKLevel Level_max(void);
11473 * Calls the free function if one is set
11475 void Logger_free(struct LDKLogger this_ptr);
11478 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
11480 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
11483 * Confirmations we will wait for before considering the channel locked in.
11484 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
11485 * equivalent limit applied to outbound channels).
11487 * Default value: 6.
11489 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
11492 * Confirmations we will wait for before considering the channel locked in.
11493 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
11494 * equivalent limit applied to outbound channels).
11496 * Default value: 6.
11498 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
11501 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
11502 * the number of blocks we have to punish our counterparty if they broadcast a revoked
11505 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
11506 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
11507 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
11508 * possibly with time in between to RBF the spending transaction).
11510 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
11511 * case of an honest unilateral channel close, which implicitly decrease the economic value of
11514 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
11515 * can tweak config to ask for more security, not less.
11517 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
11520 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
11521 * the number of blocks we have to punish our counterparty if they broadcast a revoked
11524 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
11525 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
11526 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
11527 * possibly with time in between to RBF the spending transaction).
11529 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
11530 * case of an honest unilateral channel close, which implicitly decrease the economic value of
11533 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
11534 * can tweak config to ask for more security, not less.
11536 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
11539 * Set to the smallest value HTLC we will accept to process.
11541 * This value is sent to our counterparty on channel-open and we close the channel any time
11542 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
11544 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
11547 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
11550 * Set to the smallest value HTLC we will accept to process.
11552 * This value is sent to our counterparty on channel-open and we close the channel any time
11553 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
11555 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
11558 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
11561 * Constructs a new ChannelHandshakeConfig given each field
11563 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);
11566 * Creates a copy of the ChannelHandshakeConfig
11568 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
11571 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
11573 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
11576 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
11578 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
11581 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
11582 * only applies to inbound channels.
11584 * Default value: 0.
11586 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11589 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
11590 * only applies to inbound channels.
11592 * Default value: 0.
11594 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11597 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
11598 * you to limit the maximum minimum-size they can require.
11600 * Default value: u64::max_value.
11602 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11605 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
11606 * you to limit the maximum minimum-size they can require.
11608 * Default value: u64::max_value.
11610 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11613 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
11614 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
11616 * Default value: 0.
11618 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11621 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
11622 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
11624 * Default value: 0.
11626 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11629 * The remote node will require we keep a certain amount in direct payment to ourselves at all
11630 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
11631 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
11633 * Default value: u64::max_value.
11635 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11638 * The remote node will require we keep a certain amount in direct payment to ourselves at all
11639 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
11640 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
11642 * Default value: u64::max_value.
11644 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11647 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
11648 * time. This allows you to set a minimum such value.
11650 * Default value: 0.
11652 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11655 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
11656 * time. This allows you to set a minimum such value.
11658 * Default value: 0.
11660 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
11663 * Before a channel is usable the funding transaction will need to be confirmed by at least a
11664 * certain number of blocks, specified by the node which is not the funder (as the funder can
11665 * assume they aren't going to double-spend themselves).
11666 * This config allows you to set a limit on the maximum amount of time to wait.
11668 * Default value: 144, or roughly one day and only applies to outbound channels.
11670 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11673 * Before a channel is usable the funding transaction will need to be confirmed by at least a
11674 * certain number of blocks, specified by the node which is not the funder (as the funder can
11675 * assume they aren't going to double-spend themselves).
11676 * This config allows you to set a limit on the maximum amount of time to wait.
11678 * Default value: 144, or roughly one day and only applies to outbound channels.
11680 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
11683 * Set to force the incoming channel to match our announced channel preference in
11686 * Default value: true, to make the default that no announced channels are possible (which is
11687 * appropriate for any nodes which are not online very reliably).
11689 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11692 * Set to force the incoming channel to match our announced channel preference in
11695 * Default value: true, to make the default that no announced channels are possible (which is
11696 * appropriate for any nodes which are not online very reliably).
11698 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
11701 * Set to the amount of time we're willing to wait to claim money back to us.
11703 * Not checking this value would be a security issue, as our peer would be able to set it to
11704 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
11706 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
11707 * reduce the loss of having useless locked funds (if your peer accepts)
11709 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11712 * Set to the amount of time we're willing to wait to claim money back to us.
11714 * Not checking this value would be a security issue, as our peer would be able to set it to
11715 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
11717 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
11718 * reduce the loss of having useless locked funds (if your peer accepts)
11720 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
11723 * Constructs a new ChannelHandshakeLimits given each field
11725 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);
11728 * Creates a copy of the ChannelHandshakeLimits
11730 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
11733 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
11735 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
11738 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
11740 void ChannelConfig_free(struct LDKChannelConfig this_obj);
11743 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
11744 * This may be allowed to change at runtime in a later update, however doing so must result in
11745 * update messages sent to notify all nodes of our updated relay fee.
11747 * Default value: 0.
11749 uint32_t ChannelConfig_get_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
11752 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
11753 * This may be allowed to change at runtime in a later update, however doing so must result in
11754 * update messages sent to notify all nodes of our updated relay fee.
11756 * Default value: 0.
11758 void ChannelConfig_set_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
11761 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
11762 * the channel this config applies to.
11764 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
11765 * HTLC balance when a channel appears on-chain whereas
11766 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
11767 * (non-HTLC-encumbered) balance.
11769 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
11770 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
11771 * commitment transaction at least once per this many blocks (minus some margin to allow us
11772 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
11773 * the spending transaction).
11775 * Default value: 72 (12 hours at an average of 6 blocks/hour).
11776 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
11777 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
11779 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
11781 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
11784 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
11785 * the channel this config applies to.
11787 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
11788 * HTLC balance when a channel appears on-chain whereas
11789 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
11790 * (non-HTLC-encumbered) balance.
11792 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
11793 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
11794 * commitment transaction at least once per this many blocks (minus some margin to allow us
11795 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
11796 * the spending transaction).
11798 * Default value: 72 (12 hours at an average of 6 blocks/hour).
11799 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
11800 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
11802 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
11804 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
11807 * Set to announce the channel publicly and notify all nodes that they can route via this
11810 * This should only be set to true for nodes which expect to be online reliably.
11812 * As the node which funds a channel picks this value this will only apply for new outbound
11813 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
11815 * This cannot be changed after the initial channel handshake.
11817 * Default value: false.
11819 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
11822 * Set to announce the channel publicly and notify all nodes that they can route via this
11825 * This should only be set to true for nodes which expect to be online reliably.
11827 * As the node which funds a channel picks this value this will only apply for new outbound
11828 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
11830 * This cannot be changed after the initial channel handshake.
11832 * Default value: false.
11834 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
11837 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
11838 * supports it, they will then enforce the mutual-close output to us matches what we provided
11839 * at intialization, preventing us from closing to an alternate pubkey.
11841 * This is set to true by default to provide a slight increase in security, though ultimately
11842 * any attacker who is able to take control of a channel can just as easily send the funds via
11843 * lightning payments, so we never require that our counterparties support this option.
11845 * This cannot be changed after a channel has been initialized.
11847 * Default value: true.
11849 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
11852 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
11853 * supports it, they will then enforce the mutual-close output to us matches what we provided
11854 * at intialization, preventing us from closing to an alternate pubkey.
11856 * This is set to true by default to provide a slight increase in security, though ultimately
11857 * any attacker who is able to take control of a channel can just as easily send the funds via
11858 * lightning payments, so we never require that our counterparties support this option.
11860 * This cannot be changed after a channel has been initialized.
11862 * Default value: true.
11864 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
11867 * Constructs a new ChannelConfig given each field
11869 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);
11872 * Creates a copy of the ChannelConfig
11874 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
11877 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
11879 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
11882 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
11884 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
11887 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
11889 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
11892 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
11894 void UserConfig_free(struct LDKUserConfig this_obj);
11897 * Channel config that we propose to our counterparty.
11899 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
11902 * Channel config that we propose to our counterparty.
11904 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
11907 * Limits applied to our counterparty's proposed channel config settings.
11909 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
11912 * Limits applied to our counterparty's proposed channel config settings.
11914 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
11917 * Channel config which affects behavior during channel lifetime.
11919 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
11922 * Channel config which affects behavior during channel lifetime.
11924 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
11927 * Constructs a new UserConfig given each field
11929 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);
11932 * Creates a copy of the UserConfig
11934 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
11937 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
11939 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
11942 * Creates a copy of the AccessError
11944 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
11947 * Calls the free function if one is set
11949 void Access_free(struct LDKAccess this_ptr);
11952 * Calls the free function if one is set
11954 void Listen_free(struct LDKListen this_ptr);
11957 * Calls the free function if one is set
11959 void Confirm_free(struct LDKConfirm this_ptr);
11962 * Calls the free function if one is set
11964 void Watch_free(struct LDKWatch this_ptr);
11967 * Calls the free function if one is set
11969 void Filter_free(struct LDKFilter this_ptr);
11972 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
11974 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
11977 * First block where the transaction output may have been spent.
11979 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
11982 * First block where the transaction output may have been spent.
11984 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11987 * Outpoint identifying the transaction output.
11989 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
11992 * Outpoint identifying the transaction output.
11994 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
11997 * Spending condition of the transaction output.
11999 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
12002 * Spending condition of the transaction output.
12004 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
12007 * Constructs a new WatchedOutput given each field
12009 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
12012 * Calls the free function if one is set
12014 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
12017 * Creates a copy of the ConfirmationTarget
12019 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
12022 * Calls the free function if one is set
12024 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
12027 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
12029 void ChainMonitor_free(struct LDKChainMonitor this_obj);
12032 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
12034 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
12035 * will call back to it indicating transactions and outputs of interest. This allows clients to
12036 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
12037 * always need to fetch full blocks absent another means for determining which blocks contain
12038 * transactions relevant to the watched channels.
12040 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
12043 * Constructs a new Listen which calls the relevant methods on this_arg.
12044 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
12046 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
12049 * Constructs a new Confirm which calls the relevant methods on this_arg.
12050 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
12052 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
12055 * Constructs a new Watch which calls the relevant methods on this_arg.
12056 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
12058 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
12061 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
12062 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
12064 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
12067 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
12069 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
12072 * The sequence number of this update. Updates *must* be replayed in-order according to this
12073 * sequence number (and updates may panic if they are not). The update_id values are strictly
12074 * increasing and increase by one for each new update, with one exception specified below.
12076 * This sequence number is also used to track up to which points updates which returned
12077 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
12078 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
12080 * The only instance where update_id values are not strictly increasing is the case where we
12081 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
12082 * its docs for more details.
12084 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
12087 * The sequence number of this update. Updates *must* be replayed in-order according to this
12088 * sequence number (and updates may panic if they are not). The update_id values are strictly
12089 * increasing and increase by one for each new update, with one exception specified below.
12091 * This sequence number is also used to track up to which points updates which returned
12092 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
12093 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
12095 * The only instance where update_id values are not strictly increasing is the case where we
12096 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
12097 * its docs for more details.
12099 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
12102 * Creates a copy of the ChannelMonitorUpdate
12104 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
12107 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
12109 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
12112 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
12114 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
12117 * Creates a copy of the ChannelMonitorUpdateErr
12119 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
12122 * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
12124 void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
12127 * Creates a copy of the MonitorUpdateError
12129 struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
12132 * Frees any resources used by the MonitorEvent
12134 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
12137 * Creates a copy of the MonitorEvent
12139 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
12142 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
12144 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
12147 * Creates a copy of the HTLCUpdate
12149 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
12152 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
12154 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
12157 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
12159 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
12162 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
12164 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
12167 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
12169 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
12172 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
12175 * panics if the given update is not the next update by update_id.
12177 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);
12180 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
12183 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12186 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
12188 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12191 * Gets a list of txids, with their output scripts (in the order they appear in the
12192 * transaction), which we must learn about spends of via block_connected().
12194 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12197 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
12198 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
12199 * have been registered.
12201 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
12204 * Get the list of HTLCs who's status has been updated on chain. This should be called by
12205 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
12207 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12210 * Gets the list of pending events which were generated by previous actions, clearing the list
12213 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
12214 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
12215 * no internal locking in ChannelMonitors.
12217 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12220 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
12221 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
12222 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
12223 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
12224 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
12225 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
12226 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
12227 * out-of-band the other node operator to coordinate with him if option is available to you.
12228 * In any-case, choice is up to the user.
12230 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);
12233 * Processes transactions in a newly connected block, which may result in any of the following:
12234 * - update the monitor's state against resolved HTLCs
12235 * - punish the counterparty in the case of seeing a revoked commitment transaction
12236 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
12237 * - detect settled outputs for later spending
12238 * - schedule and bump any in-flight claims
12240 * Returns any new outputs to watch from `txdata`; after called, these are also included in
12241 * [`get_outputs_to_watch`].
12243 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
12245 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);
12248 * Determines if the disconnected block contained any transactions of interest and updates
12251 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);
12254 * Processes transactions confirmed in a block with the given header and height, returning new
12255 * outputs to watch. See [`block_connected`] for details.
12257 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
12258 * blocks. See [`chain::Confirm`] for calling expectations.
12260 * [`block_connected`]: Self::block_connected
12262 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);
12265 * Processes a transaction that was reorganized out of the chain.
12267 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
12268 * than blocks. See [`chain::Confirm`] for calling expectations.
12270 * [`block_disconnected`]: Self::block_disconnected
12272 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);
12275 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
12276 * [`block_connected`] for details.
12278 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
12279 * blocks. See [`chain::Confirm`] for calling expectations.
12281 * [`block_connected`]: Self::block_connected
12283 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);
12286 * Returns the set of txids that should be monitored for re-organization out of the chain.
12288 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12291 * Calls the free function if one is set
12293 void Persist_free(struct LDKPersist this_ptr);
12296 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
12298 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
12301 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
12303 void OutPoint_free(struct LDKOutPoint this_obj);
12306 * The referenced transaction's txid.
12308 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
12311 * The referenced transaction's txid.
12313 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12316 * The index of the referenced output in its transaction's vout.
12318 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
12321 * The index of the referenced output in its transaction's vout.
12323 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
12326 * Constructs a new OutPoint given each field
12328 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
12331 * Creates a copy of the OutPoint
12333 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
12336 * Checks if two OutPoints contain equal inner contents.
12337 * This ignores pointers and is_owned flags and looks at the values in fields.
12338 * Two objects with NULL inner values will be considered "equal" here.
12340 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
12343 * Checks if two OutPoints contain equal inner contents.
12345 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
12348 * Convert an `OutPoint` to a lightning channel id.
12350 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
12353 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
12355 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
12358 * Read a OutPoint from a byte array, created by OutPoint_write
12360 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
12363 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
12365 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
12368 * The outpoint which is spendable
12370 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12373 * The outpoint which is spendable
12375 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
12378 * Per commitment point to derive delayed_payment_key by key holder
12380 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12383 * Per commitment point to derive delayed_payment_key by key holder
12385 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12388 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
12389 * the witness_script.
12391 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12394 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
12395 * the witness_script.
12397 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
12400 * The output which is referenced by the given outpoint
12402 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
12405 * The revocation point specific to the commitment transaction which was broadcast. Used to
12406 * derive the witnessScript for this output.
12408 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12411 * The revocation point specific to the commitment transaction which was broadcast. Used to
12412 * derive the witnessScript for this output.
12414 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12417 * Arbitrary identification information returned by a call to
12418 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12419 * the channel to spend the output.
12421 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
12424 * Arbitrary identification information returned by a call to
12425 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12426 * the channel to spend the output.
12428 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12431 * The value of the channel which this output originated from, possibly indirectly.
12433 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12436 * The value of the channel which this output originated from, possibly indirectly.
12438 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
12441 * Constructs a new DelayedPaymentOutputDescriptor given each field
12443 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);
12446 * Creates a copy of the DelayedPaymentOutputDescriptor
12448 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
12451 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
12453 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
12456 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
12458 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
12461 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
12463 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
12466 * The outpoint which is spendable
12468 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12471 * The outpoint which is spendable
12473 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
12476 * The output which is referenced by the given outpoint
12478 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
12481 * Arbitrary identification information returned by a call to
12482 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12483 * the channel to spend the output.
12485 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
12488 * Arbitrary identification information returned by a call to
12489 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12490 * the channel to spend the output.
12492 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12495 * The value of the channel which this transactions spends.
12497 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12500 * The value of the channel which this transactions spends.
12502 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
12505 * Constructs a new StaticPaymentOutputDescriptor given each field
12507 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);
12510 * Creates a copy of the StaticPaymentOutputDescriptor
12512 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
12515 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
12517 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
12520 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
12522 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
12525 * Frees any resources used by the SpendableOutputDescriptor
12527 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
12530 * Creates a copy of the SpendableOutputDescriptor
12532 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
12535 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
12537 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
12540 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
12542 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
12545 * Calls the free function if one is set
12547 void BaseSign_free(struct LDKBaseSign this_ptr);
12550 * Creates a copy of a Sign
12552 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
12555 * Calls the free function if one is set
12557 void Sign_free(struct LDKSign this_ptr);
12560 * Calls the free function if one is set
12562 void KeysInterface_free(struct LDKKeysInterface this_ptr);
12565 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
12567 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
12570 * Private key of anchor tx
12572 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12575 * Private key of anchor tx
12577 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12580 * Holder secret key for blinded revocation pubkey
12582 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12585 * Holder secret key for blinded revocation pubkey
12587 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12590 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
12592 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12595 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
12597 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12600 * Holder secret key used in HTLC tx
12602 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12605 * Holder secret key used in HTLC tx
12607 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12610 * Holder htlc secret key used in commitment tx htlc outputs
12612 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12615 * Holder htlc secret key used in commitment tx htlc outputs
12617 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12622 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12627 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12630 * Creates a copy of the InMemorySigner
12632 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
12635 * Create a new InMemorySigner
12637 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);
12640 * Counterparty pubkeys.
12641 * Will panic if ready_channel wasn't called.
12643 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12646 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
12647 * transactions, ie the amount of time that we have to wait to recover our funds if we
12648 * broadcast a transaction.
12649 * Will panic if ready_channel wasn't called.
12651 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12654 * The contest_delay value specified by us and applied on transactions broadcastable
12655 * by our counterparty, ie the amount of time that they have to wait to recover their funds
12656 * if they broadcast a transaction.
12657 * Will panic if ready_channel wasn't called.
12659 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12662 * Whether the holder is the initiator
12663 * Will panic if ready_channel wasn't called.
12665 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12669 * Will panic if ready_channel wasn't called.
12671 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12674 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
12675 * building transactions.
12677 * Will panic if ready_channel wasn't called.
12679 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12682 * Sign the single input of spend_tx at index `input_idx` which spends the output
12683 * described by descriptor, returning the witness stack for the input.
12685 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
12686 * or is not spending the outpoint described by `descriptor.outpoint`.
12688 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);
12691 * Sign the single input of spend_tx at index `input_idx` which spends the output
12692 * described by descriptor, returning the witness stack for the input.
12694 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
12695 * is not spending the outpoint described by `descriptor.outpoint`, or does not have a
12696 * sequence set to `descriptor.to_self_delay`.
12698 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);
12701 * Constructs a new BaseSign which calls the relevant methods on this_arg.
12702 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
12704 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12707 * Constructs a new Sign which calls the relevant methods on this_arg.
12708 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
12710 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12713 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
12715 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
12718 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
12720 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
12723 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
12725 void KeysManager_free(struct LDKKeysManager this_obj);
12728 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
12729 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
12730 * starting_time isn't strictly required to actually be a time, but it must absolutely,
12731 * without a doubt, be unique to this instance. ie if you start multiple times with the same
12732 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
12733 * simply use the current time (with very high precision).
12735 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
12736 * obviously, starting_time should be unique every time you reload the library - it is only
12737 * used to generate new ephemeral key data (which will be stored by the individual channel if
12740 * Note that the seed is required to recover certain on-chain funds independent of
12741 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
12742 * channel, and some on-chain during-closing funds.
12744 * Note that until the 0.1 release there is no guarantee of backward compatibility between
12745 * versions. Once the library is more fully supported, the docs will be updated to include a
12746 * detailed description of the guarantee.
12748 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
12751 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
12753 * Key derivation parameters are accessible through a per-channel secrets
12754 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
12755 * onchain output detection for which a corresponding delayed_payment_key must be derived.
12757 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]);
12760 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
12761 * output to the given change destination (if sufficient change value remains). The
12762 * transaction will have a feerate, at least, of the given value.
12764 * Returns `Err(())` if the output value is greater than the input value minus required fee or
12765 * if a descriptor was duplicated.
12767 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
12769 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
12770 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
12772 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);
12775 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
12776 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
12778 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
12781 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
12783 void ChannelManager_free(struct LDKChannelManager this_obj);
12786 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
12788 void ChainParameters_free(struct LDKChainParameters this_obj);
12791 * The network for determining the `chain_hash` in Lightning messages.
12793 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
12796 * The network for determining the `chain_hash` in Lightning messages.
12798 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
12801 * The hash and height of the latest block successfully connected.
12803 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
12805 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
12808 * The hash and height of the latest block successfully connected.
12810 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
12812 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
12815 * Constructs a new ChainParameters given each field
12817 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
12820 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
12822 void BestBlock_free(struct LDKBestBlock this_obj);
12825 * Creates a copy of the BestBlock
12827 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
12830 * Returns the best block from the genesis of the given network.
12832 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
12835 * Returns the best block as identified by the given block hash and height.
12837 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
12840 * Returns the best block hash.
12842 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
12845 * Returns the best block height.
12847 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
12850 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
12852 void ChannelDetails_free(struct LDKChannelDetails this_obj);
12855 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
12856 * thereafter this is the txid of the funding transaction xor the funding transaction output).
12857 * Note that this means this value is *not* persistent - it can change once during the
12858 * lifetime of the channel.
12860 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
12863 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
12864 * thereafter this is the txid of the funding transaction xor the funding transaction output).
12865 * Note that this means this value is *not* persistent - it can change once during the
12866 * lifetime of the channel.
12868 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12871 * The Channel's funding transaction output, if we've negotiated the funding transaction with
12872 * our counterparty already.
12874 * Note that, if this has been set, `channel_id` will be equivalent to
12875 * `funding_txo.unwrap().to_channel_id()`.
12877 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12880 * The Channel's funding transaction output, if we've negotiated the funding transaction with
12881 * our counterparty already.
12883 * Note that, if this has been set, `channel_id` will be equivalent to
12884 * `funding_txo.unwrap().to_channel_id()`.
12886 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
12889 * The position of the funding transaction in the chain. None if the funding transaction has
12890 * not yet been confirmed and the channel fully opened.
12892 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12895 * The position of the funding transaction in the chain. None if the funding transaction has
12896 * not yet been confirmed and the channel fully opened.
12898 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
12901 * The node_id of our counterparty
12903 struct LDKPublicKey ChannelDetails_get_remote_network_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12906 * The node_id of our counterparty
12908 void ChannelDetails_set_remote_network_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12911 * The Features the channel counterparty provided upon last connection.
12912 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
12913 * many routing-relevant features are present in the init context.
12915 struct LDKInitFeatures ChannelDetails_get_counterparty_features(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12918 * The Features the channel counterparty provided upon last connection.
12919 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
12920 * many routing-relevant features are present in the init context.
12922 void ChannelDetails_set_counterparty_features(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
12925 * The value, in satoshis, of this channel as appears in the funding output
12927 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12930 * The value, in satoshis, of this channel as appears in the funding output
12932 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
12935 * The user_id passed in to create_channel, or 0 if the channel was inbound.
12937 uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12940 * The user_id passed in to create_channel, or 0 if the channel was inbound.
12942 void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
12945 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
12946 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
12947 * available for inclusion in new outbound HTLCs). This further does not include any pending
12948 * outgoing HTLCs which are awaiting some other resolution to be sent.
12950 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12953 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
12954 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
12955 * available for inclusion in new outbound HTLCs). This further does not include any pending
12956 * outgoing HTLCs which are awaiting some other resolution to be sent.
12958 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
12961 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
12962 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
12963 * available for inclusion in new inbound HTLCs).
12964 * Note that there are some corner cases not fully handled here, so the actual available
12965 * inbound capacity may be slightly higher than this.
12967 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12970 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
12971 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
12972 * available for inclusion in new inbound HTLCs).
12973 * Note that there are some corner cases not fully handled here, so the actual available
12974 * inbound capacity may be slightly higher than this.
12976 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
12979 * True if the channel was initiated (and thus funded) by us.
12981 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12984 * True if the channel was initiated (and thus funded) by us.
12986 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
12989 * True if the channel is confirmed, funding_locked messages have been exchanged, and the
12990 * channel is not currently being shut down. `funding_locked` message exchange implies the
12991 * required confirmation count has been reached (and we were connected to the peer at some
12992 * point after the funding transaction received enough confirmations).
12994 bool ChannelDetails_get_is_funding_locked(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12997 * True if the channel is confirmed, funding_locked messages have been exchanged, and the
12998 * channel is not currently being shut down. `funding_locked` message exchange implies the
12999 * required confirmation count has been reached (and we were connected to the peer at some
13000 * point after the funding transaction received enough confirmations).
13002 void ChannelDetails_set_is_funding_locked(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
13005 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
13006 * the peer is connected, (c) no monitor update failure is pending resolution, and (d) the
13007 * channel is not currently negotiating a shutdown.
13009 * This is a strict superset of `is_funding_locked`.
13011 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13014 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
13015 * the peer is connected, (c) no monitor update failure is pending resolution, and (d) the
13016 * channel is not currently negotiating a shutdown.
13018 * This is a strict superset of `is_funding_locked`.
13020 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
13023 * True if this channel is (or will be) publicly-announced.
13025 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13028 * True if this channel is (or will be) publicly-announced.
13030 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
13033 * Creates a copy of the ChannelDetails
13035 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
13038 * Frees any resources used by the PaymentSendFailure
13040 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
13043 * Creates a copy of the PaymentSendFailure
13045 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
13048 * Constructs a new ChannelManager to hold several channels and route between them.
13050 * This is the main \"logic hub\" for all channel-related actions, and implements
13051 * ChannelMessageHandler.
13053 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
13055 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
13057 * Users need to notify the new ChannelManager when a new block is connected or
13058 * disconnected using its `block_connected` and `block_disconnected` methods, starting
13059 * from after `params.latest_hash`.
13061 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);
13064 * Gets the current configuration applied to all new channels, as
13066 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
13069 * Creates a new outbound channel to the given remote node and with the given value.
13071 * user_id will be provided back as user_channel_id in FundingGenerationReady events to allow
13072 * tracking of which events correspond with which create_channel call. Note that the
13073 * user_channel_id defaults to 0 for inbound channels, so you may wish to avoid using 0 for
13074 * user_id here. user_id has no meaning inside of LDK, it is simply copied to events and
13075 * otherwise ignored.
13077 * If successful, will generate a SendOpenChannel message event, so you should probably poll
13078 * PeerManager::process_events afterwards.
13080 * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
13081 * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
13083 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);
13086 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
13087 * more information.
13089 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
13092 * Gets the list of usable channels, in random order. Useful as an argument to
13093 * get_route to ensure non-announced channels are used.
13095 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
13096 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
13099 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
13102 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
13103 * will be accepted on the given channel, and after additional timeout/the closing of all
13104 * pending HTLCs, the channel will be closed on chain.
13106 * May generate a SendShutdown message event on success, which should be relayed.
13108 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
13111 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
13112 * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
13114 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
13117 * Force close all channels, immediately broadcasting the latest local commitment transaction
13118 * for each to the chain and rejecting new HTLCs on each.
13120 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
13123 * Sends a payment along a given route.
13125 * Value parameters are provided via the last hop in route, see documentation for RouteHop
13126 * fields for more info.
13128 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
13129 * payment), we don't do anything to stop you! We always try to ensure that if the provided
13130 * next hop knows the preimage to payment_hash they can claim an additional amount as
13131 * specified in the last hop in the route! Thus, you should probably do your own
13132 * payment_preimage tracking (which you should already be doing as they represent \"proof of
13133 * payment\") and prevent double-sends yourself.
13135 * May generate SendHTLCs message(s) event on success, which should be relayed.
13137 * Each path may have a different return value, and PaymentSendValue may return a Vec with
13138 * each entry matching the corresponding-index entry in the route paths, see
13139 * PaymentSendFailure for more info.
13141 * In general, a path may raise:
13142 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
13143 * node public key) is specified.
13144 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
13145 * (including due to previous monitor update failure or new permanent monitor update
13147 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
13148 * relevant updates.
13150 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
13151 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
13152 * different route unless you intend to pay twice!
13154 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
13155 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
13156 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
13157 * must not contain multiple paths as multi-path payments require a recipient-provided
13159 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
13160 * bit set (either as required or as available). If multiple paths are present in the Route,
13161 * we assume the invoice had the basic_mpp feature set.
13163 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);
13166 * Call this upon creation of a funding transaction for the given channel.
13168 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
13169 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
13171 * Panics if a funding transaction has already been provided for this channel.
13173 * May panic if the output found in the funding transaction is duplicative with some other
13174 * channel (note that this should be trivially prevented by using unique funding transaction
13175 * keys per-channel).
13177 * Do NOT broadcast the funding transaction yourself. When we have safely received our
13178 * counterparty's signature the funding transaction will automatically be broadcast via the
13179 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
13181 * Note that this includes RBF or similar transaction replacement strategies - lightning does
13182 * not currently support replacing a funding transaction on an existing channel. Instead,
13183 * create a new channel with a conflicting funding transaction.
13185 * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
13187 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);
13190 * Regenerates channel_announcements and generates a signed node_announcement from the given
13191 * arguments, providing them in corresponding events via
13192 * [`get_and_clear_pending_msg_events`], if at least one public channel has been confirmed
13193 * on-chain. This effectively re-broadcasts all channel announcements and sends our node
13194 * announcement to ensure that the lightning P2P network is aware of the channels we have and
13195 * our network addresses.
13197 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
13198 * node to humans. They carry no in-protocol meaning.
13200 * `addresses` represent the set (possibly empty) of socket addresses on which this node
13201 * accepts incoming connections. These will be included in the node_announcement, publicly
13202 * tying these addresses together and to this node. If you wish to preserve user privacy,
13203 * addresses should likely contain only Tor Onion addresses.
13205 * Panics if `addresses` is absurdly large (more than 500).
13207 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
13209 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
13212 * Processes HTLCs which are pending waiting on random forward delay.
13214 * Should only really ever be called in response to a PendingHTLCsForwardable event.
13215 * Will likely generate further events.
13217 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
13220 * If a peer is disconnected we mark any channels with that peer as 'disabled'.
13221 * After some time, if channels are still disabled we need to broadcast a ChannelUpdate
13222 * to inform the network about the uselessness of these channels.
13224 * This method handles all the details, and must be called roughly once per minute.
13226 * Note that in some rare cases this may generate a `chain::Watch::update_channel` call.
13228 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
13231 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
13232 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
13233 * along the path (including in our own channel on which we received it).
13234 * Returns false if no payment was found to fail backwards, true if the process of failing the
13235 * HTLC backwards has been started.
13237 MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
13240 * Provides a payment preimage in response to a PaymentReceived event, returning true and
13241 * generating message events for the net layer to claim the payment, if possible. Thus, you
13242 * should probably kick the net layer to go send messages if this returns true!
13244 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
13245 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
13246 * event matches your expectation. If you fail to do so and call this method, you may provide
13247 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
13249 * May panic if called except in response to a PaymentReceived event.
13251 * [`create_inbound_payment`]: Self::create_inbound_payment
13252 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
13254 MUST_USE_RES bool ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
13257 * Gets the node_id held by this ChannelManager
13259 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
13262 * Restores a single, given channel to normal operation after a
13263 * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update
13266 * All ChannelMonitor updates up to and including highest_applied_update_id must have been
13267 * fully committed in every copy of the given channels' ChannelMonitors.
13269 * Note that there is no effect to calling with a highest_applied_update_id other than the
13270 * current latest ChannelMonitorUpdate and one call to this function after multiple
13271 * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field
13272 * exists largely only to prevent races between this and concurrent update_monitor calls.
13274 * Thus, the anticipated use is, at a high level:
13275 * 1) You register a chain::Watch with this ChannelManager,
13276 * 2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of
13277 * said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures
13278 * any time it cannot do so instantly,
13279 * 3) update(s) are applied to each remote copy of a ChannelMonitor,
13280 * 4) once all remote copies are updated, you call this function with the update_id that
13281 * completed, and once it is the latest the Channel will be re-enabled.
13283 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);
13286 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
13289 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
13290 * [`PaymentHash`] and [`PaymentPreimage`] for you, returning the first and storing the second.
13292 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
13293 * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
13294 * passed directly to [`claim_funds`].
13296 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
13298 * [`claim_funds`]: Self::claim_funds
13299 * [`PaymentReceived`]: events::Event::PaymentReceived
13300 * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
13301 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
13303 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);
13306 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
13307 * stored external to LDK.
13309 * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a
13310 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
13311 * the `min_value_msat` provided here, if one is provided.
13313 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) must be globally unique. This
13314 * method may return an Err if another payment with the same payment_hash is still pending.
13316 * `user_payment_id` will be provided back in [`PaymentReceived::user_payment_id`] events to
13317 * allow tracking of which events correspond with which calls to this and
13318 * [`create_inbound_payment`]. `user_payment_id` has no meaning inside of LDK, it is simply
13319 * copied to events and otherwise ignored. It may be used to correlate PaymentReceived events
13320 * with invoice metadata stored elsewhere.
13322 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
13323 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
13324 * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the
13325 * sender \"proof-of-payment\" unless they have paid the required amount.
13327 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
13328 * in excess of the current time. This should roughly match the expiry time set in the invoice.
13329 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
13330 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
13331 * invoices when no timeout is set.
13333 * Note that we use block header time to time-out pending inbound payments (with some margin
13334 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
13335 * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry.
13336 * If you need exact expiry semantics, you should enforce them upon receipt of
13337 * [`PaymentReceived`].
13339 * Pending inbound payments are stored in memory and in serialized versions of this
13340 * [`ChannelManager`]. If potentially unbounded numbers of inbound payments may exist and
13341 * space is limited, you may wish to rate-limit inbound payment creation.
13343 * May panic if `invoice_expiry_delta_secs` is greater than one year.
13345 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
13346 * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
13348 * [`create_inbound_payment`]: Self::create_inbound_payment
13349 * [`PaymentReceived`]: events::Event::PaymentReceived
13350 * [`PaymentReceived::user_payment_id`]: events::Event::PaymentReceived::user_payment_id
13352 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);
13355 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
13356 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
13358 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
13361 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
13362 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
13364 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
13367 * Constructs a new Listen which calls the relevant methods on this_arg.
13368 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
13370 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
13373 * Constructs a new Confirm which calls the relevant methods on this_arg.
13374 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
13376 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
13379 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
13380 * indicating whether persistence is necessary. Only one listener on
13381 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
13383 * Note that the feature `allow_wallclock_use` must be enabled to use this function.
13385 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
13388 * Blocks until ChannelManager needs to be persisted. Only one listener on
13389 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
13392 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
13395 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
13396 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
13398 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
13401 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
13403 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
13406 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
13408 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
13411 * The keys provider which will give us relevant keys. Some keys will be loaded during
13412 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
13415 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13418 * The keys provider which will give us relevant keys. Some keys will be loaded during
13419 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
13422 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
13425 * The fee_estimator for use in the ChannelManager in the future.
13427 * No calls to the FeeEstimator will be made during deserialization.
13429 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13432 * The fee_estimator for use in the ChannelManager in the future.
13434 * No calls to the FeeEstimator will be made during deserialization.
13436 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
13439 * The chain::Watch for use in the ChannelManager in the future.
13441 * No calls to the chain::Watch will be made during deserialization. It is assumed that
13442 * you have deserialized ChannelMonitors separately and will add them to your
13443 * chain::Watch after deserializing this ChannelManager.
13445 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13448 * The chain::Watch for use in the ChannelManager in the future.
13450 * No calls to the chain::Watch will be made during deserialization. It is assumed that
13451 * you have deserialized ChannelMonitors separately and will add them to your
13452 * chain::Watch after deserializing this ChannelManager.
13454 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
13457 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
13458 * used to broadcast the latest local commitment transactions of channels which must be
13459 * force-closed during deserialization.
13461 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13464 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
13465 * used to broadcast the latest local commitment transactions of channels which must be
13466 * force-closed during deserialization.
13468 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
13471 * The Logger for use in the ChannelManager and which may be used to log information during
13474 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13477 * The Logger for use in the ChannelManager and which may be used to log information during
13480 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
13483 * Default settings used for new channels. Any existing channels will continue to use the
13484 * runtime settings which were stored when the ChannelManager was serialized.
13486 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13489 * Default settings used for new channels. Any existing channels will continue to use the
13490 * runtime settings which were stored when the ChannelManager was serialized.
13492 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
13495 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
13496 * HashMap for you. This is primarily useful for C bindings where it is not practical to
13497 * populate a HashMap directly from C.
13499 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);
13502 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
13504 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
13507 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
13509 void DecodeError_free(struct LDKDecodeError this_obj);
13512 * Creates a copy of the DecodeError
13514 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
13517 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
13519 void Init_free(struct LDKInit this_obj);
13522 * The relevant features which the sender supports
13524 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
13527 * The relevant features which the sender supports
13529 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
13532 * Constructs a new Init given each field
13534 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
13537 * Creates a copy of the Init
13539 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
13542 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
13544 void ErrorMessage_free(struct LDKErrorMessage this_obj);
13547 * The channel ID involved in the error
13549 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
13552 * The channel ID involved in the error
13554 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13557 * A possibly human-readable error description.
13558 * The string should be sanitized before it is used (e.g. emitted to logs
13559 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
13560 * vulnerability in the terminal emulator or the logging subsystem.
13562 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
13565 * A possibly human-readable error description.
13566 * The string should be sanitized before it is used (e.g. emitted to logs
13567 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
13568 * vulnerability in the terminal emulator or the logging subsystem.
13570 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
13573 * Constructs a new ErrorMessage given each field
13575 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
13578 * Creates a copy of the ErrorMessage
13580 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
13583 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
13585 void Ping_free(struct LDKPing this_obj);
13588 * The desired response length
13590 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
13593 * The desired response length
13595 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
13598 * The ping packet size.
13599 * This field is not sent on the wire. byteslen zeros are sent.
13601 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
13604 * The ping packet size.
13605 * This field is not sent on the wire. byteslen zeros are sent.
13607 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
13610 * Constructs a new Ping given each field
13612 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
13615 * Creates a copy of the Ping
13617 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
13620 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
13622 void Pong_free(struct LDKPong this_obj);
13625 * The pong packet size.
13626 * This field is not sent on the wire. byteslen zeros are sent.
13628 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
13631 * The pong packet size.
13632 * This field is not sent on the wire. byteslen zeros are sent.
13634 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
13637 * Constructs a new Pong given each field
13639 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
13642 * Creates a copy of the Pong
13644 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
13647 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
13649 void OpenChannel_free(struct LDKOpenChannel this_obj);
13652 * The genesis hash of the blockchain where the channel is to be opened
13654 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
13657 * The genesis hash of the blockchain where the channel is to be opened
13659 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13662 * A temporary channel ID, until the funding outpoint is announced
13664 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
13667 * A temporary channel ID, until the funding outpoint is announced
13669 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13672 * The channel value
13674 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13677 * The channel value
13679 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13682 * The amount to push to the counterparty as part of the open, in milli-satoshi
13684 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13687 * The amount to push to the counterparty as part of the open, in milli-satoshi
13689 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13692 * The threshold below which outputs on transactions broadcast by sender will be omitted
13694 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13697 * The threshold below which outputs on transactions broadcast by sender will be omitted
13699 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13702 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
13704 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13707 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
13709 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13712 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
13714 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13717 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
13719 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13722 * The minimum HTLC size incoming to sender, in milli-satoshi
13724 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13727 * The minimum HTLC size incoming to sender, in milli-satoshi
13729 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13732 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
13734 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13737 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
13739 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
13742 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
13744 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13747 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
13749 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
13752 * The maximum number of inbound HTLCs towards sender
13754 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13757 * The maximum number of inbound HTLCs towards sender
13759 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
13762 * The sender's key controlling the funding transaction
13764 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13767 * The sender's key controlling the funding transaction
13769 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13772 * Used to derive a revocation key for transactions broadcast by counterparty
13774 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13777 * Used to derive a revocation key for transactions broadcast by counterparty
13779 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13782 * A payment key to sender for transactions broadcast by counterparty
13784 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13787 * A payment key to sender for transactions broadcast by counterparty
13789 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13792 * Used to derive a payment key to sender for transactions broadcast by sender
13794 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13797 * Used to derive a payment key to sender for transactions broadcast by sender
13799 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13802 * Used to derive an HTLC payment key to sender
13804 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13807 * Used to derive an HTLC payment key to sender
13809 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13812 * The first to-be-broadcast-by-sender transaction's per commitment point
13814 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13817 * The first to-be-broadcast-by-sender transaction's per commitment point
13819 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13824 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13829 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
13832 * Creates a copy of the OpenChannel
13834 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
13837 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
13839 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
13842 * A temporary channel ID, until the funding outpoint is announced
13844 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
13847 * A temporary channel ID, until the funding outpoint is announced
13849 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13852 * The threshold below which outputs on transactions broadcast by sender will be omitted
13854 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13857 * The threshold below which outputs on transactions broadcast by sender will be omitted
13859 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
13862 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
13864 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13867 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
13869 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
13872 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
13874 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13877 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
13879 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
13882 * The minimum HTLC size incoming to sender, in milli-satoshi
13884 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13887 * The minimum HTLC size incoming to sender, in milli-satoshi
13889 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
13892 * Minimum depth of the funding transaction before the channel is considered open
13894 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13897 * Minimum depth of the funding transaction before the channel is considered open
13899 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
13902 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
13904 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13907 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
13909 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
13912 * The maximum number of inbound HTLCs towards sender
13914 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13917 * The maximum number of inbound HTLCs towards sender
13919 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
13922 * The sender's key controlling the funding transaction
13924 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13927 * The sender's key controlling the funding transaction
13929 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13932 * Used to derive a revocation key for transactions broadcast by counterparty
13934 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13937 * Used to derive a revocation key for transactions broadcast by counterparty
13939 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13942 * A payment key to sender for transactions broadcast by counterparty
13944 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13947 * A payment key to sender for transactions broadcast by counterparty
13949 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13952 * Used to derive a payment key to sender for transactions broadcast by sender
13954 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13957 * Used to derive a payment key to sender for transactions broadcast by sender
13959 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13962 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
13964 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13967 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
13969 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13972 * The first to-be-broadcast-by-sender transaction's per commitment point
13974 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13977 * The first to-be-broadcast-by-sender transaction's per commitment point
13979 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13982 * Creates a copy of the AcceptChannel
13984 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
13987 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
13989 void FundingCreated_free(struct LDKFundingCreated this_obj);
13992 * A temporary channel ID, until the funding is established
13994 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
13997 * A temporary channel ID, until the funding is established
13999 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14002 * The funding transaction ID
14004 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
14007 * The funding transaction ID
14009 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14012 * The specific output index funding this channel
14014 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
14017 * The specific output index funding this channel
14019 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
14022 * The signature of the channel initiator (funder) on the funding transaction
14024 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
14027 * The signature of the channel initiator (funder) on the funding transaction
14029 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
14032 * Constructs a new FundingCreated given each field
14034 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);
14037 * Creates a copy of the FundingCreated
14039 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
14042 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
14044 void FundingSigned_free(struct LDKFundingSigned this_obj);
14049 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
14054 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14057 * The signature of the channel acceptor (fundee) on the funding transaction
14059 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
14062 * The signature of the channel acceptor (fundee) on the funding transaction
14064 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
14067 * Constructs a new FundingSigned given each field
14069 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
14072 * Creates a copy of the FundingSigned
14074 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
14077 * Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
14079 void FundingLocked_free(struct LDKFundingLocked this_obj);
14084 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32];
14089 void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14092 * The per-commitment point of the second commitment transaction
14094 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
14097 * The per-commitment point of the second commitment transaction
14099 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14102 * Constructs a new FundingLocked given each field
14104 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
14107 * Creates a copy of the FundingLocked
14109 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
14112 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
14114 void Shutdown_free(struct LDKShutdown this_obj);
14119 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
14124 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14127 * The destination of this peer's funds on closing.
14128 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
14130 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
14133 * The destination of this peer's funds on closing.
14134 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
14136 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
14139 * Constructs a new Shutdown given each field
14141 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
14144 * Creates a copy of the Shutdown
14146 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
14149 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
14151 void ClosingSigned_free(struct LDKClosingSigned this_obj);
14156 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
14161 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14164 * The proposed total fee for the closing transaction
14166 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
14169 * The proposed total fee for the closing transaction
14171 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
14174 * A signature on the closing transaction
14176 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
14179 * A signature on the closing transaction
14181 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
14184 * Constructs a new ClosingSigned given each field
14186 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg);
14189 * Creates a copy of the ClosingSigned
14191 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
14194 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
14196 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
14201 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
14206 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14211 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
14216 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
14219 * The HTLC value in milli-satoshi
14221 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
14224 * The HTLC value in milli-satoshi
14226 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
14229 * The payment hash, the pre-image of which controls HTLC redemption
14231 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
14234 * The payment hash, the pre-image of which controls HTLC redemption
14236 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14239 * The expiry height of the HTLC
14241 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
14244 * The expiry height of the HTLC
14246 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
14249 * Creates a copy of the UpdateAddHTLC
14251 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
14254 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
14256 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
14261 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
14266 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14271 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
14276 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
14279 * The pre-image of the payment hash, allowing HTLC redemption
14281 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
14284 * The pre-image of the payment hash, allowing HTLC redemption
14286 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14289 * Constructs a new UpdateFulfillHTLC given each field
14291 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
14294 * Creates a copy of the UpdateFulfillHTLC
14296 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
14299 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
14301 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
14306 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
14311 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14316 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
14321 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
14324 * Creates a copy of the UpdateFailHTLC
14326 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
14329 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
14331 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
14336 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
14341 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14346 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
14351 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
14356 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
14361 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
14364 * Creates a copy of the UpdateFailMalformedHTLC
14366 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
14369 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
14371 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
14376 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
14381 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14384 * A signature on the commitment transaction
14386 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
14389 * A signature on the commitment transaction
14391 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
14394 * Signatures on the HTLC transactions
14396 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
14399 * Constructs a new CommitmentSigned given each field
14401 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
14404 * Creates a copy of the CommitmentSigned
14406 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
14409 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
14411 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
14416 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
14421 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14424 * The secret corresponding to the per-commitment point
14426 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
14429 * The secret corresponding to the per-commitment point
14431 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14434 * The next sender-broadcast commitment transaction's per-commitment point
14436 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
14439 * The next sender-broadcast commitment transaction's per-commitment point
14441 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14444 * Constructs a new RevokeAndACK given each field
14446 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);
14449 * Creates a copy of the RevokeAndACK
14451 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
14454 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
14456 void UpdateFee_free(struct LDKUpdateFee this_obj);
14461 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
14466 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14469 * Fee rate per 1000-weight of the transaction
14471 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
14474 * Fee rate per 1000-weight of the transaction
14476 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
14479 * Constructs a new UpdateFee given each field
14481 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
14484 * Creates a copy of the UpdateFee
14486 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
14489 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
14491 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
14494 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
14495 * belonging to the recipient
14497 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
14500 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
14501 * belonging to the recipient
14503 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14506 * The sender's per-commitment point for their current commitment transaction
14508 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
14511 * The sender's per-commitment point for their current commitment transaction
14513 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14516 * Constructs a new DataLossProtect given each field
14518 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
14521 * Creates a copy of the DataLossProtect
14523 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
14526 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
14528 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
14533 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
14538 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14541 * The next commitment number for the sender
14543 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
14546 * The next commitment number for the sender
14548 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
14551 * The next commitment number for the recipient
14553 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
14556 * The next commitment number for the recipient
14558 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
14561 * Creates a copy of the ChannelReestablish
14563 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
14566 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
14568 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
14573 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
14578 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14581 * The short channel ID
14583 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
14586 * The short channel ID
14588 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
14591 * A signature by the node key
14593 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
14596 * A signature by the node key
14598 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
14601 * A signature by the funding key
14603 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
14606 * A signature by the funding key
14608 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
14611 * Constructs a new AnnouncementSignatures given each field
14613 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);
14616 * Creates a copy of the AnnouncementSignatures
14618 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
14621 * Frees any resources used by the NetAddress
14623 void NetAddress_free(struct LDKNetAddress this_ptr);
14626 * Creates a copy of the NetAddress
14628 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
14631 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
14633 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
14636 * Read a Result from a byte array, created by Result_write
14638 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
14641 * Read a NetAddress from a byte array, created by NetAddress_write
14643 struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
14646 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
14648 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
14651 * The advertised features
14653 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
14656 * The advertised features
14658 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
14661 * A strictly monotonic announcement counter, with gaps allowed
14663 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
14666 * A strictly monotonic announcement counter, with gaps allowed
14668 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
14671 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
14674 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
14677 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
14680 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14683 * An RGB color for UI purposes
14685 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
14688 * An RGB color for UI purposes
14690 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
14693 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
14696 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
14699 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
14702 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14705 * List of addresses on which this node is reachable
14707 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
14710 * Creates a copy of the UnsignedNodeAnnouncement
14712 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
14715 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
14717 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
14720 * The signature by the node key
14722 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
14725 * The signature by the node key
14727 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14730 * The actual content of the announcement
14732 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
14735 * The actual content of the announcement
14737 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
14740 * Constructs a new NodeAnnouncement given each field
14742 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
14745 * Creates a copy of the NodeAnnouncement
14747 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
14750 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
14752 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
14755 * The advertised channel features
14757 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14760 * The advertised channel features
14762 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
14765 * The genesis hash of the blockchain where the channel is to be opened
14767 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
14770 * The genesis hash of the blockchain where the channel is to be opened
14772 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14775 * The short channel ID
14777 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14780 * The short channel ID
14782 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
14785 * One of the two node_ids which are endpoints of this channel
14787 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14790 * One of the two node_ids which are endpoints of this channel
14792 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14795 * The other of the two node_ids which are endpoints of this channel
14797 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14800 * The other of the two node_ids which are endpoints of this channel
14802 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14805 * The funding key for the first node
14807 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14810 * The funding key for the first node
14812 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14815 * The funding key for the second node
14817 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14820 * The funding key for the second node
14822 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14825 * Creates a copy of the UnsignedChannelAnnouncement
14827 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
14830 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
14832 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
14835 * Authentication of the announcement by the first public node
14837 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14840 * Authentication of the announcement by the first public node
14842 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14845 * Authentication of the announcement by the second public node
14847 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14850 * Authentication of the announcement by the second public node
14852 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14855 * Proof of funding UTXO ownership by the first public node
14857 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14860 * Proof of funding UTXO ownership by the first public node
14862 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14865 * Proof of funding UTXO ownership by the second public node
14867 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14870 * Proof of funding UTXO ownership by the second public node
14872 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14875 * The actual announcement
14877 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14880 * The actual announcement
14882 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
14885 * Constructs a new ChannelAnnouncement given each field
14887 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);
14890 * Creates a copy of the ChannelAnnouncement
14892 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
14895 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
14897 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
14900 * The genesis hash of the blockchain where the channel is to be opened
14902 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
14905 * The genesis hash of the blockchain where the channel is to be opened
14907 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14910 * The short channel ID
14912 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14915 * The short channel ID
14917 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
14920 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
14922 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14925 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
14927 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
14932 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14937 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
14940 * The number of blocks such that if:
14941 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
14942 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
14943 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
14944 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
14945 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
14946 * forwarding. Note that the HTLC sender is the one who originally sets this value when
14947 * constructing the route.
14949 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14952 * The number of blocks such that if:
14953 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
14954 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
14955 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
14956 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
14957 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
14958 * forwarding. Note that the HTLC sender is the one who originally sets this value when
14959 * constructing the route.
14961 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
14964 * The minimum HTLC size incoming to sender, in milli-satoshi
14966 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14969 * The minimum HTLC size incoming to sender, in milli-satoshi
14971 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
14974 * The base HTLC fee charged by sender, in milli-satoshi
14976 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14979 * The base HTLC fee charged by sender, in milli-satoshi
14981 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
14984 * The amount to fee multiplier, in micro-satoshi
14986 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14989 * The amount to fee multiplier, in micro-satoshi
14991 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
14994 * Creates a copy of the UnsignedChannelUpdate
14996 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
14999 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
15001 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
15004 * A signature of the channel update
15006 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
15009 * A signature of the channel update
15011 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
15014 * The actual channel update
15016 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
15019 * The actual channel update
15021 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
15024 * Constructs a new ChannelUpdate given each field
15026 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
15029 * Creates a copy of the ChannelUpdate
15031 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
15034 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
15036 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
15039 * The genesis hash of the blockchain being queried
15041 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
15044 * The genesis hash of the blockchain being queried
15046 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15049 * The height of the first block for the channel UTXOs being queried
15051 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
15054 * The height of the first block for the channel UTXOs being queried
15056 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
15059 * The number of blocks to include in the query results
15061 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
15064 * The number of blocks to include in the query results
15066 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
15069 * Constructs a new QueryChannelRange given each field
15071 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
15074 * Creates a copy of the QueryChannelRange
15076 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
15079 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
15081 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
15084 * The genesis hash of the blockchain being queried
15086 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
15089 * The genesis hash of the blockchain being queried
15091 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15094 * The height of the first block in the range of the reply
15096 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
15099 * The height of the first block in the range of the reply
15101 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
15104 * The number of blocks included in the range of the reply
15106 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
15109 * The number of blocks included in the range of the reply
15111 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
15114 * True when this is the final reply for a query
15116 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
15119 * True when this is the final reply for a query
15121 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
15124 * The short_channel_ids in the channel range
15126 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
15129 * Constructs a new ReplyChannelRange given each field
15131 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);
15134 * Creates a copy of the ReplyChannelRange
15136 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
15139 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
15141 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
15144 * The genesis hash of the blockchain being queried
15146 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
15149 * The genesis hash of the blockchain being queried
15151 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15154 * The short_channel_ids that are being queried
15156 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
15159 * Constructs a new QueryShortChannelIds given each field
15161 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
15164 * Creates a copy of the QueryShortChannelIds
15166 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
15169 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
15171 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
15174 * The genesis hash of the blockchain that was queried
15176 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
15179 * The genesis hash of the blockchain that was queried
15181 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15184 * Indicates if the query recipient maintains up-to-date channel
15185 * information for the chain_hash
15187 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
15190 * Indicates if the query recipient maintains up-to-date channel
15191 * information for the chain_hash
15193 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
15196 * Constructs a new ReplyShortChannelIdsEnd given each field
15198 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
15201 * Creates a copy of the ReplyShortChannelIdsEnd
15203 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
15206 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
15208 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
15211 * The genesis hash of the blockchain for channel and node information
15213 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
15216 * The genesis hash of the blockchain for channel and node information
15218 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15221 * The starting unix timestamp
15223 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
15226 * The starting unix timestamp
15228 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
15231 * The range of information in seconds
15233 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
15236 * The range of information in seconds
15238 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
15241 * Constructs a new GossipTimestampFilter given each field
15243 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
15246 * Creates a copy of the GossipTimestampFilter
15248 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
15251 * Frees any resources used by the ErrorAction
15253 void ErrorAction_free(struct LDKErrorAction this_ptr);
15256 * Creates a copy of the ErrorAction
15258 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
15261 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
15263 void LightningError_free(struct LDKLightningError this_obj);
15266 * A human-readable message describing the error
15268 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
15271 * A human-readable message describing the error
15273 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
15276 * The action which should be taken against the offending peer.
15278 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
15281 * The action which should be taken against the offending peer.
15283 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
15286 * Constructs a new LightningError given each field
15288 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
15291 * Creates a copy of the LightningError
15293 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
15296 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
15298 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
15301 * update_add_htlc messages which should be sent
15303 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
15306 * update_fulfill_htlc messages which should be sent
15308 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
15311 * update_fail_htlc messages which should be sent
15313 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
15316 * update_fail_malformed_htlc messages which should be sent
15318 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
15321 * An update_fee message which should be sent
15323 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
15326 * An update_fee message which should be sent
15328 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
15331 * Finally, the commitment_signed message which should be sent
15333 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
15336 * Finally, the commitment_signed message which should be sent
15338 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
15341 * Constructs a new CommitmentUpdate given each field
15343 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);
15346 * Creates a copy of the CommitmentUpdate
15348 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
15351 * Frees any resources used by the HTLCFailChannelUpdate
15353 void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
15356 * Creates a copy of the HTLCFailChannelUpdate
15358 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
15361 * Calls the free function if one is set
15363 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
15366 * Calls the free function if one is set
15368 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
15371 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
15373 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
15376 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
15378 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
15381 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
15383 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
15386 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
15388 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
15391 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
15393 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
15396 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
15398 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
15401 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
15403 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
15406 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
15408 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
15411 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
15413 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
15416 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
15418 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
15421 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
15423 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
15426 * Read a FundingCreated from a byte array, created by FundingCreated_write
15428 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
15431 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
15433 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
15436 * Read a FundingSigned from a byte array, created by FundingSigned_write
15438 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
15441 * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
15443 struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
15446 * Read a FundingLocked from a byte array, created by FundingLocked_write
15448 struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
15451 * Serialize the Init object into a byte array which can be read by Init_read
15453 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
15456 * Read a Init from a byte array, created by Init_write
15458 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
15461 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
15463 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
15466 * Read a OpenChannel from a byte array, created by OpenChannel_write
15468 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
15471 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
15473 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
15476 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
15478 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
15481 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
15483 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
15486 * Read a Shutdown from a byte array, created by Shutdown_write
15488 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
15491 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
15493 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
15496 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
15498 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
15501 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
15503 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
15506 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
15508 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
15511 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
15513 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
15516 * Read a UpdateFee from a byte array, created by UpdateFee_write
15518 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
15521 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
15523 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
15526 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
15528 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
15531 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
15533 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
15536 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
15538 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
15541 * Serialize the Ping object into a byte array which can be read by Ping_read
15543 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
15546 * Read a Ping from a byte array, created by Ping_write
15548 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
15551 * Serialize the Pong object into a byte array which can be read by Pong_read
15553 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
15556 * Read a Pong from a byte array, created by Pong_write
15558 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
15561 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
15563 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
15566 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
15568 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
15571 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
15573 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
15576 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
15578 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
15581 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
15583 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
15586 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
15588 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
15591 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
15593 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
15596 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
15598 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
15601 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
15603 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
15606 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
15608 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
15611 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
15613 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
15616 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
15618 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
15621 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
15623 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
15626 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
15628 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
15631 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
15633 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
15636 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
15638 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
15641 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
15643 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
15646 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
15648 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
15651 *\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
15653 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
15656 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
15658 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
15661 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
15663 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
15666 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
15668 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
15671 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
15673 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
15676 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
15678 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
15681 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
15683 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
15686 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
15688 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
15691 * Constructs a new IgnoringMessageHandler given each field
15693 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
15696 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
15697 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
15699 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
15702 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
15703 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
15705 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
15708 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
15710 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
15713 * Constructs a new ErroringMessageHandler
15715 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
15718 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
15719 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
15721 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
15724 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
15725 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
15727 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
15730 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
15732 void MessageHandler_free(struct LDKMessageHandler this_obj);
15735 * A message handler which handles messages specific to channels. Usually this is just a
15736 * ChannelManager object or a ErroringMessageHandler.
15738 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
15741 * A message handler which handles messages specific to channels. Usually this is just a
15742 * ChannelManager object or a ErroringMessageHandler.
15744 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
15747 * A message handler which handles messages updating our knowledge of the network channel
15748 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
15750 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
15753 * A message handler which handles messages updating our knowledge of the network channel
15754 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
15756 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
15759 * Constructs a new MessageHandler given each field
15761 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
15764 * Creates a copy of a SocketDescriptor
15766 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
15769 * Calls the free function if one is set
15771 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
15774 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
15776 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
15779 * Used to indicate that we probably can't make any future connections to this peer, implying
15780 * we should go ahead and force-close any channels we have with it.
15782 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
15785 * Used to indicate that we probably can't make any future connections to this peer, implying
15786 * we should go ahead and force-close any channels we have with it.
15788 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
15791 * Constructs a new PeerHandleError given each field
15793 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
15796 * Creates a copy of the PeerHandleError
15798 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
15801 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
15803 void PeerManager_free(struct LDKPeerManager this_obj);
15806 * Constructs a new PeerManager with the given message handlers and node_id secret key
15807 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
15808 * cryptographically secure random bytes.
15810 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);
15813 * Get the list of node ids for peers which have completed the initial handshake.
15815 * For outbound connections, this will be the same as the their_node_id parameter passed in to
15816 * new_outbound_connection, however entries will only appear once the initial handshake has
15817 * completed and we are sure the remote peer has the private key for the given node_id.
15819 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
15822 * Indicates a new outbound connection has been established to a node with the given node_id.
15823 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
15824 * descriptor but must disconnect the connection immediately.
15826 * Returns a small number of bytes to send to the remote node (currently always 50).
15828 * Panics if descriptor is duplicative with some other descriptor which has not yet had a
15829 * socket_disconnected().
15831 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);
15834 * Indicates a new inbound connection has been established.
15836 * May refuse the connection by returning an Err, but will never write bytes to the remote end
15837 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
15838 * call socket_disconnected for the new descriptor but must disconnect the connection
15841 * Panics if descriptor is duplicative with some other descriptor which has not yet had
15842 * socket_disconnected called.
15844 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor);
15847 * Indicates that there is room to write data to the given socket descriptor.
15849 * May return an Err to indicate that the connection should be closed.
15851 * Will most likely call send_data on the descriptor passed in (or the descriptor handed into
15852 * new_*\\_connection) before returning. Thus, be very careful with reentrancy issues! The
15853 * invariants around calling write_buffer_space_avail in case a write did not fully complete
15854 * must still hold - be ready to call write_buffer_space_avail again if a write call generated
15855 * here isn't sufficient! Panics if the descriptor was not previously registered in a
15856 * new_\\*_connection event.
15858 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
15861 * Indicates that data was read from the given socket descriptor.
15863 * May return an Err to indicate that the connection should be closed.
15865 * Will *not* call back into send_data on any descriptors to avoid reentrancy complexity.
15866 * Thus, however, you almost certainly want to call process_events() after any read_event to
15867 * generate send_data calls to handle responses.
15869 * If Ok(true) is returned, further read_events should not be triggered until a send_data call
15870 * on this file descriptor has resume_read set (preventing DoS issues in the send buffer).
15872 * Panics if the descriptor was not previously registered in a new_*_connection event.
15874 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);
15877 * Checks for any events generated by our handlers and processes them. Includes sending most
15878 * response messages as well as messages generated by calls to handler functions directly (eg
15879 * functions like ChannelManager::process_pending_htlc_forward or send_payment).
15881 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
15884 * Indicates that the given socket descriptor's connection is now closed.
15886 * This must only be called if the socket has been disconnected by the peer or your own
15887 * decision to disconnect it and must NOT be called in any case where other parts of this
15888 * library (eg PeerHandleError, explicit disconnect_socket calls) instruct you to disconnect
15891 * Panics if the descriptor was not previously registered in a successful new_*_connection event.
15893 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
15896 * Disconnect a peer given its node id.
15898 * Set no_connection_possible to true to prevent any further connection with this peer,
15899 * force-closing any channels we have with it.
15901 * If a peer is connected, this will call `disconnect_socket` on the descriptor for the peer,
15902 * so be careful about reentrancy issues.
15904 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
15907 * This function should be called roughly once every 30 seconds.
15908 * It will send pings to each peer and disconnect those which did not respond to the last round of pings.
15909 * Will most likely call send_data on all of the registered descriptors, thus, be very careful with reentrancy issues!
15911 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
15914 * Build the commitment secret from the seed and the commitment number
15916 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
15919 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
15920 * from the base secret and the per_commitment_point.
15922 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
15923 * generated (ie our own).
15925 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
15928 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
15929 * from the base point and the per_commitment_key. This is the public equivalent of
15930 * derive_private_key - using only public keys to derive a public key instead of private keys.
15932 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
15933 * generated (ie our own).
15935 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
15938 * Derives a per-commitment-transaction revocation key from its constituent parts.
15940 * Only the cheating participant owns a valid witness to propagate a revoked
15941 * commitment transaction, thus per_commitment_secret always come from cheater
15942 * and revocation_base_secret always come from punisher, which is the broadcaster
15943 * of the transaction spending with this key knowledge.
15945 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
15946 * generated (ie our own).
15948 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
15951 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
15952 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
15953 * public key instead of private keys.
15955 * Only the cheating participant owns a valid witness to propagate a revoked
15956 * commitment transaction, thus per_commitment_point always come from cheater
15957 * and revocation_base_point always come from punisher, which is the broadcaster
15958 * of the transaction spending with this key knowledge.
15960 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
15961 * generated (ie our own).
15963 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
15966 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
15968 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
15971 * The broadcaster's per-commitment public key which was used to derive the other keys.
15973 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
15976 * The broadcaster's per-commitment public key which was used to derive the other keys.
15978 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15981 * The revocation key which is used to allow the broadcaster of the commitment
15982 * transaction to provide their counterparty the ability to punish them if they broadcast
15985 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
15988 * The revocation key which is used to allow the broadcaster of the commitment
15989 * transaction to provide their counterparty the ability to punish them if they broadcast
15992 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15995 * Broadcaster's HTLC Key
15997 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
16000 * Broadcaster's HTLC Key
16002 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16005 * Countersignatory's HTLC Key
16007 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
16010 * Countersignatory's HTLC Key
16012 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16015 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
16017 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
16020 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
16022 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16025 * Constructs a new TxCreationKeys given each field
16027 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);
16030 * Creates a copy of the TxCreationKeys
16032 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
16035 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
16037 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
16040 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
16042 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
16045 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
16047 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
16050 * The public key which is used to sign all commitment transactions, as it appears in the
16051 * on-chain channel lock-in 2-of-2 multisig output.
16053 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
16056 * The public key which is used to sign all commitment transactions, as it appears in the
16057 * on-chain channel lock-in 2-of-2 multisig output.
16059 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16062 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
16063 * revocation keys. This is combined with the per-commitment-secret generated by the
16064 * counterparty to create a secret which the counterparty can reveal to revoke previous
16067 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
16070 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
16071 * revocation keys. This is combined with the per-commitment-secret generated by the
16072 * counterparty to create a secret which the counterparty can reveal to revoke previous
16075 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16078 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
16079 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
16080 * static across every commitment transaction.
16082 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
16085 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
16086 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
16087 * static across every commitment transaction.
16089 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16092 * The base point which is used (with derive_public_key) to derive a per-commitment payment
16093 * public key which receives non-HTLC-encumbered funds which are only available for spending
16094 * after some delay (or can be claimed via the revocation path).
16096 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
16099 * The base point which is used (with derive_public_key) to derive a per-commitment payment
16100 * public key which receives non-HTLC-encumbered funds which are only available for spending
16101 * after some delay (or can be claimed via the revocation path).
16103 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16106 * The base point which is used (with derive_public_key) to derive a per-commitment public key
16107 * which is used to encumber HTLC-in-flight outputs.
16109 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
16112 * The base point which is used (with derive_public_key) to derive a per-commitment public key
16113 * which is used to encumber HTLC-in-flight outputs.
16115 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16118 * Constructs a new ChannelPublicKeys given each field
16120 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);
16123 * Creates a copy of the ChannelPublicKeys
16125 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
16128 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
16130 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
16133 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
16135 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
16138 * Create per-state keys from channel base points and the per-commitment point.
16139 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
16141 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);
16144 * Generate per-state keys from channel static keys.
16145 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
16147 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);
16150 * A script either spendable by the revocation
16151 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
16152 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
16154 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
16157 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
16159 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
16162 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
16163 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
16164 * need to compare this value to whether the commitment transaction in question is that of
16165 * the counterparty or our own.
16167 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
16170 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
16171 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
16172 * need to compare this value to whether the commitment transaction in question is that of
16173 * the counterparty or our own.
16175 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
16178 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
16179 * this divided by 1000.
16181 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
16184 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
16185 * this divided by 1000.
16187 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
16190 * The CLTV lock-time at which this HTLC expires.
16192 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
16195 * The CLTV lock-time at which this HTLC expires.
16197 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
16200 * The hash of the preimage which unlocks this HTLC.
16202 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
16205 * The hash of the preimage which unlocks this HTLC.
16207 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16210 * The position within the commitment transactions' outputs. This may be None if the value is
16211 * below the dust limit (in which case no output appears in the commitment transaction and the
16212 * value is spent to additional transaction fees).
16214 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
16217 * The position within the commitment transactions' outputs. This may be None if the value is
16218 * below the dust limit (in which case no output appears in the commitment transaction and the
16219 * value is spent to additional transaction fees).
16221 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
16224 * Constructs a new HTLCOutputInCommitment given each field
16226 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);
16229 * Creates a copy of the HTLCOutputInCommitment
16231 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
16234 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
16236 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
16239 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
16241 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
16244 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
16245 * does not need to have its previous_output_index filled.
16247 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys);
16250 * Gets the redeemscript for a funding output from the two funding public keys.
16251 * Note that the order of funding public keys does not matter.
16253 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
16256 * panics if htlc.transaction_output_index.is_none()!
16258 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);
16261 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
16263 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
16266 * Holder public keys
16268 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
16271 * Holder public keys
16273 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
16276 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
16278 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
16281 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
16283 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
16286 * Whether the holder is the initiator of this channel.
16287 * This is an input to the commitment number obscure factor computation.
16289 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
16292 * Whether the holder is the initiator of this channel.
16293 * This is an input to the commitment number obscure factor computation.
16295 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
16298 * The late-bound counterparty channel transaction parameters.
16299 * These parameters are populated at the point in the protocol where the counterparty provides them.
16301 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
16304 * The late-bound counterparty channel transaction parameters.
16305 * These parameters are populated at the point in the protocol where the counterparty provides them.
16307 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
16310 * The late-bound funding outpoint
16312 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
16315 * The late-bound funding outpoint
16317 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
16320 * Constructs a new ChannelTransactionParameters given each field
16322 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);
16325 * Creates a copy of the ChannelTransactionParameters
16327 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
16330 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
16332 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
16335 * Counter-party public keys
16337 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
16340 * Counter-party public keys
16342 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
16345 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
16347 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
16350 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
16352 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
16355 * Constructs a new CounterpartyChannelTransactionParameters given each field
16357 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
16360 * Creates a copy of the CounterpartyChannelTransactionParameters
16362 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
16365 * Whether the late bound parameters are populated.
16367 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
16370 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
16371 * given that the holder is the broadcaster.
16373 * self.is_populated() must be true before calling this function.
16375 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
16378 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
16379 * given that the counterparty is the broadcaster.
16381 * self.is_populated() must be true before calling this function.
16383 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
16386 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
16388 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
16391 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
16393 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
16396 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
16398 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
16401 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
16403 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
16406 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
16408 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
16411 * Get the channel pubkeys for the broadcaster
16413 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16416 * Get the channel pubkeys for the countersignatory
16418 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16421 * Get the contest delay applicable to the transactions.
16422 * Note that the contest delay was selected by the countersignatory.
16424 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16427 * Whether the channel is outbound from the broadcaster.
16429 * The boolean representing the side that initiated the channel is
16430 * an input to the commitment number obscure factor computation.
16432 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16435 * The funding outpoint
16437 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16440 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
16442 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
16445 * Our counterparty's signature for the transaction
16447 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
16450 * Our counterparty's signature for the transaction
16452 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
16455 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
16457 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
16460 * Creates a copy of the HolderCommitmentTransaction
16462 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
16465 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
16467 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
16470 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
16472 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
16475 * Create a new holder transaction with the given counterparty signatures.
16476 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
16478 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);
16481 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
16483 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
16486 * The commitment transaction
16488 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
16491 * The commitment transaction
16493 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
16496 * The txid for the commitment transaction.
16498 * This is provided as a performance optimization, instead of calling transaction.txid()
16501 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
16504 * The txid for the commitment transaction.
16506 * This is provided as a performance optimization, instead of calling transaction.txid()
16509 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16512 * Constructs a new BuiltCommitmentTransaction given each field
16514 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
16517 * Creates a copy of the BuiltCommitmentTransaction
16519 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
16522 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
16524 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
16527 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
16529 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
16532 * Get the SIGHASH_ALL sighash value of the transaction.
16534 * This can be used to verify a signature.
16536 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);
16539 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
16540 * because we are about to broadcast a holder transaction.
16542 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);
16545 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
16547 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
16550 * Creates a copy of the CommitmentTransaction
16552 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
16555 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
16557 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
16560 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
16562 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
16565 * The backwards-counting commitment number
16567 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16570 * The value to be sent to the broadcaster
16572 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16575 * The value to be sent to the counterparty
16577 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16580 * The feerate paid per 1000-weight-unit in this commitment transaction.
16582 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16585 * Trust our pre-built transaction and derived transaction creation public keys.
16587 * Applies a wrapper which allows access to these fields.
16589 * This should only be used if you fully trust the builder of this object. It should not
16590 *\tbe used by an external signer - instead use the verify function.
16592 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16595 * Verify our pre-built transaction and derived transaction creation public keys.
16597 * Applies a wrapper which allows access to these fields.
16599 * An external validating signer must call this method before signing
16600 * or using the built transaction.
16602 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);
16605 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
16607 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
16610 * The transaction ID of the built Bitcoin transaction
16612 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
16615 * The pre-built Bitcoin commitment transaction
16617 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
16620 * The pre-calculated transaction creation public keys.
16622 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
16625 * Get a signature for each HTLC which was included in the commitment transaction (ie for
16626 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
16628 * The returned Vec has one entry for each HTLC, and in the same order.
16630 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);
16633 * Get the transaction number obscure factor
16635 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
16638 * Checks if two InitFeaturess contain equal inner contents.
16639 * This ignores pointers and is_owned flags and looks at the values in fields.
16640 * Two objects with NULL inner values will be considered "equal" here.
16642 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
16645 * Checks if two NodeFeaturess contain equal inner contents.
16646 * This ignores pointers and is_owned flags and looks at the values in fields.
16647 * Two objects with NULL inner values will be considered "equal" here.
16649 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
16652 * Checks if two ChannelFeaturess contain equal inner contents.
16653 * This ignores pointers and is_owned flags and looks at the values in fields.
16654 * Two objects with NULL inner values will be considered "equal" here.
16656 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
16659 * Checks if two InvoiceFeaturess contain equal inner contents.
16660 * This ignores pointers and is_owned flags and looks at the values in fields.
16661 * Two objects with NULL inner values will be considered "equal" here.
16663 bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
16666 * Creates a copy of the InitFeatures
16668 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
16671 * Creates a copy of the NodeFeatures
16673 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
16676 * Creates a copy of the ChannelFeatures
16678 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
16681 * Creates a copy of the InvoiceFeatures
16683 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
16686 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
16688 void InitFeatures_free(struct LDKInitFeatures this_obj);
16691 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
16693 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
16696 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
16698 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
16701 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
16703 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
16706 * Create a blank Features with no features set
16708 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
16711 * Creates a Features with the bits set which are known by the implementation
16713 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
16716 * Create a blank Features with no features set
16718 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
16721 * Creates a Features with the bits set which are known by the implementation
16723 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
16726 * Create a blank Features with no features set
16728 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
16731 * Creates a Features with the bits set which are known by the implementation
16733 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
16736 * Create a blank Features with no features set
16738 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
16741 * Creates a Features with the bits set which are known by the implementation
16743 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
16746 * Returns whether the `payment_secret` feature is supported.
16748 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
16751 * Returns whether the `payment_secret` feature is supported.
16753 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
16756 * Returns whether the `payment_secret` feature is supported.
16758 MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
16761 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
16763 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
16766 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
16768 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
16771 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
16773 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
16776 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
16778 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
16781 * Read a InitFeatures from a byte array, created by InitFeatures_write
16783 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
16786 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
16788 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
16791 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
16793 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
16796 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
16798 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
16801 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
16803 void RouteHop_free(struct LDKRouteHop this_obj);
16806 * The node_id of the node at this hop.
16808 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16811 * The node_id of the node at this hop.
16813 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16816 * The node_announcement features of the node at this hop. For the last hop, these may be
16817 * amended to match the features present in the invoice this node generated.
16819 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16822 * The node_announcement features of the node at this hop. For the last hop, these may be
16823 * amended to match the features present in the invoice this node generated.
16825 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
16828 * The channel that should be used from the previous hop to reach this node.
16830 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16833 * The channel that should be used from the previous hop to reach this node.
16835 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
16838 * The channel_announcement features of the channel that should be used from the previous hop
16839 * to reach this node.
16841 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16844 * The channel_announcement features of the channel that should be used from the previous hop
16845 * to reach this node.
16847 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
16850 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
16851 * For the last hop, this should be the full value of the payment (might be more than
16852 * requested if we had to match htlc_minimum_msat).
16854 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16857 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
16858 * For the last hop, this should be the full value of the payment (might be more than
16859 * requested if we had to match htlc_minimum_msat).
16861 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
16864 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
16865 * expected at the destination, in excess of the current block height.
16867 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16870 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
16871 * expected at the destination, in excess of the current block height.
16873 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
16876 * Constructs a new RouteHop given each field
16878 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);
16881 * Creates a copy of the RouteHop
16883 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
16886 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
16888 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
16891 * Read a RouteHop from a byte array, created by RouteHop_write
16893 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
16896 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
16898 void Route_free(struct LDKRoute this_obj);
16901 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
16902 * last RouteHop in each path must be the same.
16903 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
16904 * destination. Thus, this must always be at least length one. While the maximum length of any
16905 * given path is variable, keeping the length of any path to less than 20 should currently
16906 * ensure it is viable.
16908 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
16911 * Constructs a new Route given each field
16913 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
16916 * Creates a copy of the Route
16918 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
16921 * Serialize the Route object into a byte array which can be read by Route_read
16923 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
16926 * Read a Route from a byte array, created by Route_write
16928 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
16931 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
16933 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
16936 * The node_id of the non-target end of the route
16938 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16941 * The node_id of the non-target end of the route
16943 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16946 * The short_channel_id of this channel
16948 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16951 * The short_channel_id of this channel
16953 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
16956 * The fees which must be paid to use this channel
16958 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16961 * The fees which must be paid to use this channel
16963 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
16966 * The difference in CLTV values between this node and the next node.
16968 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16971 * The difference in CLTV values between this node and the next node.
16973 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
16976 * The minimum value, in msat, which must be relayed to the next hop.
16978 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16981 * The minimum value, in msat, which must be relayed to the next hop.
16983 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
16986 * The maximum value in msat available for routing with a single HTLC.
16988 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16991 * The maximum value in msat available for routing with a single HTLC.
16993 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
16996 * Constructs a new RouteHintHop given each field
16998 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);
17001 * Checks if two RouteHintHops contain equal inner contents.
17002 * This ignores pointers and is_owned flags and looks at the values in fields.
17003 * Two objects with NULL inner values will be considered "equal" here.
17005 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
17008 * Creates a copy of the RouteHintHop
17010 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
17013 * Gets a route from us (payer) to the given target node (payee).
17015 * If the payee provided features in their invoice, they should be provided via payee_features.
17016 * Without this, MPP will only be used if the payee's features are available in the network graph.
17018 * Extra routing hops between known nodes and the target will be used if they are included in
17021 * If some channels aren't announced, it may be useful to fill in a first_hops with the
17022 * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
17023 * view of our local channels (from net_graph_msg_handler) will be ignored, and only those
17024 * in first_hops will be used.
17026 * Panics if first_hops contains channels without short_channel_ids
17027 * (ChannelManager::list_usable_channels will never include such channels).
17029 * The fees on channels from us to next-hops are ignored (as they are assumed to all be
17030 * equal), however the enabled/disabled bit on such channels as well as the
17031 * htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
17033 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);
17036 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
17038 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
17041 * Creates a copy of the NetworkGraph
17043 struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
17046 * Frees any resources used by the LockedNetworkGraph, if is_owned is set and inner is non-NULL.
17048 void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj);
17051 * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
17053 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
17056 * Creates a new tracker of the actual state of the network of channels and nodes,
17057 * assuming a fresh network graph.
17058 * Chain monitor is used to make sure announced channels exist on-chain,
17059 * channel data is correct, and that the announcement is signed with
17060 * channel owners' keys.
17062 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger);
17065 * Creates a new tracker of the actual state of the network of channels and nodes,
17066 * assuming an existing Network Graph.
17068 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph);
17071 * Adds a provider used to check new announcements. Does not affect
17072 * existing announcements unless they are updated.
17073 * Add, update or remove the provider would replace the current one.
17075 void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKAccess *chain_access);
17078 * Take a read lock on the network_graph and return it in the C-bindings
17079 * newtype helper. This is likely only useful when called via the C
17080 * bindings as you can call `self.network_graph.read().unwrap()` in Rust
17083 MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
17086 * Get a reference to the NetworkGraph which this read-lock contains.
17088 MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg);
17091 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
17092 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
17094 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
17097 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
17098 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
17100 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
17103 * Frees any resources used by the DirectionalChannelInfo, if is_owned is set and inner is non-NULL.
17105 void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj);
17108 * When the last update to the channel direction was issued.
17109 * Value is opaque, as set in the announcement.
17111 uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17114 * When the last update to the channel direction was issued.
17115 * Value is opaque, as set in the announcement.
17117 void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val);
17120 * Whether the channel can be currently used for payments (in this one direction).
17122 bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17125 * Whether the channel can be currently used for payments (in this one direction).
17127 void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val);
17130 * The difference in CLTV values that you must have when routing through this channel.
17132 uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17135 * The difference in CLTV values that you must have when routing through this channel.
17137 void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val);
17140 * The minimum value, which must be relayed to the next hop via the channel
17142 uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17145 * The minimum value, which must be relayed to the next hop via the channel
17147 void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val);
17150 * The maximum value which may be relayed to the next hop via the channel.
17152 struct LDKCOption_u64Z DirectionalChannelInfo_get_htlc_maximum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17155 * The maximum value which may be relayed to the next hop via the channel.
17157 void DirectionalChannelInfo_set_htlc_maximum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
17160 * Fees charged when the channel is used for routing
17162 struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17165 * Fees charged when the channel is used for routing
17167 void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
17170 * Most recent update for the channel received from the network
17171 * Mostly redundant with the data we store in fields explicitly.
17172 * Everything else is useful only for sending out for initial routing sync.
17173 * Not stored if contains excess data to prevent DoS.
17175 struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17178 * Most recent update for the channel received from the network
17179 * Mostly redundant with the data we store in fields explicitly.
17180 * Everything else is useful only for sending out for initial routing sync.
17181 * Not stored if contains excess data to prevent DoS.
17183 void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
17186 * Constructs a new DirectionalChannelInfo given each field
17188 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);
17191 * Creates a copy of the DirectionalChannelInfo
17193 struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
17196 * Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read
17198 struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj);
17201 * Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write
17203 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser);
17206 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
17208 void ChannelInfo_free(struct LDKChannelInfo this_obj);
17211 * Protocol features of a channel communicated during its announcement
17213 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17216 * Protocol features of a channel communicated during its announcement
17218 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
17221 * Source node of the first direction of a channel
17223 struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17226 * Source node of the first direction of a channel
17228 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17231 * Details about the first direction of a channel
17233 struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17236 * Details about the first direction of a channel
17238 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
17241 * Source node of the second direction of a channel
17243 struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17246 * Source node of the second direction of a channel
17248 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17251 * Details about the second direction of a channel
17253 struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17256 * Details about the second direction of a channel
17258 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
17261 * The channel capacity as seen on-chain, if chain lookup is available.
17263 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17266 * The channel capacity as seen on-chain, if chain lookup is available.
17268 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
17271 * An initial announcement of the channel
17272 * Mostly redundant with the data we store in fields explicitly.
17273 * Everything else is useful only for sending out for initial routing sync.
17274 * Not stored if contains excess data to prevent DoS.
17276 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17279 * An initial announcement of the channel
17280 * Mostly redundant with the data we store in fields explicitly.
17281 * Everything else is useful only for sending out for initial routing sync.
17282 * Not stored if contains excess data to prevent DoS.
17284 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
17287 * Constructs a new ChannelInfo given each field
17289 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);
17292 * Creates a copy of the ChannelInfo
17294 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
17297 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
17299 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
17302 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
17304 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
17307 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
17309 void RoutingFees_free(struct LDKRoutingFees this_obj);
17312 * Flat routing fee in satoshis
17314 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
17317 * Flat routing fee in satoshis
17319 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
17322 * Liquidity-based routing fee in millionths of a routed amount.
17323 * In other words, 10000 is 1%.
17325 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
17328 * Liquidity-based routing fee in millionths of a routed amount.
17329 * In other words, 10000 is 1%.
17331 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
17334 * Constructs a new RoutingFees given each field
17336 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
17339 * Checks if two RoutingFeess contain equal inner contents.
17340 * This ignores pointers and is_owned flags and looks at the values in fields.
17341 * Two objects with NULL inner values will be considered "equal" here.
17343 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
17346 * Creates a copy of the RoutingFees
17348 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
17351 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
17353 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
17356 * Read a RoutingFees from a byte array, created by RoutingFees_write
17358 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
17361 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
17363 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
17366 * Protocol features the node announced support for
17368 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
17371 * Protocol features the node announced support for
17373 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
17376 * When the last known update to the node state was issued.
17377 * Value is opaque, as set in the announcement.
17379 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
17382 * When the last known update to the node state was issued.
17383 * Value is opaque, as set in the announcement.
17385 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
17388 * Color assigned to the node
17390 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
17393 * Color assigned to the node
17395 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
17398 * Moniker assigned to the node.
17399 * May be invalid or malicious (eg control chars),
17400 * should not be exposed to the user.
17402 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
17405 * Moniker assigned to the node.
17406 * May be invalid or malicious (eg control chars),
17407 * should not be exposed to the user.
17409 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
17412 * Internet-level addresses via which one can connect to the node
17414 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
17417 * An initial announcement of the node
17418 * Mostly redundant with the data we store in fields explicitly.
17419 * Everything else is useful only for sending out for initial routing sync.
17420 * Not stored if contains excess data to prevent DoS.
17422 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
17425 * An initial announcement of the node
17426 * Mostly redundant with the data we store in fields explicitly.
17427 * Everything else is useful only for sending out for initial routing sync.
17428 * Not stored if contains excess data to prevent DoS.
17430 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
17433 * Constructs a new NodeAnnouncementInfo given each field
17435 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);
17438 * Creates a copy of the NodeAnnouncementInfo
17440 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
17443 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
17445 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
17448 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
17450 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
17453 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
17455 void NodeInfo_free(struct LDKNodeInfo this_obj);
17458 * All valid channels a node has announced
17460 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
17463 * Lowest fees enabling routing via any of the enabled, known channels to a node.
17464 * The two fields (flat and proportional fee) are independent,
17465 * meaning they don't have to refer to the same channel.
17467 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
17470 * Lowest fees enabling routing via any of the enabled, known channels to a node.
17471 * The two fields (flat and proportional fee) are independent,
17472 * meaning they don't have to refer to the same channel.
17474 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
17477 * More information about a node from node_announcement.
17478 * Optional because we store a Node entry after learning about it from
17479 * a channel announcement, but before receiving a node announcement.
17481 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
17484 * More information about a node from node_announcement.
17485 * Optional because we store a Node entry after learning about it from
17486 * a channel announcement, but before receiving a node announcement.
17488 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
17491 * Constructs a new NodeInfo given each field
17493 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
17496 * Creates a copy of the NodeInfo
17498 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
17501 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
17503 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
17506 * Read a NodeInfo from a byte array, created by NodeInfo_write
17508 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
17511 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
17513 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
17516 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
17518 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
17521 * Creates a new, empty, network graph.
17523 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
17526 * For an already known node (from channel announcements), update its stored properties from a
17527 * given node announcement.
17529 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
17530 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
17531 * routing messages from a source using a protocol other than the lightning P2P protocol.
17533 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
17536 * For an already known node (from channel announcements), update its stored properties from a
17537 * given node announcement without verifying the associated signatures. Because we aren't
17538 * given the associated signatures here we cannot relay the node announcement to any of our
17541 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
17544 * Store or update channel info from a channel announcement.
17546 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
17547 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
17548 * routing messages from a source using a protocol other than the lightning P2P protocol.
17550 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
17551 * the corresponding UTXO exists on chain and is correctly-formatted.
17553 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);
17556 * Store or update channel info from a channel announcement without verifying the associated
17557 * signatures. Because we aren't given the associated signatures here we cannot relay the
17558 * channel announcement to any of our peers.
17560 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
17561 * the corresponding UTXO exists on chain and is correctly-formatted.
17563 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);
17566 * Close a channel if a corresponding HTLC fail was sent.
17567 * If permanent, removes a channel from the local storage.
17568 * May cause the removal of nodes too, if this was their last channel.
17569 * If not permanent, makes channels unavailable for routing.
17571 void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
17574 * For an already known (from announcement) channel, update info about one of the directions
17577 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
17578 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
17579 * routing messages from a source using a protocol other than the lightning P2P protocol.
17581 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
17584 * For an already known (from announcement) channel, update info about one of the directions
17585 * of the channel without verifying the associated signatures. Because we aren't given the
17586 * associated signatures here we cannot relay the channel update to any of our peers.
17588 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
17591 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
17593 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
17596 * Initialize a new FilesystemPersister and set the path to the individual channels'
17599 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
17602 * Get the directory which was provided when this persister was initialized.
17604 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
17607 * Writes the provided `ChannelManager` to the path provided at `FilesystemPersister`
17608 * initialization, within a file called \"manager\".
17610 MUST_USE_RES struct LDKCResult_NoneErrorZ FilesystemPersister_persist_manager(struct LDKStr data_dir, const struct LDKChannelManager *NONNULL_PTR manager);
17613 * Read `ChannelMonitor`s from disk.
17615 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
17618 * Constructs a new Persist which calls the relevant methods on this_arg.
17619 * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
17621 struct LDKPersist FilesystemPersister_as_Persist(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
17624 * **Call this function on startup to ensure that all assumptions about the platform are valid.**
17626 * Unfortunately we have to make assumptions about the upper bounds of the `SystemTime` type on
17627 * your platform which we can't fully verify at compile time and which isn't part of it's contract.
17628 * To our best knowledge our assumptions hold for all platforms officially supported by rust, but
17629 * since this check is fast we recommend to do it anyway.
17631 * If this function fails this is considered a bug. Please open an issue describing your
17632 * platform and stating your current system time.
17635 * If the check fails this function panics. By calling this function on startup you ensure that
17636 * this wont happen at an arbitrary later point in time.
17638 void check_platform(void);
17641 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
17643 void Invoice_free(struct LDKInvoice this_obj);
17646 * Checks if two Invoices contain equal inner contents.
17647 * This ignores pointers and is_owned flags and looks at the values in fields.
17648 * Two objects with NULL inner values will be considered "equal" here.
17650 bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
17653 * Creates a copy of the Invoice
17655 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
17658 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
17660 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
17663 * Checks if two SignedRawInvoices contain equal inner contents.
17664 * This ignores pointers and is_owned flags and looks at the values in fields.
17665 * Two objects with NULL inner values will be considered "equal" here.
17667 bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
17670 * Creates a copy of the SignedRawInvoice
17672 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
17675 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
17677 void RawInvoice_free(struct LDKRawInvoice this_obj);
17682 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
17687 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
17690 * Checks if two RawInvoices contain equal inner contents.
17691 * This ignores pointers and is_owned flags and looks at the values in fields.
17692 * Two objects with NULL inner values will be considered "equal" here.
17694 bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
17697 * Creates a copy of the RawInvoice
17699 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
17702 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
17704 void RawDataPart_free(struct LDKRawDataPart this_obj);
17707 * generation time of the invoice
17709 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
17712 * generation time of the invoice
17714 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
17717 * Checks if two RawDataParts contain equal inner contents.
17718 * This ignores pointers and is_owned flags and looks at the values in fields.
17719 * Two objects with NULL inner values will be considered "equal" here.
17721 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
17724 * Creates a copy of the RawDataPart
17726 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
17729 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
17731 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
17734 * Checks if two PositiveTimestamps contain equal inner contents.
17735 * This ignores pointers and is_owned flags and looks at the values in fields.
17736 * Two objects with NULL inner values will be considered "equal" here.
17738 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
17741 * Creates a copy of the PositiveTimestamp
17743 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
17746 * Creates a copy of the SiPrefix
17748 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
17751 * Checks if two SiPrefixs contain equal inner contents.
17752 * This ignores pointers and is_owned flags and looks at the values in fields.
17754 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
17757 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
17758 * This is effectively 10^12 * the prefix multiplier
17760 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
17763 * Creates a copy of the Currency
17765 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
17768 * Checks if two Currencys contain equal inner contents.
17769 * This ignores pointers and is_owned flags and looks at the values in fields.
17771 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
17774 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
17776 void Sha256_free(struct LDKSha256 this_obj);
17779 * Checks if two Sha256s contain equal inner contents.
17780 * This ignores pointers and is_owned flags and looks at the values in fields.
17781 * Two objects with NULL inner values will be considered "equal" here.
17783 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
17786 * Creates a copy of the Sha256
17788 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
17791 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
17793 void Description_free(struct LDKDescription this_obj);
17796 * Checks if two Descriptions contain equal inner contents.
17797 * This ignores pointers and is_owned flags and looks at the values in fields.
17798 * Two objects with NULL inner values will be considered "equal" here.
17800 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
17803 * Creates a copy of the Description
17805 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
17808 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
17810 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
17813 * Checks if two PayeePubKeys contain equal inner contents.
17814 * This ignores pointers and is_owned flags and looks at the values in fields.
17815 * Two objects with NULL inner values will be considered "equal" here.
17817 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
17820 * Creates a copy of the PayeePubKey
17822 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
17825 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
17827 void ExpiryTime_free(struct LDKExpiryTime this_obj);
17830 * Checks if two ExpiryTimes contain equal inner contents.
17831 * This ignores pointers and is_owned flags and looks at the values in fields.
17832 * Two objects with NULL inner values will be considered "equal" here.
17834 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
17837 * Creates a copy of the ExpiryTime
17839 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
17842 * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
17844 void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
17847 * Checks if two MinFinalCltvExpirys contain equal inner contents.
17848 * This ignores pointers and is_owned flags and looks at the values in fields.
17849 * Two objects with NULL inner values will be considered "equal" here.
17851 bool MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b);
17854 * Creates a copy of the MinFinalCltvExpiry
17856 struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
17859 * Frees any resources used by the Fallback
17861 void Fallback_free(struct LDKFallback this_ptr);
17864 * Creates a copy of the Fallback
17866 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
17869 * Checks if two Fallbacks contain equal inner contents.
17870 * This ignores pointers and is_owned flags and looks at the values in fields.
17872 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
17875 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
17877 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
17880 * Checks if two InvoiceSignatures contain equal inner contents.
17881 * This ignores pointers and is_owned flags and looks at the values in fields.
17882 * Two objects with NULL inner values will be considered "equal" here.
17884 bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b);
17887 * Creates a copy of the InvoiceSignature
17889 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
17892 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
17894 void RouteHint_free(struct LDKRouteHint this_obj);
17897 * Checks if two RouteHints contain equal inner contents.
17898 * This ignores pointers and is_owned flags and looks at the values in fields.
17899 * Two objects with NULL inner values will be considered "equal" here.
17901 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
17904 * Creates a copy of the RouteHint
17906 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
17909 * Disassembles the `SignedRawInvoice` into its three parts:
17911 * 2. hash of the raw invoice
17914 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
17917 * The `RawInvoice` which was signed.
17919 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
17922 * The hash of the `RawInvoice` that was signed.
17924 MUST_USE_RES const uint8_t (*SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
17927 * InvoiceSignature for the invoice.
17929 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
17932 * Recovers the public key used for signing the invoice from the recoverable signature.
17934 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
17937 * Checks if the signature is valid for the included payee public key or if none exists if it's
17938 * valid for the recovered signature (which should always be true?).
17940 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
17943 * Calculate the hash of the encoded `RawInvoice`
17945 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17947 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17949 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17951 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17953 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17955 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17957 MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17959 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17961 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17963 MUST_USE_RES struct LDKCVec_RouteHintZ RawInvoice_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17965 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17967 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17970 * Create a new `PositiveTimestamp` from a unix timestamp in the Range
17971 * `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a
17972 * `CreationError::TimestampOutOfBounds`.
17974 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
17977 * Create a new `PositiveTimestamp` from a `SystemTime` with a corresponding unix timestamp in
17978 * the Range `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a
17979 * `CreationError::TimestampOutOfBounds`.
17981 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
17984 * Returns the UNIX timestamp representing the stored time
17986 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
17989 * Returns a reference to the internal `SystemTime` time representation
17991 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
17994 * Transform the `Invoice` into it's unchecked version
17996 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
17999 * Check that the invoice is signed correctly and that key recovery works
18001 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
18004 * Constructs an `Invoice` from a `SignedInvoice` by checking all its invariants.
18006 * use lightning_invoice::*;
18008 * let invoice = \"lnbc1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdp\\
18009 * \tl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq8rkx3yf5tcsyz3d7\\
18010 * \t3gafnh3cax9rn449d9p5uxz9ezhhypd0elx87sjle52x86fux2ypatgddc6k63n7erqz25le42c4u4ec\\
18011 * \tky03ylcqca784w\";
18013 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
18015 * assert!(Invoice::from_signed(signed).is_ok());
18018 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
18021 * Returns the `Invoice`'s timestamp (should equal it's creation time)
18023 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
18026 * Returns the hash to which we will receive the preimage on completion of the payment
18028 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
18031 * Get the payee's public key if one was included in the invoice
18033 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
18036 * Get the payment secret if one was included in the invoice
18038 MUST_USE_RES struct LDKThirtyTwoBytes Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg);
18041 * Get the invoice features if they were included in the invoice
18043 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
18046 * Recover the payee's public key (only to be used if none was included in the invoice)
18048 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
18051 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
18053 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
18056 * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
18057 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
18059 MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
18062 * Returns a list of all routes included in the invoice
18064 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
18067 * Returns the currency for which the invoice was issued
18069 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
18072 * Returns the amount if specified in the invoice as pico <currency>.
18074 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_pico_btc(const struct LDKInvoice *NONNULL_PTR this_arg);
18077 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
18078 * returns `CreationError::DescriptionTooLong` otherwise
18080 * Please note that single characters may use more than one byte due to UTF8 encoding.
18082 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
18085 * Returns the underlying description `String`
18087 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
18090 * Construct an `ExpiryTime` from seconds. If there exists a `PositiveTimestamp` which would
18091 * overflow on adding the `EpiryTime` to it then this function will return a
18092 * `CreationError::ExpiryTimeOutOfBounds`.
18094 MUST_USE_RES struct LDKCResult_ExpiryTimeCreationErrorZ ExpiryTime_from_seconds(uint64_t seconds);
18097 * Construct an `ExpiryTime` from a `Duration`. If there exists a `PositiveTimestamp` which
18098 * would overflow on adding the `EpiryTime` to it then this function will return a
18099 * `CreationError::ExpiryTimeOutOfBounds`.
18101 MUST_USE_RES struct LDKCResult_ExpiryTimeCreationErrorZ ExpiryTime_from_duration(uint64_t duration);
18104 * Returns the expiry time in seconds
18106 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
18109 * Returns a reference to the underlying `Duration` (=expiry time)
18111 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
18114 * Create a new (partial) route from a list of hops
18116 MUST_USE_RES struct LDKCResult_RouteHintCreationErrorZ RouteHint_new(struct LDKCVec_RouteHintHopZ hops);
18119 * Returrn the underlying vector of hops
18121 MUST_USE_RES struct LDKCVec_RouteHintHopZ RouteHint_into_inner(struct LDKRouteHint this_arg);
18124 * Creates a copy of the CreationError
18126 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
18129 * Checks if two CreationErrors contain equal inner contents.
18130 * This ignores pointers and is_owned flags and looks at the values in fields.
18132 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
18135 * Get the string representation of a CreationError object
18137 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
18140 * Creates a copy of the SemanticError
18142 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
18145 * Checks if two SemanticErrors contain equal inner contents.
18146 * This ignores pointers and is_owned flags and looks at the values in fields.
18148 bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
18151 * Get the string representation of a SemanticError object
18153 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
18156 * Frees any resources used by the SignOrCreationError
18158 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
18161 * Creates a copy of the SignOrCreationError
18163 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
18166 * Checks if two SignOrCreationErrors contain equal inner contents.
18167 * This ignores pointers and is_owned flags and looks at the values in fields.
18169 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
18172 * Get the string representation of a SignOrCreationError object
18174 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
18177 * Utility to construct an invoice. Generally, unless you want to do something like a custom
18178 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
18179 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
18180 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
18181 * that the payment secret is valid when the invoice is paid.
18183 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);
18186 * Read a SiPrefix object from a string
18188 struct LDKCResult_SiPrefixNoneZ SiPrefix_from_str(struct LDKStr s);
18191 * Read a Invoice object from a string
18193 struct LDKCResult_InvoiceNoneZ Invoice_from_str(struct LDKStr s);
18196 * Read a SignedRawInvoice object from a string
18198 struct LDKCResult_SignedRawInvoiceNoneZ SignedRawInvoice_from_str(struct LDKStr s);
18201 * Get the string representation of a Invoice object
18203 struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o);
18206 * Get the string representation of a SignedRawInvoice object
18208 struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o);
18211 * Get the string representation of a Currency object
18213 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
18216 * Get the string representation of a SiPrefix object
18218 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
18220 #endif /* LDK_C_BINDINGS_H */
18222 #include <ldk_ver.h>