1 #ifndef LDK_C_BINDINGS_H
2 #define LDK_C_BINDINGS_H
4 /* Generated with cbindgen:0.19.0 */
6 /* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */
11 #include <ldk_rust_types.h>
14 * An error when accessing the chain via [`Access`].
16 typedef enum LDKAccessError {
18 * The requested chain is unknown.
20 LDKAccessError_UnknownChain,
22 * The requested transaction doesn't exist or hasn't confirmed.
24 LDKAccessError_UnknownTx,
26 * Must be last for serialization purposes
28 LDKAccessError_Sentinel,
32 * An error enum representing a failure to persist a channel monitor update.
34 typedef enum LDKChannelMonitorUpdateErr {
36 * Used to indicate a temporary failure (eg connection to a watchtower or remote backup of
37 * our state failed, but is expected to succeed at some point in the future).
39 * Such a failure will \"freeze\" a channel, preventing us from revoking old states or
40 * submitting new commitment transactions to the counterparty. Once the update(s) which failed
41 * have been successfully applied, ChannelManager::channel_monitor_updated can be used to
42 * restore the channel to an operational state.
44 * Note that a given ChannelManager will *never* re-generate a given ChannelMonitorUpdate. If
45 * you return a TemporaryFailure you must ensure that it is written to disk safely before
46 * writing out the latest ChannelManager state.
48 * Even when a channel has been \"frozen\" updates to the ChannelMonitor can continue to occur
49 * (eg if an inbound HTLC which we forwarded was claimed upstream resulting in us attempting
50 * to claim it on this channel) and those updates must be applied wherever they can be. At
51 * least one such updated ChannelMonitor must be persisted otherwise PermanentFailure should
52 * be returned to get things on-chain ASAP using only the in-memory copy. Obviously updates to
53 * the channel which would invalidate previous ChannelMonitors are not made when a channel has
56 * Note that even if updates made after TemporaryFailure succeed you must still call
57 * channel_monitor_updated to ensure you have the latest monitor and re-enable normal channel
60 * Note that the update being processed here will not be replayed for you when you call
61 * ChannelManager::channel_monitor_updated, so you must store the update itself along
62 * with the persisted ChannelMonitor on your own local disk prior to returning a
63 * TemporaryFailure. You may, of course, employ a journaling approach, storing only the
64 * ChannelMonitorUpdate on disk without updating the monitor itself, replaying the journal at
67 * For deployments where a copy of ChannelMonitors and other local state are backed up in a
68 * remote location (with local copies persisted immediately), it is anticipated that all
69 * updates will return TemporaryFailure until the remote copies could be updated.
71 LDKChannelMonitorUpdateErr_TemporaryFailure,
73 * Used to indicate no further channel monitor updates will be allowed (eg we've moved on to a
74 * different watchtower and cannot update with all watchtowers that were previously informed
77 * At reception of this error, ChannelManager will force-close the channel and return at
78 * least a final ChannelMonitorUpdate::ChannelForceClosed which must be delivered to at
79 * least one ChannelMonitor copy. Revocation secret MUST NOT be released and offchain channel
80 * update must be rejected.
82 * This failure may also signal a failure to update the local persisted copy of one of
83 * the channel monitor instance.
85 * Note that even when you fail a holder commitment transaction update, you must store the
86 * update to ensure you can claim from it in case of a duplicate copy of this ChannelMonitor
87 * broadcasts it (e.g distributed channel-monitor deployment)
89 * In case of distributed watchtowers deployment, the new version must be written to disk, as
90 * state may have been stored but rejected due to a block forcing a commitment broadcast. This
91 * storage is used to claim outputs of rejected state confirmed onchain by another watchtower,
92 * lagging behind on block processing.
94 LDKChannelMonitorUpdateErr_PermanentFailure,
96 * Must be last for serialization purposes
98 LDKChannelMonitorUpdateErr_Sentinel,
99 } LDKChannelMonitorUpdateErr;
102 * An enum that represents the speed at which we want a transaction to confirm used for feerate
105 typedef enum LDKConfirmationTarget {
107 * We are happy with this transaction confirming slowly when feerate drops some.
109 LDKConfirmationTarget_Background,
111 * We'd like this transaction to confirm without major delay, but 12-18 blocks is fine.
113 LDKConfirmationTarget_Normal,
115 * We'd like this transaction to confirm in the next few blocks.
117 LDKConfirmationTarget_HighPriority,
119 * Must be last for serialization purposes
121 LDKConfirmationTarget_Sentinel,
122 } LDKConfirmationTarget;
125 * Errors that may occur when constructing a new `RawInvoice` or `Invoice`
127 typedef enum LDKCreationError {
129 * The supplied description string was longer than 639 __bytes__ (see [`Description::new(…)`](./struct.Description.html#method.new))
131 LDKCreationError_DescriptionTooLong,
133 * The specified route has too many hops and can't be encoded
135 LDKCreationError_RouteTooLong,
137 * The unix timestamp of the supplied date is <0 or can't be represented as `SystemTime`
139 LDKCreationError_TimestampOutOfBounds,
141 * The supplied expiry time could cause an overflow if added to a `PositiveTimestamp`
143 LDKCreationError_ExpiryTimeOutOfBounds,
145 * Must be last for serialization purposes
147 LDKCreationError_Sentinel,
151 * Enum representing the crypto currencies (or networks) supported by this library
153 typedef enum LDKCurrency {
161 LDKCurrency_BitcoinTestnet,
175 * Must be last for serialization purposes
177 LDKCurrency_Sentinel,
181 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
183 typedef enum LDKIOError {
185 LDKIOError_PermissionDenied,
186 LDKIOError_ConnectionRefused,
187 LDKIOError_ConnectionReset,
188 LDKIOError_ConnectionAborted,
189 LDKIOError_NotConnected,
190 LDKIOError_AddrInUse,
191 LDKIOError_AddrNotAvailable,
192 LDKIOError_BrokenPipe,
193 LDKIOError_AlreadyExists,
194 LDKIOError_WouldBlock,
195 LDKIOError_InvalidInput,
196 LDKIOError_InvalidData,
198 LDKIOError_WriteZero,
199 LDKIOError_Interrupted,
201 LDKIOError_UnexpectedEof,
203 * Must be last for serialization purposes
209 * An enum representing the available verbosity levels of the logger.
211 typedef enum LDKLevel {
213 * Designates very low priority, often extremely verbose, information
217 * Designates lower priority information
221 * Designates useful information
225 * Designates hazardous situations
229 * Designates very serious errors
233 * Must be last for serialization purposes
239 * An enum representing the possible Bitcoin or test networks which we can run on
241 typedef enum LDKNetwork {
243 * The main Bitcoin blockchain.
247 * The testnet3 blockchain.
251 * A local test blockchain.
255 * A blockchain on which blocks are signed instead of mined.
259 * Must be last for serialization purposes
265 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
267 typedef enum LDKSecp256k1Error {
269 * Signature failed verification
271 LDKSecp256k1Error_IncorrectSignature,
273 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
275 LDKSecp256k1Error_InvalidMessage,
279 LDKSecp256k1Error_InvalidPublicKey,
283 LDKSecp256k1Error_InvalidSignature,
287 LDKSecp256k1Error_InvalidSecretKey,
291 LDKSecp256k1Error_InvalidRecoveryId,
293 * Invalid tweak for add_assign or mul_assign
295 LDKSecp256k1Error_InvalidTweak,
297 * tweak_add_check failed on an xonly public key
299 LDKSecp256k1Error_TweakCheckFailed,
301 * Didn't pass enough memory to context creation with preallocated memory
303 LDKSecp256k1Error_NotEnoughMemory,
305 * Must be last for serialization purposes
307 LDKSecp256k1Error_Sentinel,
311 * Errors that may occur when converting a `RawInvoice` to an `Invoice`. They relate to the
312 * requirements sections in BOLT #11
314 typedef enum LDKSemanticError {
316 * The invoice is missing the mandatory payment hash
318 LDKSemanticError_NoPaymentHash,
320 * The invoice has multiple payment hashes which isn't allowed
322 LDKSemanticError_MultiplePaymentHashes,
324 * No description or description hash are part of the invoice
326 LDKSemanticError_NoDescription,
328 * The invoice contains multiple descriptions and/or description hashes which isn't allowed
330 LDKSemanticError_MultipleDescriptions,
332 * The invoice contains multiple payment secrets
334 LDKSemanticError_MultiplePaymentSecrets,
336 * The invoice's features are invalid
338 LDKSemanticError_InvalidFeatures,
340 * The recovery id doesn't fit the signature/pub key
342 LDKSemanticError_InvalidRecoveryId,
344 * The invoice's signature is invalid
346 LDKSemanticError_InvalidSignature,
348 * Must be last for serialization purposes
350 LDKSemanticError_Sentinel,
354 * SI prefixes for the human readable part
356 typedef enum LDKSiPrefix {
374 * Must be last for serialization purposes
376 LDKSiPrefix_Sentinel,
380 * A Rust str object, ie a reference to a UTF8-valid string.
381 * This is *not* null-terminated so cannot be used directly as a C string!
383 typedef struct LDKStr {
385 * A pointer to the string's bytes, in UTF8 encoding
387 const uint8_t *chars;
389 * The number of bytes (not characters!) pointed to by `chars`
393 * Whether the data pointed to by `chars` should be freed or not.
399 * A serialized transaction, in (pointer, length) form.
401 * This type optionally owns its own memory, and thus the semantics around access change based on
402 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
403 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
404 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
405 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
406 * you would be invalid.
408 * Note that, while it may change in the future, because transactions on the Rust side are stored
409 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
410 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
411 * `data_is_owned` either set or unset at your discretion.
413 typedef struct LDKTransaction {
415 * The serialized transaction data.
417 * This is non-const for your convenience, an object passed to Rust is never written to.
421 * The length of the serialized transaction
425 * Whether the data pointed to by `data` should be freed or not.
431 * A dynamically-allocated array of u8s of arbitrary size.
432 * This corresponds to std::vector in C++
434 typedef struct LDKCVec_u8Z {
436 * The elements in the array.
437 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
441 * The number of elements pointed to by `data`.
447 * A transaction output including a scriptPubKey and value.
448 * This type *does* own its own memory, so must be free'd appropriately.
450 typedef struct LDKTxOut {
452 * The script_pubkey in this output
454 struct LDKCVec_u8Z script_pubkey;
456 * The value, in satoshis, of this output
462 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
464 typedef struct LDKSecretKey {
466 * The bytes of the secret key
472 * The contents of CResult_SecretKeyErrorZ
474 typedef union LDKCResult_SecretKeyErrorZPtr {
476 * A pointer to the contents in the success state.
477 * Reading from this pointer when `result_ok` is not set is undefined.
479 struct LDKSecretKey *result;
481 * A pointer to the contents in the error state.
482 * Reading from this pointer when `result_ok` is set is undefined.
484 enum LDKSecp256k1Error *err;
485 } LDKCResult_SecretKeyErrorZPtr;
488 * A CResult_SecretKeyErrorZ represents the result of a fallible operation,
489 * containing a crate::c_types::SecretKey on success and a crate::c_types::Secp256k1Error on failure.
490 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
492 typedef struct LDKCResult_SecretKeyErrorZ {
494 * The contents of this CResult_SecretKeyErrorZ, accessible via either
495 * `err` or `result` depending on the state of `result_ok`.
497 union LDKCResult_SecretKeyErrorZPtr contents;
499 * Whether this CResult_SecretKeyErrorZ represents a success state.
502 } LDKCResult_SecretKeyErrorZ;
505 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
507 typedef struct LDKPublicKey {
509 * The bytes of the public key
511 uint8_t compressed_form[33];
515 * The contents of CResult_PublicKeyErrorZ
517 typedef union LDKCResult_PublicKeyErrorZPtr {
519 * A pointer to the contents in the success state.
520 * Reading from this pointer when `result_ok` is not set is undefined.
522 struct LDKPublicKey *result;
524 * A pointer to the contents in the error state.
525 * Reading from this pointer when `result_ok` is set is undefined.
527 enum LDKSecp256k1Error *err;
528 } LDKCResult_PublicKeyErrorZPtr;
531 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
532 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
533 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
535 typedef struct LDKCResult_PublicKeyErrorZ {
537 * The contents of this CResult_PublicKeyErrorZ, accessible via either
538 * `err` or `result` depending on the state of `result_ok`.
540 union LDKCResult_PublicKeyErrorZPtr contents;
542 * Whether this CResult_PublicKeyErrorZ represents a success state.
545 } LDKCResult_PublicKeyErrorZ;
550 * The set of public keys which are used in the creation of one commitment transaction.
551 * These are derived from the channel base keys and per-commitment data.
553 * A broadcaster key is provided from potential broadcaster of the computed transaction.
554 * A countersignatory key is coming from a protocol participant unable to broadcast the
557 * These keys are assumed to be good, either because the code derived them from
558 * channel basepoints via the new function, or they were obtained via
559 * CommitmentTransaction.trust().keys() because we trusted the source of the
560 * pre-calculated keys.
562 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
564 * A pointer to the opaque Rust object.
565 * Nearly everywhere, inner must be non-null, however in places where
566 * the Rust equivalent takes an Option, it may be set to null to indicate None.
568 LDKnativeTxCreationKeys *inner;
570 * Indicates that this is the only struct which contains the same pointer.
571 * Rust functions which take ownership of an object provided via an argument require
572 * this to be true and invalidate the object pointed to by inner.
580 * An error in decoding a message or struct.
582 typedef struct MUST_USE_STRUCT LDKDecodeError {
584 * A pointer to the opaque Rust object.
585 * Nearly everywhere, inner must be non-null, however in places where
586 * the Rust equivalent takes an Option, it may be set to null to indicate None.
588 LDKnativeDecodeError *inner;
590 * Indicates that this is the only struct which contains the same pointer.
591 * Rust functions which take ownership of an object provided via an argument require
592 * this to be true and invalidate the object pointed to by inner.
598 * The contents of CResult_TxCreationKeysDecodeErrorZ
600 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
602 * A pointer to the contents in the success state.
603 * Reading from this pointer when `result_ok` is not set is undefined.
605 struct LDKTxCreationKeys *result;
607 * A pointer to the contents in the error state.
608 * Reading from this pointer when `result_ok` is set is undefined.
610 struct LDKDecodeError *err;
611 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
614 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
615 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
616 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
618 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
620 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
621 * `err` or `result` depending on the state of `result_ok`.
623 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
625 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
628 } LDKCResult_TxCreationKeysDecodeErrorZ;
633 * One counterparty's public keys which do not change over the life of a channel.
635 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
637 * A pointer to the opaque Rust object.
638 * Nearly everywhere, inner must be non-null, however in places where
639 * the Rust equivalent takes an Option, it may be set to null to indicate None.
641 LDKnativeChannelPublicKeys *inner;
643 * Indicates that this is the only struct which contains the same pointer.
644 * Rust functions which take ownership of an object provided via an argument require
645 * this to be true and invalidate the object pointed to by inner.
648 } LDKChannelPublicKeys;
651 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
653 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
655 * A pointer to the contents in the success state.
656 * Reading from this pointer when `result_ok` is not set is undefined.
658 struct LDKChannelPublicKeys *result;
660 * A pointer to the contents in the error state.
661 * Reading from this pointer when `result_ok` is set is undefined.
663 struct LDKDecodeError *err;
664 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
667 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
668 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
669 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
671 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
673 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
674 * `err` or `result` depending on the state of `result_ok`.
676 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
678 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
681 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
684 * The contents of CResult_TxCreationKeysErrorZ
686 typedef union LDKCResult_TxCreationKeysErrorZPtr {
688 * A pointer to the contents in the success state.
689 * Reading from this pointer when `result_ok` is not set is undefined.
691 struct LDKTxCreationKeys *result;
693 * A pointer to the contents in the error state.
694 * Reading from this pointer when `result_ok` is set is undefined.
696 enum LDKSecp256k1Error *err;
697 } LDKCResult_TxCreationKeysErrorZPtr;
700 * A CResult_TxCreationKeysErrorZ represents the result of a fallible operation,
701 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::c_types::Secp256k1Error on failure.
702 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
704 typedef struct LDKCResult_TxCreationKeysErrorZ {
706 * The contents of this CResult_TxCreationKeysErrorZ, accessible via either
707 * `err` or `result` depending on the state of `result_ok`.
709 union LDKCResult_TxCreationKeysErrorZPtr contents;
711 * Whether this CResult_TxCreationKeysErrorZ represents a success state.
714 } LDKCResult_TxCreationKeysErrorZ;
717 * An enum which can either contain a u32 or not
719 typedef enum LDKCOption_u32Z_Tag {
721 * When we're in this state, this COption_u32Z contains a u32
723 LDKCOption_u32Z_Some,
725 * When we're in this state, this COption_u32Z contains nothing
727 LDKCOption_u32Z_None,
729 * Must be last for serialization purposes
731 LDKCOption_u32Z_Sentinel,
732 } LDKCOption_u32Z_Tag;
734 typedef struct LDKCOption_u32Z {
735 LDKCOption_u32Z_Tag tag;
746 * Information about an HTLC as it appears in a commitment transaction
748 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
750 * A pointer to the opaque Rust object.
751 * Nearly everywhere, inner must be non-null, however in places where
752 * the Rust equivalent takes an Option, it may be set to null to indicate None.
754 LDKnativeHTLCOutputInCommitment *inner;
756 * Indicates that this is the only struct which contains the same pointer.
757 * Rust functions which take ownership of an object provided via an argument require
758 * this to be true and invalidate the object pointed to by inner.
761 } LDKHTLCOutputInCommitment;
764 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
766 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
768 * A pointer to the contents in the success state.
769 * Reading from this pointer when `result_ok` is not set is undefined.
771 struct LDKHTLCOutputInCommitment *result;
773 * A pointer to the contents in the error state.
774 * Reading from this pointer when `result_ok` is set is undefined.
776 struct LDKDecodeError *err;
777 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
780 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
781 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
782 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
784 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
786 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
787 * `err` or `result` depending on the state of `result_ok`.
789 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
791 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
794 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
799 * Late-bound per-channel counterparty data used to build transactions.
801 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
803 * A pointer to the opaque Rust object.
804 * Nearly everywhere, inner must be non-null, however in places where
805 * the Rust equivalent takes an Option, it may be set to null to indicate None.
807 LDKnativeCounterpartyChannelTransactionParameters *inner;
809 * Indicates that this is the only struct which contains the same pointer.
810 * Rust functions which take ownership of an object provided via an argument require
811 * this to be true and invalidate the object pointed to by inner.
814 } LDKCounterpartyChannelTransactionParameters;
817 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
819 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
821 * A pointer to the contents in the success state.
822 * Reading from this pointer when `result_ok` is not set is undefined.
824 struct LDKCounterpartyChannelTransactionParameters *result;
826 * A pointer to the contents in the error state.
827 * Reading from this pointer when `result_ok` is set is undefined.
829 struct LDKDecodeError *err;
830 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
833 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
834 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
835 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
837 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
839 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
840 * `err` or `result` depending on the state of `result_ok`.
842 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
844 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
847 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
852 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
853 * The fields are organized by holder/counterparty.
855 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
856 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
858 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
860 * A pointer to the opaque Rust object.
861 * Nearly everywhere, inner must be non-null, however in places where
862 * the Rust equivalent takes an Option, it may be set to null to indicate None.
864 LDKnativeChannelTransactionParameters *inner;
866 * Indicates that this is the only struct which contains the same pointer.
867 * Rust functions which take ownership of an object provided via an argument require
868 * this to be true and invalidate the object pointed to by inner.
871 } LDKChannelTransactionParameters;
874 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
876 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
878 * A pointer to the contents in the success state.
879 * Reading from this pointer when `result_ok` is not set is undefined.
881 struct LDKChannelTransactionParameters *result;
883 * A pointer to the contents in the error state.
884 * Reading from this pointer when `result_ok` is set is undefined.
886 struct LDKDecodeError *err;
887 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
890 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
891 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
892 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
894 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
896 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
897 * `err` or `result` depending on the state of `result_ok`.
899 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
901 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
904 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
907 * Represents a secp256k1 signature serialized as two 32-byte numbers
909 typedef struct LDKSignature {
911 * The bytes of the signature in "compact" form
913 uint8_t compact_form[64];
917 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
918 * This corresponds to std::vector in C++
920 typedef struct LDKCVec_SignatureZ {
922 * The elements in the array.
923 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
925 struct LDKSignature *data;
927 * The number of elements pointed to by `data`.
930 } LDKCVec_SignatureZ;
935 * Information needed to build and sign a holder's commitment transaction.
937 * The transaction is only signed once we are ready to broadcast.
939 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
941 * A pointer to the opaque Rust object.
942 * Nearly everywhere, inner must be non-null, however in places where
943 * the Rust equivalent takes an Option, it may be set to null to indicate None.
945 LDKnativeHolderCommitmentTransaction *inner;
947 * Indicates that this is the only struct which contains the same pointer.
948 * Rust functions which take ownership of an object provided via an argument require
949 * this to be true and invalidate the object pointed to by inner.
952 } LDKHolderCommitmentTransaction;
955 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
957 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
959 * A pointer to the contents in the success state.
960 * Reading from this pointer when `result_ok` is not set is undefined.
962 struct LDKHolderCommitmentTransaction *result;
964 * A pointer to the contents in the error state.
965 * Reading from this pointer when `result_ok` is set is undefined.
967 struct LDKDecodeError *err;
968 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
971 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
972 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
973 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
975 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
977 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
978 * `err` or `result` depending on the state of `result_ok`.
980 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
982 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
985 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
990 * A pre-built Bitcoin commitment transaction and its txid.
992 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
994 * A pointer to the opaque Rust object.
995 * Nearly everywhere, inner must be non-null, however in places where
996 * the Rust equivalent takes an Option, it may be set to null to indicate None.
998 LDKnativeBuiltCommitmentTransaction *inner;
1000 * Indicates that this is the only struct which contains the same pointer.
1001 * Rust functions which take ownership of an object provided via an argument require
1002 * this to be true and invalidate the object pointed to by inner.
1005 } LDKBuiltCommitmentTransaction;
1008 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
1010 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
1012 * A pointer to the contents in the success state.
1013 * Reading from this pointer when `result_ok` is not set is undefined.
1015 struct LDKBuiltCommitmentTransaction *result;
1017 * A pointer to the contents in the error state.
1018 * Reading from this pointer when `result_ok` is set is undefined.
1020 struct LDKDecodeError *err;
1021 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
1024 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1025 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1026 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1028 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
1030 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
1031 * `err` or `result` depending on the state of `result_ok`.
1033 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
1035 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
1038 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
1043 * This class tracks the per-transaction information needed to build a commitment transaction and to
1044 * actually build it and sign. It is used for holder transactions that we sign only when needed
1045 * and for transactions we sign for the counterparty.
1047 * This class can be used inside a signer implementation to generate a signature given the relevant
1050 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
1052 * A pointer to the opaque Rust object.
1053 * Nearly everywhere, inner must be non-null, however in places where
1054 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1056 LDKnativeCommitmentTransaction *inner;
1058 * Indicates that this is the only struct which contains the same pointer.
1059 * Rust functions which take ownership of an object provided via an argument require
1060 * this to be true and invalidate the object pointed to by inner.
1063 } LDKCommitmentTransaction;
1066 * The contents of CResult_CommitmentTransactionDecodeErrorZ
1068 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
1070 * A pointer to the contents in the success state.
1071 * Reading from this pointer when `result_ok` is not set is undefined.
1073 struct LDKCommitmentTransaction *result;
1075 * A pointer to the contents in the error state.
1076 * Reading from this pointer when `result_ok` is set is undefined.
1078 struct LDKDecodeError *err;
1079 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
1082 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1083 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1084 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1086 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
1088 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
1089 * `err` or `result` depending on the state of `result_ok`.
1091 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
1093 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
1096 } LDKCResult_CommitmentTransactionDecodeErrorZ;
1101 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
1102 * transaction and the transaction creation keys) are trusted.
1104 * See trust() and verify() functions on CommitmentTransaction.
1106 * This structure implements Deref.
1108 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
1110 * A pointer to the opaque Rust object.
1111 * Nearly everywhere, inner must be non-null, however in places where
1112 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1114 LDKnativeTrustedCommitmentTransaction *inner;
1116 * Indicates that this is the only struct which contains the same pointer.
1117 * Rust functions which take ownership of an object provided via an argument require
1118 * this to be true and invalidate the object pointed to by inner.
1121 } LDKTrustedCommitmentTransaction;
1124 * The contents of CResult_TrustedCommitmentTransactionNoneZ
1126 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
1128 * A pointer to the contents in the success state.
1129 * Reading from this pointer when `result_ok` is not set is undefined.
1131 struct LDKTrustedCommitmentTransaction *result;
1133 * Note that this value is always NULL, as there are no contents in the Err variant
1136 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
1139 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
1140 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
1141 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1143 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
1145 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
1146 * `err` or `result` depending on the state of `result_ok`.
1148 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
1150 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
1153 } LDKCResult_TrustedCommitmentTransactionNoneZ;
1156 * The contents of CResult_CVec_SignatureZNoneZ
1158 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
1160 * A pointer to the contents in the success state.
1161 * Reading from this pointer when `result_ok` is not set is undefined.
1163 struct LDKCVec_SignatureZ *result;
1165 * Note that this value is always NULL, as there are no contents in the Err variant
1168 } LDKCResult_CVec_SignatureZNoneZPtr;
1171 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1172 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1173 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1175 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1177 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1178 * `err` or `result` depending on the state of `result_ok`.
1180 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1182 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1185 } LDKCResult_CVec_SignatureZNoneZ;
1188 * The contents of CResult_NoneErrorZ
1190 typedef union LDKCResult_NoneErrorZPtr {
1192 * Note that this value is always NULL, as there are no contents in the OK variant
1196 * A pointer to the contents in the error state.
1197 * Reading from this pointer when `result_ok` is set is undefined.
1199 enum LDKIOError *err;
1200 } LDKCResult_NoneErrorZPtr;
1203 * A CResult_NoneErrorZ represents the result of a fallible operation,
1204 * containing a () on success and a crate::c_types::IOError on failure.
1205 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1207 typedef struct LDKCResult_NoneErrorZ {
1209 * The contents of this CResult_NoneErrorZ, accessible via either
1210 * `err` or `result` depending on the state of `result_ok`.
1212 union LDKCResult_NoneErrorZPtr contents;
1214 * Whether this CResult_NoneErrorZ represents a success state.
1217 } LDKCResult_NoneErrorZ;
1224 typedef struct MUST_USE_STRUCT LDKRouteHop {
1226 * A pointer to the opaque Rust object.
1227 * Nearly everywhere, inner must be non-null, however in places where
1228 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1230 LDKnativeRouteHop *inner;
1232 * Indicates that this is the only struct which contains the same pointer.
1233 * Rust functions which take ownership of an object provided via an argument require
1234 * this to be true and invalidate the object pointed to by inner.
1240 * The contents of CResult_RouteHopDecodeErrorZ
1242 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
1244 * A pointer to the contents in the success state.
1245 * Reading from this pointer when `result_ok` is not set is undefined.
1247 struct LDKRouteHop *result;
1249 * A pointer to the contents in the error state.
1250 * Reading from this pointer when `result_ok` is set is undefined.
1252 struct LDKDecodeError *err;
1253 } LDKCResult_RouteHopDecodeErrorZPtr;
1256 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
1257 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
1258 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1260 typedef struct LDKCResult_RouteHopDecodeErrorZ {
1262 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
1263 * `err` or `result` depending on the state of `result_ok`.
1265 union LDKCResult_RouteHopDecodeErrorZPtr contents;
1267 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
1270 } LDKCResult_RouteHopDecodeErrorZ;
1273 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
1274 * This corresponds to std::vector in C++
1276 typedef struct LDKCVec_RouteHopZ {
1278 * The elements in the array.
1279 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1281 struct LDKRouteHop *data;
1283 * The number of elements pointed to by `data`.
1286 } LDKCVec_RouteHopZ;
1289 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
1290 * This corresponds to std::vector in C++
1292 typedef struct LDKCVec_CVec_RouteHopZZ {
1294 * The elements in the array.
1295 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1297 struct LDKCVec_RouteHopZ *data;
1299 * The number of elements pointed to by `data`.
1302 } LDKCVec_CVec_RouteHopZZ;
1307 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
1308 * it can take multiple paths. Each path is composed of one or more hops through the network.
1310 typedef struct MUST_USE_STRUCT LDKRoute {
1312 * A pointer to the opaque Rust object.
1313 * Nearly everywhere, inner must be non-null, however in places where
1314 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1316 LDKnativeRoute *inner;
1318 * Indicates that this is the only struct which contains the same pointer.
1319 * Rust functions which take ownership of an object provided via an argument require
1320 * this to be true and invalidate the object pointed to by inner.
1326 * The contents of CResult_RouteDecodeErrorZ
1328 typedef union LDKCResult_RouteDecodeErrorZPtr {
1330 * A pointer to the contents in the success state.
1331 * Reading from this pointer when `result_ok` is not set is undefined.
1333 struct LDKRoute *result;
1335 * A pointer to the contents in the error state.
1336 * Reading from this pointer when `result_ok` is set is undefined.
1338 struct LDKDecodeError *err;
1339 } LDKCResult_RouteDecodeErrorZPtr;
1342 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
1343 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
1344 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1346 typedef struct LDKCResult_RouteDecodeErrorZ {
1348 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
1349 * `err` or `result` depending on the state of `result_ok`.
1351 union LDKCResult_RouteDecodeErrorZPtr contents;
1353 * Whether this CResult_RouteDecodeErrorZ represents a success state.
1356 } LDKCResult_RouteDecodeErrorZ;
1359 * An enum which can either contain a u64 or not
1361 typedef enum LDKCOption_u64Z_Tag {
1363 * When we're in this state, this COption_u64Z contains a u64
1365 LDKCOption_u64Z_Some,
1367 * When we're in this state, this COption_u64Z contains nothing
1369 LDKCOption_u64Z_None,
1371 * Must be last for serialization purposes
1373 LDKCOption_u64Z_Sentinel,
1374 } LDKCOption_u64Z_Tag;
1376 typedef struct LDKCOption_u64Z {
1377 LDKCOption_u64Z_Tag tag;
1388 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
1390 typedef struct MUST_USE_STRUCT LDKChannelDetails {
1392 * A pointer to the opaque Rust object.
1393 * Nearly everywhere, inner must be non-null, however in places where
1394 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1396 LDKnativeChannelDetails *inner;
1398 * Indicates that this is the only struct which contains the same pointer.
1399 * Rust functions which take ownership of an object provided via an argument require
1400 * this to be true and invalidate the object pointed to by inner.
1403 } LDKChannelDetails;
1406 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
1407 * This corresponds to std::vector in C++
1409 typedef struct LDKCVec_ChannelDetailsZ {
1411 * The elements in the array.
1412 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1414 struct LDKChannelDetails *data;
1416 * The number of elements pointed to by `data`.
1419 } LDKCVec_ChannelDetailsZ;
1424 * A list of hops along a payment path terminating with a channel to the recipient.
1426 typedef struct MUST_USE_STRUCT LDKRouteHint {
1428 * A pointer to the opaque Rust object.
1429 * Nearly everywhere, inner must be non-null, however in places where
1430 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1432 LDKnativeRouteHint *inner;
1434 * Indicates that this is the only struct which contains the same pointer.
1435 * Rust functions which take ownership of an object provided via an argument require
1436 * this to be true and invalidate the object pointed to by inner.
1442 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
1443 * This corresponds to std::vector in C++
1445 typedef struct LDKCVec_RouteHintZ {
1447 * The elements in the array.
1448 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1450 struct LDKRouteHint *data;
1452 * The number of elements pointed to by `data`.
1455 } LDKCVec_RouteHintZ;
1460 * An Err type for failure to process messages.
1462 typedef struct MUST_USE_STRUCT LDKLightningError {
1464 * A pointer to the opaque Rust object.
1465 * Nearly everywhere, inner must be non-null, however in places where
1466 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1468 LDKnativeLightningError *inner;
1470 * Indicates that this is the only struct which contains the same pointer.
1471 * Rust functions which take ownership of an object provided via an argument require
1472 * this to be true and invalidate the object pointed to by inner.
1475 } LDKLightningError;
1478 * The contents of CResult_RouteLightningErrorZ
1480 typedef union LDKCResult_RouteLightningErrorZPtr {
1482 * A pointer to the contents in the success state.
1483 * Reading from this pointer when `result_ok` is not set is undefined.
1485 struct LDKRoute *result;
1487 * A pointer to the contents in the error state.
1488 * Reading from this pointer when `result_ok` is set is undefined.
1490 struct LDKLightningError *err;
1491 } LDKCResult_RouteLightningErrorZPtr;
1494 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
1495 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
1496 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1498 typedef struct LDKCResult_RouteLightningErrorZ {
1500 * The contents of this CResult_RouteLightningErrorZ, accessible via either
1501 * `err` or `result` depending on the state of `result_ok`.
1503 union LDKCResult_RouteLightningErrorZPtr contents;
1505 * Whether this CResult_RouteLightningErrorZ represents a success state.
1508 } LDKCResult_RouteLightningErrorZ;
1511 * The contents of CResult_TxOutAccessErrorZ
1513 typedef union LDKCResult_TxOutAccessErrorZPtr {
1515 * A pointer to the contents in the success state.
1516 * Reading from this pointer when `result_ok` is not set is undefined.
1518 struct LDKTxOut *result;
1520 * A pointer to the contents in the error state.
1521 * Reading from this pointer when `result_ok` is set is undefined.
1523 enum LDKAccessError *err;
1524 } LDKCResult_TxOutAccessErrorZPtr;
1527 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
1528 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
1529 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1531 typedef struct LDKCResult_TxOutAccessErrorZ {
1533 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
1534 * `err` or `result` depending on the state of `result_ok`.
1536 union LDKCResult_TxOutAccessErrorZPtr contents;
1538 * Whether this CResult_TxOutAccessErrorZ represents a success state.
1541 } LDKCResult_TxOutAccessErrorZ;
1544 * A tuple of 2 elements. See the individual fields for the types contained.
1546 typedef struct LDKC2Tuple_usizeTransactionZ {
1548 * The element at position 0
1552 * The element at position 1
1554 struct LDKTransaction b;
1555 } LDKC2Tuple_usizeTransactionZ;
1558 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
1559 * This corresponds to std::vector in C++
1561 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
1563 * The elements in the array.
1564 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1566 struct LDKC2Tuple_usizeTransactionZ *data;
1568 * The number of elements pointed to by `data`.
1571 } LDKCVec_C2Tuple_usizeTransactionZZ;
1574 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
1575 * look up the corresponding function in rust-lightning's docs.
1577 typedef struct LDKThirtyTwoBytes {
1579 * The thirty-two bytes
1582 } LDKThirtyTwoBytes;
1585 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
1586 * This corresponds to std::vector in C++
1588 typedef struct LDKCVec_TxidZ {
1590 * The elements in the array.
1591 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1593 struct LDKThirtyTwoBytes *data;
1595 * The number of elements pointed to by `data`.
1601 * The contents of CResult_NoneChannelMonitorUpdateErrZ
1603 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
1605 * Note that this value is always NULL, as there are no contents in the OK variant
1609 * A pointer to the contents in the error state.
1610 * Reading from this pointer when `result_ok` is set is undefined.
1612 enum LDKChannelMonitorUpdateErr *err;
1613 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
1616 * A CResult_NoneChannelMonitorUpdateErrZ represents the result of a fallible operation,
1617 * containing a () on success and a crate::lightning::chain::channelmonitor::ChannelMonitorUpdateErr on failure.
1618 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1620 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
1622 * The contents of this CResult_NoneChannelMonitorUpdateErrZ, accessible via either
1623 * `err` or `result` depending on the state of `result_ok`.
1625 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
1627 * Whether this CResult_NoneChannelMonitorUpdateErrZ represents a success state.
1630 } LDKCResult_NoneChannelMonitorUpdateErrZ;
1635 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
1636 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
1637 * preimage claim backward will lead to loss of funds.
1639 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
1641 * A pointer to the opaque Rust object.
1642 * Nearly everywhere, inner must be non-null, however in places where
1643 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1645 LDKnativeHTLCUpdate *inner;
1647 * Indicates that this is the only struct which contains the same pointer.
1648 * Rust functions which take ownership of an object provided via an argument require
1649 * this to be true and invalidate the object pointed to by inner.
1657 * A reference to a transaction output.
1659 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
1660 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
1662 typedef struct MUST_USE_STRUCT LDKOutPoint {
1664 * A pointer to the opaque Rust object.
1665 * Nearly everywhere, inner must be non-null, however in places where
1666 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1668 LDKnativeOutPoint *inner;
1670 * Indicates that this is the only struct which contains the same pointer.
1671 * Rust functions which take ownership of an object provided via an argument require
1672 * this to be true and invalidate the object pointed to by inner.
1678 * An event to be processed by the ChannelManager.
1680 typedef enum LDKMonitorEvent_Tag {
1682 * A monitor event containing an HTLCUpdate.
1684 LDKMonitorEvent_HTLCEvent,
1686 * A monitor event that the Channel's commitment transaction was broadcasted.
1688 LDKMonitorEvent_CommitmentTxBroadcasted,
1690 * Must be last for serialization purposes
1692 LDKMonitorEvent_Sentinel,
1693 } LDKMonitorEvent_Tag;
1695 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
1696 LDKMonitorEvent_Tag tag;
1699 struct LDKHTLCUpdate htlc_event;
1702 struct LDKOutPoint commitment_tx_broadcasted;
1708 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
1709 * This corresponds to std::vector in C++
1711 typedef struct LDKCVec_MonitorEventZ {
1713 * The elements in the array.
1714 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1716 struct LDKMonitorEvent *data;
1718 * The number of elements pointed to by `data`.
1721 } LDKCVec_MonitorEventZ;
1724 * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not
1726 typedef enum LDKCOption_C2Tuple_usizeTransactionZZ_Tag {
1728 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ
1730 LDKCOption_C2Tuple_usizeTransactionZZ_Some,
1732 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing
1734 LDKCOption_C2Tuple_usizeTransactionZZ_None,
1736 * Must be last for serialization purposes
1738 LDKCOption_C2Tuple_usizeTransactionZZ_Sentinel,
1739 } LDKCOption_C2Tuple_usizeTransactionZZ_Tag;
1741 typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
1742 LDKCOption_C2Tuple_usizeTransactionZZ_Tag tag;
1745 struct LDKC2Tuple_usizeTransactionZ some;
1748 } LDKCOption_C2Tuple_usizeTransactionZZ;
1753 * Information about a spendable output to a P2WSH script. See
1754 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
1756 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
1758 * A pointer to the opaque Rust object.
1759 * Nearly everywhere, inner must be non-null, however in places where
1760 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1762 LDKnativeDelayedPaymentOutputDescriptor *inner;
1764 * Indicates that this is the only struct which contains the same pointer.
1765 * Rust functions which take ownership of an object provided via an argument require
1766 * this to be true and invalidate the object pointed to by inner.
1769 } LDKDelayedPaymentOutputDescriptor;
1774 * Information about a spendable output to our \"payment key\". See
1775 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
1777 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
1779 * A pointer to the opaque Rust object.
1780 * Nearly everywhere, inner must be non-null, however in places where
1781 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1783 LDKnativeStaticPaymentOutputDescriptor *inner;
1785 * Indicates that this is the only struct which contains the same pointer.
1786 * Rust functions which take ownership of an object provided via an argument require
1787 * this to be true and invalidate the object pointed to by inner.
1790 } LDKStaticPaymentOutputDescriptor;
1793 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
1794 * claim at any point in the future) an event is generated which you must track and be able to
1795 * spend on-chain. The information needed to do this is provided in this enum, including the
1796 * outpoint describing which txid and output index is available, the full output which exists at
1797 * that txid/index, and any keys or other information required to sign.
1799 typedef enum LDKSpendableOutputDescriptor_Tag {
1801 * An output to a script which was provided via KeysInterface directly, either from
1802 * `get_destination_script()` or `get_shutdown_pubkey()`, thus you should already know how to
1803 * spend it. No secret keys are provided as rust-lightning was never given any key.
1804 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
1805 * on-chain using the payment preimage or after it has timed out.
1807 LDKSpendableOutputDescriptor_StaticOutput,
1809 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
1811 * The witness in the spending input should be:
1812 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
1814 * Note that the nSequence field in the spending input must be set to to_self_delay
1815 * (which means the transaction is not broadcastable until at least to_self_delay
1816 * blocks after the outpoint confirms).
1818 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
1819 * it is an output from an old state which we broadcast (which should never happen).
1821 * To derive the delayed_payment key which is used to sign for this input, you must pass the
1822 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
1823 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
1824 * chan_utils::derive_private_key. The public key can be generated without the secret key
1825 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
1828 * To derive the revocation_pubkey provided here (which is used in the witness
1829 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
1830 * call to Sign::ready_channel) and the provided per_commitment point
1831 * to chan_utils::derive_public_revocation_key.
1833 * The witness script which is hashed and included in the output script_pubkey may be
1834 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
1835 * (derived as above), and the to_self_delay contained here to
1836 * chan_utils::get_revokeable_redeemscript.
1838 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
1840 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
1841 * corresponds to the public key in Sign::pubkeys().payment_point).
1842 * The witness in the spending input, is, thus, simply:
1843 * <BIP 143 signature> <payment key>
1845 * These are generally the result of our counterparty having broadcast the current state,
1846 * allowing us to claim the non-HTLC-encumbered outputs immediately.
1848 LDKSpendableOutputDescriptor_StaticPaymentOutput,
1850 * Must be last for serialization purposes
1852 LDKSpendableOutputDescriptor_Sentinel,
1853 } LDKSpendableOutputDescriptor_Tag;
1855 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
1857 * The outpoint which is spendable
1859 struct LDKOutPoint outpoint;
1861 * The output which is referenced by the given outpoint.
1863 struct LDKTxOut output;
1864 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
1866 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
1867 LDKSpendableOutputDescriptor_Tag tag;
1869 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
1871 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
1874 struct LDKStaticPaymentOutputDescriptor static_payment_output;
1877 } LDKSpendableOutputDescriptor;
1880 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
1881 * This corresponds to std::vector in C++
1883 typedef struct LDKCVec_SpendableOutputDescriptorZ {
1885 * The elements in the array.
1886 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1888 struct LDKSpendableOutputDescriptor *data;
1890 * The number of elements pointed to by `data`.
1893 } LDKCVec_SpendableOutputDescriptorZ;
1898 * An accept_channel message to be sent or received from a peer
1900 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
1902 * A pointer to the opaque Rust object.
1903 * Nearly everywhere, inner must be non-null, however in places where
1904 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1906 LDKnativeAcceptChannel *inner;
1908 * Indicates that this is the only struct which contains the same pointer.
1909 * Rust functions which take ownership of an object provided via an argument require
1910 * this to be true and invalidate the object pointed to by inner.
1918 * An open_channel message to be sent or received from a peer
1920 typedef struct MUST_USE_STRUCT LDKOpenChannel {
1922 * A pointer to the opaque Rust object.
1923 * Nearly everywhere, inner must be non-null, however in places where
1924 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1926 LDKnativeOpenChannel *inner;
1928 * Indicates that this is the only struct which contains the same pointer.
1929 * Rust functions which take ownership of an object provided via an argument require
1930 * this to be true and invalidate the object pointed to by inner.
1938 * A funding_created message to be sent or received from a peer
1940 typedef struct MUST_USE_STRUCT LDKFundingCreated {
1942 * A pointer to the opaque Rust object.
1943 * Nearly everywhere, inner must be non-null, however in places where
1944 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1946 LDKnativeFundingCreated *inner;
1948 * Indicates that this is the only struct which contains the same pointer.
1949 * Rust functions which take ownership of an object provided via an argument require
1950 * this to be true and invalidate the object pointed to by inner.
1953 } LDKFundingCreated;
1958 * A funding_signed message to be sent or received from a peer
1960 typedef struct MUST_USE_STRUCT LDKFundingSigned {
1962 * A pointer to the opaque Rust object.
1963 * Nearly everywhere, inner must be non-null, however in places where
1964 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1966 LDKnativeFundingSigned *inner;
1968 * Indicates that this is the only struct which contains the same pointer.
1969 * Rust functions which take ownership of an object provided via an argument require
1970 * this to be true and invalidate the object pointed to by inner.
1978 * A funding_locked message to be sent or received from a peer
1980 typedef struct MUST_USE_STRUCT LDKFundingLocked {
1982 * A pointer to the opaque Rust object.
1983 * Nearly everywhere, inner must be non-null, however in places where
1984 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1986 LDKnativeFundingLocked *inner;
1988 * Indicates that this is the only struct which contains the same pointer.
1989 * Rust functions which take ownership of an object provided via an argument require
1990 * this to be true and invalidate the object pointed to by inner.
1998 * An announcement_signatures message to be sent or received from a peer
2000 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
2002 * A pointer to the opaque Rust object.
2003 * Nearly everywhere, inner must be non-null, however in places where
2004 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2006 LDKnativeAnnouncementSignatures *inner;
2008 * Indicates that this is the only struct which contains the same pointer.
2009 * Rust functions which take ownership of an object provided via an argument require
2010 * this to be true and invalidate the object pointed to by inner.
2013 } LDKAnnouncementSignatures;
2018 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
2019 * transaction updates if they were pending.
2021 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
2023 * A pointer to the opaque Rust object.
2024 * Nearly everywhere, inner must be non-null, however in places where
2025 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2027 LDKnativeCommitmentUpdate *inner;
2029 * Indicates that this is the only struct which contains the same pointer.
2030 * Rust functions which take ownership of an object provided via an argument require
2031 * this to be true and invalidate the object pointed to by inner.
2034 } LDKCommitmentUpdate;
2039 * A revoke_and_ack message to be sent or received from a peer
2041 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
2043 * A pointer to the opaque Rust object.
2044 * Nearly everywhere, inner must be non-null, however in places where
2045 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2047 LDKnativeRevokeAndACK *inner;
2049 * Indicates that this is the only struct which contains the same pointer.
2050 * Rust functions which take ownership of an object provided via an argument require
2051 * this to be true and invalidate the object pointed to by inner.
2059 * A closing_signed message to be sent or received from a peer
2061 typedef struct MUST_USE_STRUCT LDKClosingSigned {
2063 * A pointer to the opaque Rust object.
2064 * Nearly everywhere, inner must be non-null, however in places where
2065 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2067 LDKnativeClosingSigned *inner;
2069 * Indicates that this is the only struct which contains the same pointer.
2070 * Rust functions which take ownership of an object provided via an argument require
2071 * this to be true and invalidate the object pointed to by inner.
2079 * A shutdown message to be sent or received from a peer
2081 typedef struct MUST_USE_STRUCT LDKShutdown {
2083 * A pointer to the opaque Rust object.
2084 * Nearly everywhere, inner must be non-null, however in places where
2085 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2087 LDKnativeShutdown *inner;
2089 * Indicates that this is the only struct which contains the same pointer.
2090 * Rust functions which take ownership of an object provided via an argument require
2091 * this to be true and invalidate the object pointed to by inner.
2099 * A channel_reestablish message to be sent or received from a peer
2101 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
2103 * A pointer to the opaque Rust object.
2104 * Nearly everywhere, inner must be non-null, however in places where
2105 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2107 LDKnativeChannelReestablish *inner;
2109 * Indicates that this is the only struct which contains the same pointer.
2110 * Rust functions which take ownership of an object provided via an argument require
2111 * this to be true and invalidate the object pointed to by inner.
2114 } LDKChannelReestablish;
2119 * A channel_announcement message to be sent or received from a peer
2121 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
2123 * A pointer to the opaque Rust object.
2124 * Nearly everywhere, inner must be non-null, however in places where
2125 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2127 LDKnativeChannelAnnouncement *inner;
2129 * Indicates that this is the only struct which contains the same pointer.
2130 * Rust functions which take ownership of an object provided via an argument require
2131 * this to be true and invalidate the object pointed to by inner.
2134 } LDKChannelAnnouncement;
2139 * A channel_update message to be sent or received from a peer
2141 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
2143 * A pointer to the opaque Rust object.
2144 * Nearly everywhere, inner must be non-null, however in places where
2145 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2147 LDKnativeChannelUpdate *inner;
2149 * Indicates that this is the only struct which contains the same pointer.
2150 * Rust functions which take ownership of an object provided via an argument require
2151 * this to be true and invalidate the object pointed to by inner.
2159 * A node_announcement message to be sent or received from a peer
2161 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
2163 * A pointer to the opaque Rust object.
2164 * Nearly everywhere, inner must be non-null, however in places where
2165 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2167 LDKnativeNodeAnnouncement *inner;
2169 * Indicates that this is the only struct which contains the same pointer.
2170 * Rust functions which take ownership of an object provided via an argument require
2171 * this to be true and invalidate the object pointed to by inner.
2174 } LDKNodeAnnouncement;
2179 * An error message to be sent or received from a peer
2181 typedef struct MUST_USE_STRUCT LDKErrorMessage {
2183 * A pointer to the opaque Rust object.
2184 * Nearly everywhere, inner must be non-null, however in places where
2185 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2187 LDKnativeErrorMessage *inner;
2189 * Indicates that this is the only struct which contains the same pointer.
2190 * Rust functions which take ownership of an object provided via an argument require
2191 * this to be true and invalidate the object pointed to by inner.
2197 * Used to put an error message in a LightningError
2199 typedef enum LDKErrorAction_Tag {
2201 * The peer took some action which made us think they were useless. Disconnect them.
2203 LDKErrorAction_DisconnectPeer,
2205 * The peer did something harmless that we weren't able to process, just log and ignore
2207 LDKErrorAction_IgnoreError,
2209 * The peer did something harmless that we weren't able to meaningfully process.
2210 * If the error is logged, log it at the given level.
2212 LDKErrorAction_IgnoreAndLog,
2214 * The peer did something incorrect. Tell them.
2216 LDKErrorAction_SendErrorMessage,
2218 * Must be last for serialization purposes
2220 LDKErrorAction_Sentinel,
2221 } LDKErrorAction_Tag;
2223 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
2225 * An error message which we should make an effort to send before we disconnect.
2227 struct LDKErrorMessage msg;
2228 } LDKErrorAction_LDKDisconnectPeer_Body;
2230 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
2232 * The message to send.
2234 struct LDKErrorMessage msg;
2235 } LDKErrorAction_LDKSendErrorMessage_Body;
2237 typedef struct MUST_USE_STRUCT LDKErrorAction {
2238 LDKErrorAction_Tag tag;
2240 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
2242 enum LDKLevel ignore_and_log;
2244 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
2249 * The information we received from a peer along the route of a payment we originated. This is
2250 * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
2251 * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
2253 typedef enum LDKHTLCFailChannelUpdate_Tag {
2255 * We received an error which included a full ChannelUpdate message.
2257 LDKHTLCFailChannelUpdate_ChannelUpdateMessage,
2259 * We received an error which indicated only that a channel has been closed
2261 LDKHTLCFailChannelUpdate_ChannelClosed,
2263 * We received an error which indicated only that a node has failed
2265 LDKHTLCFailChannelUpdate_NodeFailure,
2267 * Must be last for serialization purposes
2269 LDKHTLCFailChannelUpdate_Sentinel,
2270 } LDKHTLCFailChannelUpdate_Tag;
2272 typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
2274 * The unwrapped message we received
2276 struct LDKChannelUpdate msg;
2277 } LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
2279 typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
2281 * The short_channel_id which has now closed.
2283 uint64_t short_channel_id;
2285 * when this true, this channel should be permanently removed from the
2286 * consideration. Otherwise, this channel can be restored as new channel_update is received
2289 } LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
2291 typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
2293 * The node_id that has failed.
2295 struct LDKPublicKey node_id;
2297 * when this true, node should be permanently removed from the
2298 * consideration. Otherwise, the channels connected to this node can be
2299 * restored as new channel_update is received
2302 } LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
2304 typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
2305 LDKHTLCFailChannelUpdate_Tag tag;
2307 LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
2308 LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
2309 LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
2311 } LDKHTLCFailChannelUpdate;
2316 * A query_channel_range message is used to query a peer for channel
2317 * UTXOs in a range of blocks. The recipient of a query makes a best
2318 * effort to reply to the query using one or more reply_channel_range
2321 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
2323 * A pointer to the opaque Rust object.
2324 * Nearly everywhere, inner must be non-null, however in places where
2325 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2327 LDKnativeQueryChannelRange *inner;
2329 * Indicates that this is the only struct which contains the same pointer.
2330 * Rust functions which take ownership of an object provided via an argument require
2331 * this to be true and invalidate the object pointed to by inner.
2334 } LDKQueryChannelRange;
2339 * A query_short_channel_ids message is used to query a peer for
2340 * routing gossip messages related to one or more short_channel_ids.
2341 * The query recipient will reply with the latest, if available,
2342 * channel_announcement, channel_update and node_announcement messages
2343 * it maintains for the requested short_channel_ids followed by a
2344 * reply_short_channel_ids_end message. The short_channel_ids sent in
2345 * this query are encoded. We only support encoding_type=0 uncompressed
2346 * serialization and do not support encoding_type=1 zlib serialization.
2348 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
2350 * A pointer to the opaque Rust object.
2351 * Nearly everywhere, inner must be non-null, however in places where
2352 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2354 LDKnativeQueryShortChannelIds *inner;
2356 * Indicates that this is the only struct which contains the same pointer.
2357 * Rust functions which take ownership of an object provided via an argument require
2358 * this to be true and invalidate the object pointed to by inner.
2361 } LDKQueryShortChannelIds;
2366 * A reply_channel_range message is a reply to a query_channel_range
2367 * message. Multiple reply_channel_range messages can be sent in reply
2368 * to a single query_channel_range message. The query recipient makes a
2369 * best effort to respond based on their local network view which may
2370 * not be a perfect view of the network. The short_channel_ids in the
2371 * reply are encoded. We only support encoding_type=0 uncompressed
2372 * serialization and do not support encoding_type=1 zlib serialization.
2374 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
2376 * A pointer to the opaque Rust object.
2377 * Nearly everywhere, inner must be non-null, however in places where
2378 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2380 LDKnativeReplyChannelRange *inner;
2382 * Indicates that this is the only struct which contains the same pointer.
2383 * Rust functions which take ownership of an object provided via an argument require
2384 * this to be true and invalidate the object pointed to by inner.
2387 } LDKReplyChannelRange;
2390 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
2391 * broadcast to most peers).
2392 * These events are handled by PeerManager::process_events if you are using a PeerManager.
2394 typedef enum LDKMessageSendEvent_Tag {
2396 * Used to indicate that we've accepted a channel open and should send the accept_channel
2397 * message provided to the given peer.
2399 LDKMessageSendEvent_SendAcceptChannel,
2401 * Used to indicate that we've initiated a channel open and should send the open_channel
2402 * message provided to the given peer.
2404 LDKMessageSendEvent_SendOpenChannel,
2406 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
2408 LDKMessageSendEvent_SendFundingCreated,
2410 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
2412 LDKMessageSendEvent_SendFundingSigned,
2414 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
2416 LDKMessageSendEvent_SendFundingLocked,
2418 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
2420 LDKMessageSendEvent_SendAnnouncementSignatures,
2422 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
2423 * message should be sent to the peer with the given node_id.
2425 LDKMessageSendEvent_UpdateHTLCs,
2427 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
2429 LDKMessageSendEvent_SendRevokeAndACK,
2431 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
2433 LDKMessageSendEvent_SendClosingSigned,
2435 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
2437 LDKMessageSendEvent_SendShutdown,
2439 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
2441 LDKMessageSendEvent_SendChannelReestablish,
2443 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
2444 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
2446 * Note that after doing so, you very likely (unless you did so very recently) want to call
2447 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
2448 * This ensures that any nodes which see our channel_announcement also have a relevant
2449 * node_announcement, including relevant feature flags which may be important for routing
2452 LDKMessageSendEvent_BroadcastChannelAnnouncement,
2454 * Used to indicate that a node_announcement should be broadcast to all peers.
2456 LDKMessageSendEvent_BroadcastNodeAnnouncement,
2458 * Used to indicate that a channel_update should be broadcast to all peers.
2460 LDKMessageSendEvent_BroadcastChannelUpdate,
2462 * Used to indicate that a channel_update should be sent to a single peer.
2463 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
2464 * private channel and we shouldn't be informing all of our peers of channel parameters.
2466 LDKMessageSendEvent_SendChannelUpdate,
2468 * Broadcast an error downstream to be handled
2470 LDKMessageSendEvent_HandleError,
2472 * When a payment fails we may receive updates back from the hop where it failed. In such
2473 * cases this event is generated so that we can inform the network graph of this information.
2475 LDKMessageSendEvent_PaymentFailureNetworkUpdate,
2477 * Query a peer for channels with funding transaction UTXOs in a block range.
2479 LDKMessageSendEvent_SendChannelRangeQuery,
2481 * Request routing gossip messages from a peer for a list of channels identified by
2482 * their short_channel_ids.
2484 LDKMessageSendEvent_SendShortIdsQuery,
2486 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
2487 * emitted during processing of the query.
2489 LDKMessageSendEvent_SendReplyChannelRange,
2491 * Must be last for serialization purposes
2493 LDKMessageSendEvent_Sentinel,
2494 } LDKMessageSendEvent_Tag;
2496 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
2498 * The node_id of the node which should receive this message
2500 struct LDKPublicKey node_id;
2502 * The message which should be sent.
2504 struct LDKAcceptChannel msg;
2505 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
2507 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
2509 * The node_id of the node which should receive this message
2511 struct LDKPublicKey node_id;
2513 * The message which should be sent.
2515 struct LDKOpenChannel msg;
2516 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
2518 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
2520 * The node_id of the node which should receive this message
2522 struct LDKPublicKey node_id;
2524 * The message which should be sent.
2526 struct LDKFundingCreated msg;
2527 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
2529 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
2531 * The node_id of the node which should receive this message
2533 struct LDKPublicKey node_id;
2535 * The message which should be sent.
2537 struct LDKFundingSigned msg;
2538 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
2540 typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
2542 * The node_id of the node which should receive these message(s)
2544 struct LDKPublicKey node_id;
2546 * The funding_locked message which should be sent.
2548 struct LDKFundingLocked msg;
2549 } LDKMessageSendEvent_LDKSendFundingLocked_Body;
2551 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
2553 * The node_id of the node which should receive these message(s)
2555 struct LDKPublicKey node_id;
2557 * The announcement_signatures message which should be sent.
2559 struct LDKAnnouncementSignatures msg;
2560 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
2562 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
2564 * The node_id of the node which should receive these message(s)
2566 struct LDKPublicKey node_id;
2568 * The update messages which should be sent. ALL messages in the struct should be sent!
2570 struct LDKCommitmentUpdate updates;
2571 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
2573 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
2575 * The node_id of the node which should receive this message
2577 struct LDKPublicKey node_id;
2579 * The message which should be sent.
2581 struct LDKRevokeAndACK msg;
2582 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
2584 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
2586 * The node_id of the node which should receive this message
2588 struct LDKPublicKey node_id;
2590 * The message which should be sent.
2592 struct LDKClosingSigned msg;
2593 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
2595 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
2597 * The node_id of the node which should receive this message
2599 struct LDKPublicKey node_id;
2601 * The message which should be sent.
2603 struct LDKShutdown msg;
2604 } LDKMessageSendEvent_LDKSendShutdown_Body;
2606 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
2608 * The node_id of the node which should receive this message
2610 struct LDKPublicKey node_id;
2612 * The message which should be sent.
2614 struct LDKChannelReestablish msg;
2615 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
2617 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
2619 * The channel_announcement which should be sent.
2621 struct LDKChannelAnnouncement msg;
2623 * The followup channel_update which should be sent.
2625 struct LDKChannelUpdate update_msg;
2626 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
2628 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
2630 * The node_announcement which should be sent.
2632 struct LDKNodeAnnouncement msg;
2633 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
2635 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
2637 * The channel_update which should be sent.
2639 struct LDKChannelUpdate msg;
2640 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
2642 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
2644 * The node_id of the node which should receive this message
2646 struct LDKPublicKey node_id;
2648 * The channel_update which should be sent.
2650 struct LDKChannelUpdate msg;
2651 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
2653 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
2655 * The node_id of the node which should receive this message
2657 struct LDKPublicKey node_id;
2659 * The action which should be taken.
2661 struct LDKErrorAction action;
2662 } LDKMessageSendEvent_LDKHandleError_Body;
2664 typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
2666 * The channel/node update which should be sent to NetGraphMsgHandler
2668 struct LDKHTLCFailChannelUpdate update;
2669 } LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
2671 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
2673 * The node_id of this message recipient
2675 struct LDKPublicKey node_id;
2677 * The query_channel_range which should be sent.
2679 struct LDKQueryChannelRange msg;
2680 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
2682 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
2684 * The node_id of this message recipient
2686 struct LDKPublicKey node_id;
2688 * The query_short_channel_ids which should be sent.
2690 struct LDKQueryShortChannelIds msg;
2691 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
2693 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
2695 * The node_id of this message recipient
2697 struct LDKPublicKey node_id;
2699 * The reply_channel_range which should be sent.
2701 struct LDKReplyChannelRange msg;
2702 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
2704 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
2705 LDKMessageSendEvent_Tag tag;
2707 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
2708 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
2709 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
2710 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
2711 LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
2712 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
2713 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
2714 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
2715 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
2716 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
2717 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
2718 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
2719 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
2720 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
2721 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
2722 LDKMessageSendEvent_LDKHandleError_Body handle_error;
2723 LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
2724 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
2725 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
2726 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
2728 } LDKMessageSendEvent;
2731 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
2732 * This corresponds to std::vector in C++
2734 typedef struct LDKCVec_MessageSendEventZ {
2736 * The elements in the array.
2737 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2739 struct LDKMessageSendEvent *data;
2741 * The number of elements pointed to by `data`.
2744 } LDKCVec_MessageSendEventZ;
2749 * Features used within an `init` message.
2751 typedef struct MUST_USE_STRUCT LDKInitFeatures {
2753 * A pointer to the opaque Rust object.
2754 * Nearly everywhere, inner must be non-null, however in places where
2755 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2757 LDKnativeInitFeatures *inner;
2759 * Indicates that this is the only struct which contains the same pointer.
2760 * Rust functions which take ownership of an object provided via an argument require
2761 * this to be true and invalidate the object pointed to by inner.
2767 * The contents of CResult_InitFeaturesDecodeErrorZ
2769 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
2771 * A pointer to the contents in the success state.
2772 * Reading from this pointer when `result_ok` is not set is undefined.
2774 struct LDKInitFeatures *result;
2776 * A pointer to the contents in the error state.
2777 * Reading from this pointer when `result_ok` is set is undefined.
2779 struct LDKDecodeError *err;
2780 } LDKCResult_InitFeaturesDecodeErrorZPtr;
2783 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
2784 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
2785 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2787 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
2789 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
2790 * `err` or `result` depending on the state of `result_ok`.
2792 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
2794 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
2797 } LDKCResult_InitFeaturesDecodeErrorZ;
2802 * Features used within a `node_announcement` message.
2804 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
2806 * A pointer to the opaque Rust object.
2807 * Nearly everywhere, inner must be non-null, however in places where
2808 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2810 LDKnativeNodeFeatures *inner;
2812 * Indicates that this is the only struct which contains the same pointer.
2813 * Rust functions which take ownership of an object provided via an argument require
2814 * this to be true and invalidate the object pointed to by inner.
2820 * The contents of CResult_NodeFeaturesDecodeErrorZ
2822 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
2824 * A pointer to the contents in the success state.
2825 * Reading from this pointer when `result_ok` is not set is undefined.
2827 struct LDKNodeFeatures *result;
2829 * A pointer to the contents in the error state.
2830 * Reading from this pointer when `result_ok` is set is undefined.
2832 struct LDKDecodeError *err;
2833 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
2836 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
2837 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
2838 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2840 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
2842 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
2843 * `err` or `result` depending on the state of `result_ok`.
2845 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
2847 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
2850 } LDKCResult_NodeFeaturesDecodeErrorZ;
2855 * Features used within a `channel_announcement` message.
2857 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
2859 * A pointer to the opaque Rust object.
2860 * Nearly everywhere, inner must be non-null, however in places where
2861 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2863 LDKnativeChannelFeatures *inner;
2865 * Indicates that this is the only struct which contains the same pointer.
2866 * Rust functions which take ownership of an object provided via an argument require
2867 * this to be true and invalidate the object pointed to by inner.
2870 } LDKChannelFeatures;
2873 * The contents of CResult_ChannelFeaturesDecodeErrorZ
2875 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
2877 * A pointer to the contents in the success state.
2878 * Reading from this pointer when `result_ok` is not set is undefined.
2880 struct LDKChannelFeatures *result;
2882 * A pointer to the contents in the error state.
2883 * Reading from this pointer when `result_ok` is set is undefined.
2885 struct LDKDecodeError *err;
2886 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
2889 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
2890 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
2891 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2893 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
2895 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
2896 * `err` or `result` depending on the state of `result_ok`.
2898 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
2900 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
2903 } LDKCResult_ChannelFeaturesDecodeErrorZ;
2908 * Features used within an invoice.
2910 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
2912 * A pointer to the opaque Rust object.
2913 * Nearly everywhere, inner must be non-null, however in places where
2914 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2916 LDKnativeInvoiceFeatures *inner;
2918 * Indicates that this is the only struct which contains the same pointer.
2919 * Rust functions which take ownership of an object provided via an argument require
2920 * this to be true and invalidate the object pointed to by inner.
2923 } LDKInvoiceFeatures;
2926 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
2928 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
2930 * A pointer to the contents in the success state.
2931 * Reading from this pointer when `result_ok` is not set is undefined.
2933 struct LDKInvoiceFeatures *result;
2935 * A pointer to the contents in the error state.
2936 * Reading from this pointer when `result_ok` is set is undefined.
2938 struct LDKDecodeError *err;
2939 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
2942 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
2943 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
2944 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2946 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
2948 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
2949 * `err` or `result` depending on the state of `result_ok`.
2951 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
2953 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
2956 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
2959 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
2961 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
2963 * A pointer to the contents in the success state.
2964 * Reading from this pointer when `result_ok` is not set is undefined.
2966 struct LDKDelayedPaymentOutputDescriptor *result;
2968 * A pointer to the contents in the error state.
2969 * Reading from this pointer when `result_ok` is set is undefined.
2971 struct LDKDecodeError *err;
2972 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
2975 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2976 * containing a crate::lightning::chain::keysinterface::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2977 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2979 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
2981 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
2982 * `err` or `result` depending on the state of `result_ok`.
2984 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
2986 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
2989 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
2992 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
2994 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
2996 * A pointer to the contents in the success state.
2997 * Reading from this pointer when `result_ok` is not set is undefined.
2999 struct LDKStaticPaymentOutputDescriptor *result;
3001 * A pointer to the contents in the error state.
3002 * Reading from this pointer when `result_ok` is set is undefined.
3004 struct LDKDecodeError *err;
3005 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
3008 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
3009 * containing a crate::lightning::chain::keysinterface::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
3010 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3012 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
3014 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
3015 * `err` or `result` depending on the state of `result_ok`.
3017 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
3019 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
3022 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
3025 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
3027 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
3029 * A pointer to the contents in the success state.
3030 * Reading from this pointer when `result_ok` is not set is undefined.
3032 struct LDKSpendableOutputDescriptor *result;
3034 * A pointer to the contents in the error state.
3035 * Reading from this pointer when `result_ok` is set is undefined.
3037 struct LDKDecodeError *err;
3038 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
3041 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
3042 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
3043 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3045 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
3047 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
3048 * `err` or `result` depending on the state of `result_ok`.
3050 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
3052 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
3055 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
3058 * A tuple of 2 elements. See the individual fields for the types contained.
3060 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
3062 * The element at position 0
3064 struct LDKSignature a;
3066 * The element at position 1
3068 struct LDKCVec_SignatureZ b;
3069 } LDKC2Tuple_SignatureCVec_SignatureZZ;
3072 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
3074 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
3076 * A pointer to the contents in the success state.
3077 * Reading from this pointer when `result_ok` is not set is undefined.
3079 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
3081 * Note that this value is always NULL, as there are no contents in the Err variant
3084 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
3087 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
3088 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
3089 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3091 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3093 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
3094 * `err` or `result` depending on the state of `result_ok`.
3096 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
3098 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
3101 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
3104 * The contents of CResult_SignatureNoneZ
3106 typedef union LDKCResult_SignatureNoneZPtr {
3108 * A pointer to the contents in the success state.
3109 * Reading from this pointer when `result_ok` is not set is undefined.
3111 struct LDKSignature *result;
3113 * Note that this value is always NULL, as there are no contents in the Err variant
3116 } LDKCResult_SignatureNoneZPtr;
3119 * A CResult_SignatureNoneZ represents the result of a fallible operation,
3120 * containing a crate::c_types::Signature on success and a () on failure.
3121 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3123 typedef struct LDKCResult_SignatureNoneZ {
3125 * The contents of this CResult_SignatureNoneZ, accessible via either
3126 * `err` or `result` depending on the state of `result_ok`.
3128 union LDKCResult_SignatureNoneZPtr contents;
3130 * Whether this CResult_SignatureNoneZ represents a success state.
3133 } LDKCResult_SignatureNoneZ;
3138 * The unsigned part of a channel_announcement
3140 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
3142 * A pointer to the opaque Rust object.
3143 * Nearly everywhere, inner must be non-null, however in places where
3144 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3146 LDKnativeUnsignedChannelAnnouncement *inner;
3148 * Indicates that this is the only struct which contains the same pointer.
3149 * Rust functions which take ownership of an object provided via an argument require
3150 * this to be true and invalidate the object pointed to by inner.
3153 } LDKUnsignedChannelAnnouncement;
3156 * A trait to sign lightning channel transactions as described in BOLT 3.
3158 * Signing services could be implemented on a hardware wallet. In this case,
3159 * the current Sign would be a front-end on top of a communication
3160 * channel connected to your secure device and lightning key material wouldn't
3161 * reside on a hot server. Nevertheless, a this deployment would still need
3162 * to trust the ChannelManager to avoid loss of funds as this latest component
3163 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
3165 * A more secure iteration would be to use hashlock (or payment points) to pair
3166 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
3167 * at the price of more state and computation on the hardware wallet side. In the future,
3168 * we are looking forward to design such interface.
3170 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
3171 * to act, as liveness and breach reply correctness are always going to be hard requirements
3172 * of LN security model, orthogonal of key management issues.
3174 typedef struct LDKBaseSign {
3176 * An opaque pointer which is passed to your function implementations as an argument.
3177 * This has no meaning in the LDK, and can be NULL or any other value.
3181 * Gets the per-commitment point for a specific commitment number
3183 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
3185 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
3187 * Gets the commitment secret for a specific commitment number as part of the revocation process
3189 * An external signer implementation should error here if the commitment was already signed
3190 * and should refuse to sign it in the future.
3192 * May be called more than once for the same index.
3194 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
3196 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
3198 * Gets the holder's channel public keys and basepoints
3200 struct LDKChannelPublicKeys pubkeys;
3202 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
3203 * Note that this takes a pointer to this object, not the this_ptr like other methods do
3204 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
3206 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
3208 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
3209 * some SpendableOutputDescriptor types. This should be sufficient to identify this
3210 * Sign object uniquely and lookup or re-derive its keys.
3212 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
3214 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
3216 * Note that if signing fails or is rejected, the channel will be force-closed.
3218 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx);
3220 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
3221 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
3222 * latest commitment_tx when we initiate a force-close.
3223 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
3224 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
3226 * This may be called multiple times for the same transaction.
3228 * An external signer implementation should check that the commitment has not been revoked.
3230 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
3232 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
3234 * Create a signature for the given input in a transaction spending an HTLC transaction output
3235 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
3237 * A justice transaction may claim multiple outputs at the same time if timelocks are
3238 * similar, but only a signature for the input at index `input` should be signed for here.
3239 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
3240 * to an upcoming timelock expiration.
3242 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
3244 * per_commitment_key is revocation secret which was provided by our counterparty when they
3245 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
3246 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
3249 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]);
3251 * Create a signature for the given input in a transaction spending a commitment transaction
3252 * HTLC output when our counterparty broadcasts an old state.
3254 * A justice transaction may claim multiple outputs at the same time if timelocks are
3255 * similar, but only a signature for the input at index `input` should be signed for here.
3256 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
3257 * to an upcoming timelock expiration.
3259 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
3261 * per_commitment_key is revocation secret which was provided by our counterparty when they
3262 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
3263 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
3266 * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script
3267 * (which is committed to in the BIP 143 signatures).
3269 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);
3271 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
3272 * transaction, either offered or received.
3274 * Such a transaction may claim multiples offered outputs at same time if we know the
3275 * preimage for each when we create it, but only the input at index `input` should be
3276 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
3277 * needed with regards to an upcoming timelock expiration.
3279 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
3282 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
3284 * Per_commitment_point is the dynamic point corresponding to the channel state
3285 * detected onchain. It has been generated by our counterparty and is used to derive
3286 * channel state keys, which are then included in the witness script and committed to in the
3287 * BIP 143 signature.
3289 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);
3291 * Create a signature for a (proposed) closing transaction.
3293 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
3294 * chosen to forgo their output as dust.
3296 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, struct LDKTransaction closing_tx);
3298 * Signs a channel announcement message with our funding key, proving it comes from one
3299 * of the channel participants.
3301 * Note that if this fails or is rejected, the channel will not be publicly announced and
3302 * our counterparty may (though likely will not) close the channel on us for violating the
3305 struct LDKCResult_SignatureNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
3307 * Set the counterparty static channel data, including basepoints,
3308 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
3309 * This is done as soon as the funding outpoint is known. Since these are static channel data,
3310 * they MUST NOT be allowed to change to different values once set.
3312 * channel_parameters.is_populated() MUST be true.
3314 * We bind holder_selected_contest_delay late here for API convenience.
3316 * Will be called before any signatures are applied.
3318 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
3320 * Frees any resources associated with this object given its this_arg pointer.
3321 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3323 void (*free)(void *this_arg);
3327 * A cloneable signer.
3329 * Although we require signers to be cloneable, it may be useful for developers to be able to use
3330 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
3331 * which implies Sized, into this derived trait.
3333 typedef struct LDKSign {
3335 * An opaque pointer which is passed to your function implementations as an argument.
3336 * This has no meaning in the LDK, and can be NULL or any other value.
3340 * Implementation of BaseSign for this object.
3342 struct LDKBaseSign BaseSign;
3344 * Creates a copy of the BaseSign, for a copy of this Sign.
3345 * Because BaseSign doesn't natively support copying itself, you have to provide a full copy implementation here.
3347 struct LDKBaseSign (*BaseSign_clone)(const struct LDKBaseSign *NONNULL_PTR orig_BaseSign);
3349 * Serialize the object into a byte array
3351 struct LDKCVec_u8Z (*write)(const void *this_arg);
3353 * Creates a copy of the object pointed to by this_arg, for a copy of this Sign.
3354 * Note that the ultimate copy of the Sign will have all function pointers the same as the original.
3355 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new Sign.
3357 void *(*clone)(const void *this_arg);
3359 * Frees any resources associated with this object given its this_arg pointer.
3360 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3362 void (*free)(void *this_arg);
3366 * The contents of CResult_SignDecodeErrorZ
3368 typedef union LDKCResult_SignDecodeErrorZPtr {
3370 * A pointer to the contents in the success state.
3371 * Reading from this pointer when `result_ok` is not set is undefined.
3373 struct LDKSign *result;
3375 * A pointer to the contents in the error state.
3376 * Reading from this pointer when `result_ok` is set is undefined.
3378 struct LDKDecodeError *err;
3379 } LDKCResult_SignDecodeErrorZPtr;
3382 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
3383 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
3384 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3386 typedef struct LDKCResult_SignDecodeErrorZ {
3388 * The contents of this CResult_SignDecodeErrorZ, accessible via either
3389 * `err` or `result` depending on the state of `result_ok`.
3391 union LDKCResult_SignDecodeErrorZPtr contents;
3393 * Whether this CResult_SignDecodeErrorZ represents a success state.
3396 } LDKCResult_SignDecodeErrorZ;
3399 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
3400 * allows recovering the exact public key which created the signature given the message.
3402 typedef struct LDKRecoverableSignature {
3404 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
3407 uint8_t serialized_form[68];
3408 } LDKRecoverableSignature;
3411 * The contents of CResult_RecoverableSignatureNoneZ
3413 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
3415 * A pointer to the contents in the success state.
3416 * Reading from this pointer when `result_ok` is not set is undefined.
3418 struct LDKRecoverableSignature *result;
3420 * Note that this value is always NULL, as there are no contents in the Err variant
3423 } LDKCResult_RecoverableSignatureNoneZPtr;
3426 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
3427 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
3428 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3430 typedef struct LDKCResult_RecoverableSignatureNoneZ {
3432 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
3433 * `err` or `result` depending on the state of `result_ok`.
3435 union LDKCResult_RecoverableSignatureNoneZPtr contents;
3437 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
3440 } LDKCResult_RecoverableSignatureNoneZ;
3443 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
3444 * This corresponds to std::vector in C++
3446 typedef struct LDKCVec_CVec_u8ZZ {
3448 * The elements in the array.
3449 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3451 struct LDKCVec_u8Z *data;
3453 * The number of elements pointed to by `data`.
3456 } LDKCVec_CVec_u8ZZ;
3459 * The contents of CResult_CVec_CVec_u8ZZNoneZ
3461 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
3463 * A pointer to the contents in the success state.
3464 * Reading from this pointer when `result_ok` is not set is undefined.
3466 struct LDKCVec_CVec_u8ZZ *result;
3468 * Note that this value is always NULL, as there are no contents in the Err variant
3471 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
3474 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
3475 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
3476 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3478 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
3480 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
3481 * `err` or `result` depending on the state of `result_ok`.
3483 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
3485 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
3488 } LDKCResult_CVec_CVec_u8ZZNoneZ;
3493 * A simple implementation of Sign that just keeps the private keys in memory.
3495 * This implementation performs no policy checks and is insufficient by itself as
3496 * a secure external signer.
3498 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
3500 * A pointer to the opaque Rust object.
3501 * Nearly everywhere, inner must be non-null, however in places where
3502 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3504 LDKnativeInMemorySigner *inner;
3506 * Indicates that this is the only struct which contains the same pointer.
3507 * Rust functions which take ownership of an object provided via an argument require
3508 * this to be true and invalidate the object pointed to by inner.
3511 } LDKInMemorySigner;
3514 * The contents of CResult_InMemorySignerDecodeErrorZ
3516 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
3518 * A pointer to the contents in the success state.
3519 * Reading from this pointer when `result_ok` is not set is undefined.
3521 struct LDKInMemorySigner *result;
3523 * A pointer to the contents in the error state.
3524 * Reading from this pointer when `result_ok` is set is undefined.
3526 struct LDKDecodeError *err;
3527 } LDKCResult_InMemorySignerDecodeErrorZPtr;
3530 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
3531 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3532 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3534 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
3536 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
3537 * `err` or `result` depending on the state of `result_ok`.
3539 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
3541 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
3544 } LDKCResult_InMemorySignerDecodeErrorZ;
3547 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
3548 * This corresponds to std::vector in C++
3550 typedef struct LDKCVec_TxOutZ {
3552 * The elements in the array.
3553 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3555 struct LDKTxOut *data;
3557 * The number of elements pointed to by `data`.
3563 * The contents of CResult_TransactionNoneZ
3565 typedef union LDKCResult_TransactionNoneZPtr {
3567 * A pointer to the contents in the success state.
3568 * Reading from this pointer when `result_ok` is not set is undefined.
3570 struct LDKTransaction *result;
3572 * Note that this value is always NULL, as there are no contents in the Err variant
3575 } LDKCResult_TransactionNoneZPtr;
3578 * A CResult_TransactionNoneZ represents the result of a fallible operation,
3579 * containing a crate::c_types::Transaction on success and a () on failure.
3580 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3582 typedef struct LDKCResult_TransactionNoneZ {
3584 * The contents of this CResult_TransactionNoneZ, accessible via either
3585 * `err` or `result` depending on the state of `result_ok`.
3587 union LDKCResult_TransactionNoneZPtr contents;
3589 * Whether this CResult_TransactionNoneZ represents a success state.
3592 } LDKCResult_TransactionNoneZ;
3597 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
3598 * on-chain transactions to ensure no loss of funds occurs.
3600 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
3601 * information and are actively monitoring the chain.
3603 * Pending Events or updated HTLCs which have not yet been read out by
3604 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
3605 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
3606 * gotten are fully handled before re-serializing the new state.
3608 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
3609 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
3610 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
3611 * returned block hash and the the current chain and then reconnecting blocks to get to the
3612 * best chain) upon deserializing the object!
3614 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
3616 * A pointer to the opaque Rust object.
3617 * Nearly everywhere, inner must be non-null, however in places where
3618 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3620 LDKnativeChannelMonitor *inner;
3622 * Indicates that this is the only struct which contains the same pointer.
3623 * Rust functions which take ownership of an object provided via an argument require
3624 * this to be true and invalidate the object pointed to by inner.
3627 } LDKChannelMonitor;
3630 * A tuple of 2 elements. See the individual fields for the types contained.
3632 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
3634 * The element at position 0
3636 struct LDKThirtyTwoBytes a;
3638 * The element at position 1
3640 struct LDKChannelMonitor b;
3641 } LDKC2Tuple_BlockHashChannelMonitorZ;
3644 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
3645 * This corresponds to std::vector in C++
3647 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
3649 * The elements in the array.
3650 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3652 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
3654 * The number of elements pointed to by `data`.
3657 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
3660 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
3662 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
3664 * A pointer to the contents in the success state.
3665 * Reading from this pointer when `result_ok` is not set is undefined.
3667 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
3669 * A pointer to the contents in the error state.
3670 * Reading from this pointer when `result_ok` is set is undefined.
3672 enum LDKIOError *err;
3673 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
3676 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
3677 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
3678 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3680 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
3682 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
3683 * `err` or `result` depending on the state of `result_ok`.
3685 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
3687 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
3690 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
3693 * An enum which can either contain a u16 or not
3695 typedef enum LDKCOption_u16Z_Tag {
3697 * When we're in this state, this COption_u16Z contains a u16
3699 LDKCOption_u16Z_Some,
3701 * When we're in this state, this COption_u16Z contains nothing
3703 LDKCOption_u16Z_None,
3705 * Must be last for serialization purposes
3707 LDKCOption_u16Z_Sentinel,
3708 } LDKCOption_u16Z_Tag;
3710 typedef struct LDKCOption_u16Z {
3711 LDKCOption_u16Z_Tag tag;
3720 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
3723 typedef enum LDKAPIError_Tag {
3725 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
3726 * are documented, but generally indicates some precondition of a function was violated.
3728 LDKAPIError_APIMisuseError,
3730 * Due to a high feerate, we were unable to complete the request.
3731 * For example, this may be returned if the feerate implies we cannot open a channel at the
3732 * requested value, but opening a larger channel would succeed.
3734 LDKAPIError_FeeRateTooHigh,
3736 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
3737 * too-many-hops, etc).
3739 LDKAPIError_RouteError,
3741 * We were unable to complete the request as the Channel required to do so is unable to
3742 * complete the request (or was not found). This can take many forms, including disconnected
3743 * peer, channel at capacity, channel shutting down, etc.
3745 LDKAPIError_ChannelUnavailable,
3747 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
3748 * attempted action to fail.
3750 LDKAPIError_MonitorUpdateFailed,
3752 * Must be last for serialization purposes
3754 LDKAPIError_Sentinel,
3757 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
3759 * A human-readable error message
3762 } LDKAPIError_LDKAPIMisuseError_Body;
3764 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
3766 * A human-readable error message
3770 * The feerate which was too high.
3773 } LDKAPIError_LDKFeeRateTooHigh_Body;
3775 typedef struct LDKAPIError_LDKRouteError_Body {
3777 * A human-readable error message
3780 } LDKAPIError_LDKRouteError_Body;
3782 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
3784 * A human-readable error message
3787 } LDKAPIError_LDKChannelUnavailable_Body;
3789 typedef struct MUST_USE_STRUCT LDKAPIError {
3790 LDKAPIError_Tag tag;
3792 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
3793 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
3794 LDKAPIError_LDKRouteError_Body route_error;
3795 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
3800 * The contents of CResult_NoneAPIErrorZ
3802 typedef union LDKCResult_NoneAPIErrorZPtr {
3804 * Note that this value is always NULL, as there are no contents in the OK variant
3808 * A pointer to the contents in the error state.
3809 * Reading from this pointer when `result_ok` is set is undefined.
3811 struct LDKAPIError *err;
3812 } LDKCResult_NoneAPIErrorZPtr;
3815 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
3816 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
3817 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3819 typedef struct LDKCResult_NoneAPIErrorZ {
3821 * The contents of this CResult_NoneAPIErrorZ, accessible via either
3822 * `err` or `result` depending on the state of `result_ok`.
3824 union LDKCResult_NoneAPIErrorZPtr contents;
3826 * Whether this CResult_NoneAPIErrorZ represents a success state.
3829 } LDKCResult_NoneAPIErrorZ;
3832 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
3833 * This corresponds to std::vector in C++
3835 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
3837 * The elements in the array.
3838 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3840 struct LDKCResult_NoneAPIErrorZ *data;
3842 * The number of elements pointed to by `data`.
3845 } LDKCVec_CResult_NoneAPIErrorZZ;
3848 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
3849 * This corresponds to std::vector in C++
3851 typedef struct LDKCVec_APIErrorZ {
3853 * The elements in the array.
3854 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3856 struct LDKAPIError *data;
3858 * The number of elements pointed to by `data`.
3861 } LDKCVec_APIErrorZ;
3864 * If a payment fails to send, it can be in one of several states. This enum is returned as the
3865 * Err() type describing which state the payment is in, see the description of individual enum
3868 typedef enum LDKPaymentSendFailure_Tag {
3870 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
3871 * send the payment at all. No channel state has been changed or messages sent to peers, and
3872 * once you've changed the parameter at error, you can freely retry the payment in full.
3874 LDKPaymentSendFailure_ParameterError,
3876 * A parameter in a single path which was passed to send_payment was invalid, preventing us
3877 * from attempting to send the payment at all. No channel state has been changed or messages
3878 * sent to peers, and once you've changed the parameter at error, you can freely retry the
3881 * The results here are ordered the same as the paths in the route object which was passed to
3884 LDKPaymentSendFailure_PathParameterError,
3886 * All paths which were attempted failed to send, with no channel state change taking place.
3887 * You can freely retry the payment in full (though you probably want to do so over different
3888 * paths than the ones selected).
3890 LDKPaymentSendFailure_AllFailedRetrySafe,
3892 * Some paths which were attempted failed to send, though possibly not all. At least some
3893 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
3894 * in over-/re-payment.
3896 * The results here are ordered the same as the paths in the route object which was passed to
3897 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
3898 * retried (though there is currently no API with which to do so).
3900 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
3901 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
3902 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
3903 * with the latest update_id.
3905 LDKPaymentSendFailure_PartialFailure,
3907 * Must be last for serialization purposes
3909 LDKPaymentSendFailure_Sentinel,
3910 } LDKPaymentSendFailure_Tag;
3912 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
3913 LDKPaymentSendFailure_Tag tag;
3916 struct LDKAPIError parameter_error;
3919 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
3922 struct LDKCVec_APIErrorZ all_failed_retry_safe;
3925 struct LDKCVec_CResult_NoneAPIErrorZZ partial_failure;
3928 } LDKPaymentSendFailure;
3931 * The contents of CResult_NonePaymentSendFailureZ
3933 typedef union LDKCResult_NonePaymentSendFailureZPtr {
3935 * Note that this value is always NULL, as there are no contents in the OK variant
3939 * A pointer to the contents in the error state.
3940 * Reading from this pointer when `result_ok` is set is undefined.
3942 struct LDKPaymentSendFailure *err;
3943 } LDKCResult_NonePaymentSendFailureZPtr;
3946 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
3947 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
3948 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3950 typedef struct LDKCResult_NonePaymentSendFailureZ {
3952 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
3953 * `err` or `result` depending on the state of `result_ok`.
3955 union LDKCResult_NonePaymentSendFailureZPtr contents;
3957 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
3960 } LDKCResult_NonePaymentSendFailureZ;
3963 * A 4-byte byte array.
3965 typedef struct LDKFourBytes {
3973 * A 16-byte byte array.
3975 typedef struct LDKSixteenBytes {
3983 * A 10-byte byte array.
3985 typedef struct LDKTenBytes {
3993 * An address which can be used to connect to a remote peer
3995 typedef enum LDKNetAddress_Tag {
3997 * An IPv4 address/port on which the peer is listening.
4001 * An IPv6 address/port on which the peer is listening.
4005 * An old-style Tor onion address/port on which the peer is listening.
4007 LDKNetAddress_OnionV2,
4009 * A new-style Tor onion address/port on which the peer is listening.
4010 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
4011 * wrap as base32 and append \".onion\".
4013 LDKNetAddress_OnionV3,
4015 * Must be last for serialization purposes
4017 LDKNetAddress_Sentinel,
4018 } LDKNetAddress_Tag;
4020 typedef struct LDKNetAddress_LDKIPv4_Body {
4022 * The 4-byte IPv4 address
4024 struct LDKFourBytes addr;
4026 * The port on which the node is listening
4029 } LDKNetAddress_LDKIPv4_Body;
4031 typedef struct LDKNetAddress_LDKIPv6_Body {
4033 * The 16-byte IPv6 address
4035 struct LDKSixteenBytes addr;
4037 * The port on which the node is listening
4040 } LDKNetAddress_LDKIPv6_Body;
4042 typedef struct LDKNetAddress_LDKOnionV2_Body {
4044 * The bytes (usually encoded in base32 with \".onion\" appended)
4046 struct LDKTenBytes addr;
4048 * The port on which the node is listening
4051 } LDKNetAddress_LDKOnionV2_Body;
4053 typedef struct LDKNetAddress_LDKOnionV3_Body {
4055 * The ed25519 long-term public key of the peer
4057 struct LDKThirtyTwoBytes ed25519_pubkey;
4059 * The checksum of the pubkey and version, as included in the onion address
4063 * The version byte, as defined by the Tor Onion v3 spec.
4067 * The port on which the node is listening
4070 } LDKNetAddress_LDKOnionV3_Body;
4072 typedef struct MUST_USE_STRUCT LDKNetAddress {
4073 LDKNetAddress_Tag tag;
4075 LDKNetAddress_LDKIPv4_Body i_pv4;
4076 LDKNetAddress_LDKIPv6_Body i_pv6;
4077 LDKNetAddress_LDKOnionV2_Body onion_v2;
4078 LDKNetAddress_LDKOnionV3_Body onion_v3;
4083 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
4084 * This corresponds to std::vector in C++
4086 typedef struct LDKCVec_NetAddressZ {
4088 * The elements in the array.
4089 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4091 struct LDKNetAddress *data;
4093 * The number of elements pointed to by `data`.
4096 } LDKCVec_NetAddressZ;
4099 * A tuple of 2 elements. See the individual fields for the types contained.
4101 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
4103 * The element at position 0
4105 struct LDKThirtyTwoBytes a;
4107 * The element at position 1
4109 struct LDKThirtyTwoBytes b;
4110 } LDKC2Tuple_PaymentHashPaymentSecretZ;
4113 * The contents of CResult_PaymentSecretAPIErrorZ
4115 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
4117 * A pointer to the contents in the success state.
4118 * Reading from this pointer when `result_ok` is not set is undefined.
4120 struct LDKThirtyTwoBytes *result;
4122 * A pointer to the contents in the error state.
4123 * Reading from this pointer when `result_ok` is set is undefined.
4125 struct LDKAPIError *err;
4126 } LDKCResult_PaymentSecretAPIErrorZPtr;
4129 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
4130 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
4131 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4133 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
4135 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
4136 * `err` or `result` depending on the state of `result_ok`.
4138 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
4140 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
4143 } LDKCResult_PaymentSecretAPIErrorZ;
4146 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
4147 * This corresponds to std::vector in C++
4149 typedef struct LDKCVec_ChannelMonitorZ {
4151 * The elements in the array.
4152 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4154 struct LDKChannelMonitor *data;
4156 * The number of elements pointed to by `data`.
4159 } LDKCVec_ChannelMonitorZ;
4164 * An update generated by the underlying Channel itself which contains some new information the
4165 * ChannelMonitor should be made aware of.
4167 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
4169 * A pointer to the opaque Rust object.
4170 * Nearly everywhere, inner must be non-null, however in places where
4171 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4173 LDKnativeChannelMonitorUpdate *inner;
4175 * Indicates that this is the only struct which contains the same pointer.
4176 * Rust functions which take ownership of an object provided via an argument require
4177 * this to be true and invalidate the object pointed to by inner.
4180 } LDKChannelMonitorUpdate;
4183 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
4184 * blocks are connected and disconnected.
4186 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
4187 * responsible for maintaining a set of monitors such that they can be updated accordingly as
4188 * channel state changes and HTLCs are resolved. See method documentation for specific
4191 * Implementations **must** ensure that updates are successfully applied and persisted upon method
4192 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
4193 * without taking any further action such as persisting the current state.
4195 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
4196 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
4197 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
4198 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
4199 * multiple instances.
4201 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
4202 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
4203 * [`PermanentFailure`]: channelmonitor::ChannelMonitorUpdateErr::PermanentFailure
4205 typedef struct LDKWatch {
4207 * An opaque pointer which is passed to your function implementations as an argument.
4208 * This has no meaning in the LDK, and can be NULL or any other value.
4212 * Watches a channel identified by `funding_txo` using `monitor`.
4214 * Implementations are responsible for watching the chain for the funding transaction along
4215 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
4216 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
4218 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
4219 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
4220 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
4222 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
4224 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
4226 * Implementations must call [`update_monitor`] with the given update. See
4227 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
4229 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
4230 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
4232 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
4234 * Returns any monitor events since the last call. Subsequent calls must only return new
4237 struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
4239 * Frees any resources associated with this object given its this_arg pointer.
4240 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4242 void (*free)(void *this_arg);
4246 * An interface to send a transaction to the Bitcoin network.
4248 typedef struct LDKBroadcasterInterface {
4250 * An opaque pointer which is passed to your function implementations as an argument.
4251 * This has no meaning in the LDK, and can be NULL or any other value.
4255 * Sends a transaction out to (hopefully) be mined.
4257 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
4259 * Frees any resources associated with this object given its this_arg pointer.
4260 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4262 void (*free)(void *this_arg);
4263 } LDKBroadcasterInterface;
4266 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
4267 * own the memory pointed to by data.
4269 typedef struct LDKu8slice {
4271 * A pointer to the byte buffer
4273 const uint8_t *data;
4275 * The number of bytes pointed to by `data`.
4281 * A trait to describe an object which can get user secrets and key material.
4283 typedef struct LDKKeysInterface {
4285 * An opaque pointer which is passed to your function implementations as an argument.
4286 * This has no meaning in the LDK, and can be NULL or any other value.
4290 * Get node secret key (aka node_id or network_key).
4292 * This method must return the same value each time it is called.
4294 struct LDKSecretKey (*get_node_secret)(const void *this_arg);
4296 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
4298 * This method should return a different value each time it is called, to avoid linking
4299 * on-chain funds across channels as controlled to the same user.
4301 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
4303 * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
4306 * This method should return a different value each time it is called, to avoid linking
4307 * on-chain funds across channels as controlled to the same user.
4309 struct LDKPublicKey (*get_shutdown_pubkey)(const void *this_arg);
4311 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
4312 * restarted with some stale data!
4314 * This method must return a different value each time it is called.
4316 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
4318 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
4319 * onion packets and for temporary channel IDs. There is no requirement that these be
4320 * persisted anywhere, though they must be unique across restarts.
4322 * This method must return a different value each time it is called.
4324 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
4326 * Reads a `Signer` for this `KeysInterface` from the given input stream.
4327 * This is only called during deserialization of other objects which contain
4328 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
4329 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
4330 * contain no versioning scheme. You may wish to include your own version prefix and ensure
4331 * you've read all of the provided bytes to ensure no corruption occurred.
4333 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
4335 * Sign an invoice's preimage (note that this is the preimage of the invoice, not the HTLC's
4336 * preimage). By parameterizing by the preimage instead of the hash, we allow implementors of
4337 * this trait to parse the invoice and make sure they're signing what they expect, rather than
4338 * blindly signing the hash.
4340 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKCVec_u8Z invoice_preimage);
4342 * Frees any resources associated with this object given its this_arg pointer.
4343 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4345 void (*free)(void *this_arg);
4349 * A trait which should be implemented to provide feerate information on a number of time
4352 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
4353 * called from inside the library in response to chain events, P2P events, or timer events).
4355 typedef struct LDKFeeEstimator {
4357 * An opaque pointer which is passed to your function implementations as an argument.
4358 * This has no meaning in the LDK, and can be NULL or any other value.
4362 * Gets estimated satoshis of fee required per 1000 Weight-Units.
4364 * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
4365 * don't put us below 1 satoshi-per-byte).
4367 * This translates to:
4368 * * satoshis-per-byte * 250
4369 * * ceil(satoshis-per-kbyte / 4)
4371 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
4373 * Frees any resources associated with this object given its this_arg pointer.
4374 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4376 void (*free)(void *this_arg);
4380 * A trait encapsulating the operations required of a logger
4382 typedef struct LDKLogger {
4384 * An opaque pointer which is passed to your function implementations as an argument.
4385 * This has no meaning in the LDK, and can be NULL or any other value.
4391 void (*log)(const void *this_arg, const char *record);
4393 * Frees any resources associated with this object given its this_arg pointer.
4394 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4396 void (*free)(void *this_arg);
4402 * Manager which keeps track of a number of channels and sends messages to the appropriate
4403 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
4405 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
4406 * to individual Channels.
4408 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
4409 * all peers during write/read (though does not modify this instance, only the instance being
4410 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
4411 * called funding_transaction_generated for outbound channels).
4413 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
4414 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
4415 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
4416 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
4417 * the serialization process). If the deserialized version is out-of-date compared to the
4418 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
4419 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
4421 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
4422 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
4423 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
4424 * block_connected() to step towards your best block) upon deserialization before using the
4427 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
4428 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
4429 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
4430 * offline for a full minute. In order to track this, you must call
4431 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
4433 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
4434 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
4435 * essentially you should default to using a SimpleRefChannelManager, and use a
4436 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
4437 * you're using lightning-net-tokio.
4439 typedef struct MUST_USE_STRUCT LDKChannelManager {
4441 * A pointer to the opaque Rust object.
4442 * Nearly everywhere, inner must be non-null, however in places where
4443 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4445 LDKnativeChannelManager *inner;
4447 * Indicates that this is the only struct which contains the same pointer.
4448 * Rust functions which take ownership of an object provided via an argument require
4449 * this to be true and invalidate the object pointed to by inner.
4452 } LDKChannelManager;
4455 * A tuple of 2 elements. See the individual fields for the types contained.
4457 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
4459 * The element at position 0
4461 struct LDKThirtyTwoBytes a;
4463 * The element at position 1
4465 struct LDKChannelManager b;
4466 } LDKC2Tuple_BlockHashChannelManagerZ;
4469 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
4471 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
4473 * A pointer to the contents in the success state.
4474 * Reading from this pointer when `result_ok` is not set is undefined.
4476 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
4478 * A pointer to the contents in the error state.
4479 * Reading from this pointer when `result_ok` is set is undefined.
4481 struct LDKDecodeError *err;
4482 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
4485 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
4486 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
4487 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4489 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
4491 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
4492 * `err` or `result` depending on the state of `result_ok`.
4494 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
4496 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
4499 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
4504 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
4505 * with our counterparty.
4507 typedef struct MUST_USE_STRUCT LDKChannelConfig {
4509 * A pointer to the opaque Rust object.
4510 * Nearly everywhere, inner must be non-null, however in places where
4511 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4513 LDKnativeChannelConfig *inner;
4515 * Indicates that this is the only struct which contains the same pointer.
4516 * Rust functions which take ownership of an object provided via an argument require
4517 * this to be true and invalidate the object pointed to by inner.
4523 * The contents of CResult_ChannelConfigDecodeErrorZ
4525 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
4527 * A pointer to the contents in the success state.
4528 * Reading from this pointer when `result_ok` is not set is undefined.
4530 struct LDKChannelConfig *result;
4532 * A pointer to the contents in the error state.
4533 * Reading from this pointer when `result_ok` is set is undefined.
4535 struct LDKDecodeError *err;
4536 } LDKCResult_ChannelConfigDecodeErrorZPtr;
4539 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
4540 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
4541 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4543 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
4545 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
4546 * `err` or `result` depending on the state of `result_ok`.
4548 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
4550 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
4553 } LDKCResult_ChannelConfigDecodeErrorZ;
4556 * The contents of CResult_OutPointDecodeErrorZ
4558 typedef union LDKCResult_OutPointDecodeErrorZPtr {
4560 * A pointer to the contents in the success state.
4561 * Reading from this pointer when `result_ok` is not set is undefined.
4563 struct LDKOutPoint *result;
4565 * A pointer to the contents in the error state.
4566 * Reading from this pointer when `result_ok` is set is undefined.
4568 struct LDKDecodeError *err;
4569 } LDKCResult_OutPointDecodeErrorZPtr;
4572 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
4573 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
4574 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4576 typedef struct LDKCResult_OutPointDecodeErrorZ {
4578 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
4579 * `err` or `result` depending on the state of `result_ok`.
4581 union LDKCResult_OutPointDecodeErrorZPtr contents;
4583 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
4586 } LDKCResult_OutPointDecodeErrorZ;
4589 * The contents of CResult_SiPrefixNoneZ
4591 typedef union LDKCResult_SiPrefixNoneZPtr {
4593 * A pointer to the contents in the success state.
4594 * Reading from this pointer when `result_ok` is not set is undefined.
4596 enum LDKSiPrefix *result;
4598 * Note that this value is always NULL, as there are no contents in the Err variant
4601 } LDKCResult_SiPrefixNoneZPtr;
4604 * A CResult_SiPrefixNoneZ represents the result of a fallible operation,
4605 * containing a crate::lightning_invoice::SiPrefix on success and a () on failure.
4606 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4608 typedef struct LDKCResult_SiPrefixNoneZ {
4610 * The contents of this CResult_SiPrefixNoneZ, accessible via either
4611 * `err` or `result` depending on the state of `result_ok`.
4613 union LDKCResult_SiPrefixNoneZPtr contents;
4615 * Whether this CResult_SiPrefixNoneZ represents a success state.
4618 } LDKCResult_SiPrefixNoneZ;
4623 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
4625 * There are three ways to construct an `Invoice`:
4626 * 1. using `InvoiceBuilder`
4627 * 2. using `Invoice::from_signed(SignedRawInvoice)`
4628 * 3. using `str::parse::<Invoice>(&str)`
4630 typedef struct MUST_USE_STRUCT LDKInvoice {
4632 * A pointer to the opaque Rust object.
4633 * Nearly everywhere, inner must be non-null, however in places where
4634 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4636 LDKnativeInvoice *inner;
4638 * Indicates that this is the only struct which contains the same pointer.
4639 * Rust functions which take ownership of an object provided via an argument require
4640 * this to be true and invalidate the object pointed to by inner.
4646 * The contents of CResult_InvoiceNoneZ
4648 typedef union LDKCResult_InvoiceNoneZPtr {
4650 * A pointer to the contents in the success state.
4651 * Reading from this pointer when `result_ok` is not set is undefined.
4653 struct LDKInvoice *result;
4655 * Note that this value is always NULL, as there are no contents in the Err variant
4658 } LDKCResult_InvoiceNoneZPtr;
4661 * A CResult_InvoiceNoneZ represents the result of a fallible operation,
4662 * containing a crate::lightning_invoice::Invoice on success and a () on failure.
4663 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4665 typedef struct LDKCResult_InvoiceNoneZ {
4667 * The contents of this CResult_InvoiceNoneZ, accessible via either
4668 * `err` or `result` depending on the state of `result_ok`.
4670 union LDKCResult_InvoiceNoneZPtr contents;
4672 * Whether this CResult_InvoiceNoneZ represents a success state.
4675 } LDKCResult_InvoiceNoneZ;
4680 * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
4684 * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
4686 typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
4688 * A pointer to the opaque Rust object.
4689 * Nearly everywhere, inner must be non-null, however in places where
4690 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4692 LDKnativeSignedRawInvoice *inner;
4694 * Indicates that this is the only struct which contains the same pointer.
4695 * Rust functions which take ownership of an object provided via an argument require
4696 * this to be true and invalidate the object pointed to by inner.
4699 } LDKSignedRawInvoice;
4702 * The contents of CResult_SignedRawInvoiceNoneZ
4704 typedef union LDKCResult_SignedRawInvoiceNoneZPtr {
4706 * A pointer to the contents in the success state.
4707 * Reading from this pointer when `result_ok` is not set is undefined.
4709 struct LDKSignedRawInvoice *result;
4711 * Note that this value is always NULL, as there are no contents in the Err variant
4714 } LDKCResult_SignedRawInvoiceNoneZPtr;
4717 * A CResult_SignedRawInvoiceNoneZ represents the result of a fallible operation,
4718 * containing a crate::lightning_invoice::SignedRawInvoice on success and a () on failure.
4719 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4721 typedef struct LDKCResult_SignedRawInvoiceNoneZ {
4723 * The contents of this CResult_SignedRawInvoiceNoneZ, accessible via either
4724 * `err` or `result` depending on the state of `result_ok`.
4726 union LDKCResult_SignedRawInvoiceNoneZPtr contents;
4728 * Whether this CResult_SignedRawInvoiceNoneZ represents a success state.
4731 } LDKCResult_SignedRawInvoiceNoneZ;
4736 * Represents an syntactically correct Invoice for a payment on the lightning network,
4737 * but without the signature information.
4738 * De- and encoding should not lead to information loss but may lead to different hashes.
4740 * For methods without docs see the corresponding methods in `Invoice`.
4742 typedef struct MUST_USE_STRUCT LDKRawInvoice {
4744 * A pointer to the opaque Rust object.
4745 * Nearly everywhere, inner must be non-null, however in places where
4746 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4748 LDKnativeRawInvoice *inner;
4750 * Indicates that this is the only struct which contains the same pointer.
4751 * Rust functions which take ownership of an object provided via an argument require
4752 * this to be true and invalidate the object pointed to by inner.
4760 * Recoverable signature
4762 typedef struct MUST_USE_STRUCT LDKInvoiceSignature {
4764 * A pointer to the opaque Rust object.
4765 * Nearly everywhere, inner must be non-null, however in places where
4766 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4768 LDKnativeInvoiceSignature *inner;
4770 * Indicates that this is the only struct which contains the same pointer.
4771 * Rust functions which take ownership of an object provided via an argument require
4772 * this to be true and invalidate the object pointed to by inner.
4775 } LDKInvoiceSignature;
4778 * A tuple of 3 elements. See the individual fields for the types contained.
4780 typedef struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ {
4782 * The element at position 0
4784 struct LDKRawInvoice a;
4786 * The element at position 1
4788 struct LDKThirtyTwoBytes b;
4790 * The element at position 2
4792 struct LDKInvoiceSignature c;
4793 } LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ;
4800 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
4802 * A pointer to the opaque Rust object.
4803 * Nearly everywhere, inner must be non-null, however in places where
4804 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4806 LDKnativePayeePubKey *inner;
4808 * Indicates that this is the only struct which contains the same pointer.
4809 * Rust functions which take ownership of an object provided via an argument require
4810 * this to be true and invalidate the object pointed to by inner.
4816 * The contents of CResult_PayeePubKeyErrorZ
4818 typedef union LDKCResult_PayeePubKeyErrorZPtr {
4820 * A pointer to the contents in the success state.
4821 * Reading from this pointer when `result_ok` is not set is undefined.
4823 struct LDKPayeePubKey *result;
4825 * A pointer to the contents in the error state.
4826 * Reading from this pointer when `result_ok` is set is undefined.
4828 enum LDKSecp256k1Error *err;
4829 } LDKCResult_PayeePubKeyErrorZPtr;
4832 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
4833 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
4834 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4836 typedef struct LDKCResult_PayeePubKeyErrorZ {
4838 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
4839 * `err` or `result` depending on the state of `result_ok`.
4841 union LDKCResult_PayeePubKeyErrorZPtr contents;
4843 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
4846 } LDKCResult_PayeePubKeyErrorZ;
4851 * Private routing information
4854 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
4857 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
4859 * A pointer to the opaque Rust object.
4860 * Nearly everywhere, inner must be non-null, however in places where
4861 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4863 LDKnativePrivateRoute *inner;
4865 * Indicates that this is the only struct which contains the same pointer.
4866 * Rust functions which take ownership of an object provided via an argument require
4867 * this to be true and invalidate the object pointed to by inner.
4873 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
4874 * This corresponds to std::vector in C++
4876 typedef struct LDKCVec_PrivateRouteZ {
4878 * The elements in the array.
4879 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4881 struct LDKPrivateRoute *data;
4883 * The number of elements pointed to by `data`.
4886 } LDKCVec_PrivateRouteZ;
4891 * A timestamp that refers to a date after 1 January 1970 which means its representation as UNIX
4892 * timestamp is positive.
4895 * The UNIX timestamp representing the stored time has to be positive and small enough so that
4896 * a `EpiryTime` can be added to it without an overflow.
4898 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
4900 * A pointer to the opaque Rust object.
4901 * Nearly everywhere, inner must be non-null, however in places where
4902 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4904 LDKnativePositiveTimestamp *inner;
4906 * Indicates that this is the only struct which contains the same pointer.
4907 * Rust functions which take ownership of an object provided via an argument require
4908 * this to be true and invalidate the object pointed to by inner.
4911 } LDKPositiveTimestamp;
4914 * The contents of CResult_PositiveTimestampCreationErrorZ
4916 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
4918 * A pointer to the contents in the success state.
4919 * Reading from this pointer when `result_ok` is not set is undefined.
4921 struct LDKPositiveTimestamp *result;
4923 * A pointer to the contents in the error state.
4924 * Reading from this pointer when `result_ok` is set is undefined.
4926 enum LDKCreationError *err;
4927 } LDKCResult_PositiveTimestampCreationErrorZPtr;
4930 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
4931 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
4932 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4934 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
4936 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
4937 * `err` or `result` depending on the state of `result_ok`.
4939 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
4941 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
4944 } LDKCResult_PositiveTimestampCreationErrorZ;
4947 * The contents of CResult_NoneSemanticErrorZ
4949 typedef union LDKCResult_NoneSemanticErrorZPtr {
4951 * Note that this value is always NULL, as there are no contents in the OK variant
4955 * A pointer to the contents in the error state.
4956 * Reading from this pointer when `result_ok` is set is undefined.
4958 enum LDKSemanticError *err;
4959 } LDKCResult_NoneSemanticErrorZPtr;
4962 * A CResult_NoneSemanticErrorZ represents the result of a fallible operation,
4963 * containing a () on success and a crate::lightning_invoice::SemanticError on failure.
4964 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4966 typedef struct LDKCResult_NoneSemanticErrorZ {
4968 * The contents of this CResult_NoneSemanticErrorZ, accessible via either
4969 * `err` or `result` depending on the state of `result_ok`.
4971 union LDKCResult_NoneSemanticErrorZPtr contents;
4973 * Whether this CResult_NoneSemanticErrorZ represents a success state.
4976 } LDKCResult_NoneSemanticErrorZ;
4979 * The contents of CResult_InvoiceSemanticErrorZ
4981 typedef union LDKCResult_InvoiceSemanticErrorZPtr {
4983 * A pointer to the contents in the success state.
4984 * Reading from this pointer when `result_ok` is not set is undefined.
4986 struct LDKInvoice *result;
4988 * A pointer to the contents in the error state.
4989 * Reading from this pointer when `result_ok` is set is undefined.
4991 enum LDKSemanticError *err;
4992 } LDKCResult_InvoiceSemanticErrorZPtr;
4995 * A CResult_InvoiceSemanticErrorZ represents the result of a fallible operation,
4996 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SemanticError on failure.
4997 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4999 typedef struct LDKCResult_InvoiceSemanticErrorZ {
5001 * The contents of this CResult_InvoiceSemanticErrorZ, accessible via either
5002 * `err` or `result` depending on the state of `result_ok`.
5004 union LDKCResult_InvoiceSemanticErrorZPtr contents;
5006 * Whether this CResult_InvoiceSemanticErrorZ represents a success state.
5009 } LDKCResult_InvoiceSemanticErrorZ;
5014 * Description string
5017 * The description can be at most 639 __bytes__ long
5019 typedef struct MUST_USE_STRUCT LDKDescription {
5021 * A pointer to the opaque Rust object.
5022 * Nearly everywhere, inner must be non-null, however in places where
5023 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5025 LDKnativeDescription *inner;
5027 * Indicates that this is the only struct which contains the same pointer.
5028 * Rust functions which take ownership of an object provided via an argument require
5029 * this to be true and invalidate the object pointed to by inner.
5035 * The contents of CResult_DescriptionCreationErrorZ
5037 typedef union LDKCResult_DescriptionCreationErrorZPtr {
5039 * A pointer to the contents in the success state.
5040 * Reading from this pointer when `result_ok` is not set is undefined.
5042 struct LDKDescription *result;
5044 * A pointer to the contents in the error state.
5045 * Reading from this pointer when `result_ok` is set is undefined.
5047 enum LDKCreationError *err;
5048 } LDKCResult_DescriptionCreationErrorZPtr;
5051 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
5052 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
5053 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5055 typedef struct LDKCResult_DescriptionCreationErrorZ {
5057 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
5058 * `err` or `result` depending on the state of `result_ok`.
5060 union LDKCResult_DescriptionCreationErrorZPtr contents;
5062 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
5065 } LDKCResult_DescriptionCreationErrorZ;
5070 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
5074 * The number of seconds this expiry time represents has to be in the range
5075 * `0...(SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME)` to avoid overflows when adding it to a
5078 typedef struct MUST_USE_STRUCT LDKExpiryTime {
5080 * A pointer to the opaque Rust object.
5081 * Nearly everywhere, inner must be non-null, however in places where
5082 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5084 LDKnativeExpiryTime *inner;
5086 * Indicates that this is the only struct which contains the same pointer.
5087 * Rust functions which take ownership of an object provided via an argument require
5088 * this to be true and invalidate the object pointed to by inner.
5094 * The contents of CResult_ExpiryTimeCreationErrorZ
5096 typedef union LDKCResult_ExpiryTimeCreationErrorZPtr {
5098 * A pointer to the contents in the success state.
5099 * Reading from this pointer when `result_ok` is not set is undefined.
5101 struct LDKExpiryTime *result;
5103 * A pointer to the contents in the error state.
5104 * Reading from this pointer when `result_ok` is set is undefined.
5106 enum LDKCreationError *err;
5107 } LDKCResult_ExpiryTimeCreationErrorZPtr;
5110 * A CResult_ExpiryTimeCreationErrorZ represents the result of a fallible operation,
5111 * containing a crate::lightning_invoice::ExpiryTime on success and a crate::lightning_invoice::CreationError on failure.
5112 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5114 typedef struct LDKCResult_ExpiryTimeCreationErrorZ {
5116 * The contents of this CResult_ExpiryTimeCreationErrorZ, accessible via either
5117 * `err` or `result` depending on the state of `result_ok`.
5119 union LDKCResult_ExpiryTimeCreationErrorZPtr contents;
5121 * Whether this CResult_ExpiryTimeCreationErrorZ represents a success state.
5124 } LDKCResult_ExpiryTimeCreationErrorZ;
5127 * The contents of CResult_PrivateRouteCreationErrorZ
5129 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
5131 * A pointer to the contents in the success state.
5132 * Reading from this pointer when `result_ok` is not set is undefined.
5134 struct LDKPrivateRoute *result;
5136 * A pointer to the contents in the error state.
5137 * Reading from this pointer when `result_ok` is set is undefined.
5139 enum LDKCreationError *err;
5140 } LDKCResult_PrivateRouteCreationErrorZPtr;
5143 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
5144 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
5145 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5147 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
5149 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
5150 * `err` or `result` depending on the state of `result_ok`.
5152 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
5154 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
5157 } LDKCResult_PrivateRouteCreationErrorZ;
5160 * The contents of CResult_StringErrorZ
5162 typedef union LDKCResult_StringErrorZPtr {
5164 * A pointer to the contents in the success state.
5165 * Reading from this pointer when `result_ok` is not set is undefined.
5167 struct LDKStr *result;
5169 * A pointer to the contents in the error state.
5170 * Reading from this pointer when `result_ok` is set is undefined.
5172 enum LDKSecp256k1Error *err;
5173 } LDKCResult_StringErrorZPtr;
5176 * A CResult_StringErrorZ represents the result of a fallible operation,
5177 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
5178 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5180 typedef struct LDKCResult_StringErrorZ {
5182 * The contents of this CResult_StringErrorZ, accessible via either
5183 * `err` or `result` depending on the state of `result_ok`.
5185 union LDKCResult_StringErrorZPtr contents;
5187 * Whether this CResult_StringErrorZ represents a success state.
5190 } LDKCResult_StringErrorZ;
5193 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
5195 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
5197 * A pointer to the contents in the success state.
5198 * Reading from this pointer when `result_ok` is not set is undefined.
5200 struct LDKChannelMonitorUpdate *result;
5202 * A pointer to the contents in the error state.
5203 * Reading from this pointer when `result_ok` is set is undefined.
5205 struct LDKDecodeError *err;
5206 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
5209 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
5210 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
5211 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5213 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
5215 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
5216 * `err` or `result` depending on the state of `result_ok`.
5218 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
5220 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
5223 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
5226 * The contents of CResult_HTLCUpdateDecodeErrorZ
5228 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
5230 * A pointer to the contents in the success state.
5231 * Reading from this pointer when `result_ok` is not set is undefined.
5233 struct LDKHTLCUpdate *result;
5235 * A pointer to the contents in the error state.
5236 * Reading from this pointer when `result_ok` is set is undefined.
5238 struct LDKDecodeError *err;
5239 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
5242 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
5243 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
5244 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5246 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
5248 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
5249 * `err` or `result` depending on the state of `result_ok`.
5251 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
5253 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
5256 } LDKCResult_HTLCUpdateDecodeErrorZ;
5261 * General Err type for ChannelMonitor actions. Generally, this implies that the data provided is
5262 * inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this
5263 * means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was
5265 * Contains a developer-readable error message.
5267 typedef struct MUST_USE_STRUCT LDKMonitorUpdateError {
5269 * A pointer to the opaque Rust object.
5270 * Nearly everywhere, inner must be non-null, however in places where
5271 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5273 LDKnativeMonitorUpdateError *inner;
5275 * Indicates that this is the only struct which contains the same pointer.
5276 * Rust functions which take ownership of an object provided via an argument require
5277 * this to be true and invalidate the object pointed to by inner.
5280 } LDKMonitorUpdateError;
5283 * The contents of CResult_NoneMonitorUpdateErrorZ
5285 typedef union LDKCResult_NoneMonitorUpdateErrorZPtr {
5287 * Note that this value is always NULL, as there are no contents in the OK variant
5291 * A pointer to the contents in the error state.
5292 * Reading from this pointer when `result_ok` is set is undefined.
5294 struct LDKMonitorUpdateError *err;
5295 } LDKCResult_NoneMonitorUpdateErrorZPtr;
5298 * A CResult_NoneMonitorUpdateErrorZ represents the result of a fallible operation,
5299 * containing a () on success and a crate::lightning::chain::channelmonitor::MonitorUpdateError on failure.
5300 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5302 typedef struct LDKCResult_NoneMonitorUpdateErrorZ {
5304 * The contents of this CResult_NoneMonitorUpdateErrorZ, accessible via either
5305 * `err` or `result` depending on the state of `result_ok`.
5307 union LDKCResult_NoneMonitorUpdateErrorZPtr contents;
5309 * Whether this CResult_NoneMonitorUpdateErrorZ represents a success state.
5312 } LDKCResult_NoneMonitorUpdateErrorZ;
5315 * A tuple of 2 elements. See the individual fields for the types contained.
5317 typedef struct LDKC2Tuple_OutPointScriptZ {
5319 * The element at position 0
5321 struct LDKOutPoint a;
5323 * The element at position 1
5325 struct LDKCVec_u8Z b;
5326 } LDKC2Tuple_OutPointScriptZ;
5329 * A tuple of 2 elements. See the individual fields for the types contained.
5331 typedef struct LDKC2Tuple_u32ScriptZ {
5333 * The element at position 0
5337 * The element at position 1
5339 struct LDKCVec_u8Z b;
5340 } LDKC2Tuple_u32ScriptZ;
5343 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
5344 * This corresponds to std::vector in C++
5346 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
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 LDKC2Tuple_u32ScriptZ *data;
5353 * The number of elements pointed to by `data`.
5356 } LDKCVec_C2Tuple_u32ScriptZZ;
5359 * A tuple of 2 elements. See the individual fields for the types contained.
5361 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
5363 * The element at position 0
5365 struct LDKThirtyTwoBytes a;
5367 * The element at position 1
5369 struct LDKCVec_C2Tuple_u32ScriptZZ b;
5370 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
5373 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
5374 * This corresponds to std::vector in C++
5376 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
5378 * The elements in the array.
5379 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5381 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
5383 * The number of elements pointed to by `data`.
5386 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
5389 * An Event which you should probably take some action in response to.
5391 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
5392 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
5393 * written as it makes no sense to respond to it after reconnecting to peers).
5395 typedef enum LDKEvent_Tag {
5397 * Used to indicate that the client should generate a funding transaction with the given
5398 * parameters and then call ChannelManager::funding_transaction_generated.
5399 * Generated in ChannelManager message handling.
5400 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
5401 * counterparty can steal your funds!
5403 LDKEvent_FundingGenerationReady,
5405 * Indicates we've received money! Just gotta dig out that payment preimage and feed it to
5406 * ChannelManager::claim_funds to get it....
5407 * Note that if the preimage is not known or the amount paid is incorrect, you should call
5408 * ChannelManager::fail_htlc_backwards to free up resources for this HTLC and avoid
5409 * network congestion.
5410 * The amount paid should be considered 'incorrect' when it is less than or more than twice
5411 * the amount expected.
5412 * If you fail to call either ChannelManager::claim_funds or
5413 * ChannelManager::fail_htlc_backwards within the HTLC's timeout, the HTLC will be
5414 * automatically failed.
5416 LDKEvent_PaymentReceived,
5418 * Indicates an outbound payment we made succeeded (ie it made it all the way to its target
5419 * and we got back the payment preimage for it).
5421 LDKEvent_PaymentSent,
5423 * Indicates an outbound payment we made failed. Probably some intermediary node dropped
5424 * something. You may wish to retry with a different route.
5426 LDKEvent_PaymentFailed,
5428 * Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
5429 * time in the future.
5431 LDKEvent_PendingHTLCsForwardable,
5433 * Used to indicate that an output which you should know how to spend was confirmed on chain
5434 * and is now spendable.
5435 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
5436 * counterparty spending them due to some kind of timeout. Thus, you need to store them
5437 * somewhere and spend them when you create on-chain transactions.
5439 LDKEvent_SpendableOutputs,
5441 * Must be last for serialization purposes
5446 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
5448 * The random channel_id we picked which you'll need to pass into
5449 * ChannelManager::funding_transaction_generated.
5451 struct LDKThirtyTwoBytes temporary_channel_id;
5453 * The value, in satoshis, that the output should have.
5455 uint64_t channel_value_satoshis;
5457 * The script which should be used in the transaction output.
5459 struct LDKCVec_u8Z output_script;
5461 * The value passed in to ChannelManager::create_channel
5463 uint64_t user_channel_id;
5464 } LDKEvent_LDKFundingGenerationReady_Body;
5466 typedef struct LDKEvent_LDKPaymentReceived_Body {
5468 * The hash for which the preimage should be handed to the ChannelManager.
5470 struct LDKThirtyTwoBytes payment_hash;
5472 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
5473 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
5474 * [`ChannelManager::claim_funds`].
5476 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
5477 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
5479 struct LDKThirtyTwoBytes payment_preimage;
5481 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
5482 * number of deanonymization attacks during the routing process.
5483 * It is provided here for your reference, however its accuracy is enforced directly by
5484 * [`ChannelManager`] using the values you previously provided to
5485 * [`ChannelManager::create_inbound_payment`] or
5486 * [`ChannelManager::create_inbound_payment_for_hash`].
5488 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
5489 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
5490 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
5492 struct LDKThirtyTwoBytes payment_secret;
5494 * The value, in thousandths of a satoshi, that this payment is for. Note that you must
5495 * compare this to the expected value before accepting the payment (as otherwise you are
5496 * providing proof-of-payment for less than the value you expected!).
5500 * This is the `user_payment_id` which was provided to
5501 * [`ChannelManager::create_inbound_payment_for_hash`] or
5502 * [`ChannelManager::create_inbound_payment`]. It has no meaning inside of LDK and is
5503 * simply copied here. It may be used to correlate PaymentReceived events with invoice
5504 * metadata stored elsewhere.
5506 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
5507 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
5509 uint64_t user_payment_id;
5510 } LDKEvent_LDKPaymentReceived_Body;
5512 typedef struct LDKEvent_LDKPaymentSent_Body {
5514 * The preimage to the hash given to ChannelManager::send_payment.
5515 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
5518 struct LDKThirtyTwoBytes payment_preimage;
5519 } LDKEvent_LDKPaymentSent_Body;
5521 typedef struct LDKEvent_LDKPaymentFailed_Body {
5523 * The hash which was given to ChannelManager::send_payment.
5525 struct LDKThirtyTwoBytes payment_hash;
5527 * Indicates the payment was rejected for some reason by the recipient. This implies that
5528 * the payment has failed, not just the route in question. If this is not set, you may
5529 * retry the payment via a different route.
5531 bool rejected_by_dest;
5532 } LDKEvent_LDKPaymentFailed_Body;
5534 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
5536 * The minimum amount of time that should be waited prior to calling
5537 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
5538 * you should wait a random amount of time in roughly the range (now + time_forwardable,
5539 * now + 5*time_forwardable).
5541 uint64_t time_forwardable;
5542 } LDKEvent_LDKPendingHTLCsForwardable_Body;
5544 typedef struct LDKEvent_LDKSpendableOutputs_Body {
5546 * The outputs which you should store as spendable by you.
5548 struct LDKCVec_SpendableOutputDescriptorZ outputs;
5549 } LDKEvent_LDKSpendableOutputs_Body;
5551 typedef struct MUST_USE_STRUCT LDKEvent {
5554 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
5555 LDKEvent_LDKPaymentReceived_Body payment_received;
5556 LDKEvent_LDKPaymentSent_Body payment_sent;
5557 LDKEvent_LDKPaymentFailed_Body payment_failed;
5558 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
5559 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
5564 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
5565 * This corresponds to std::vector in C++
5567 typedef struct LDKCVec_EventZ {
5569 * The elements in the array.
5570 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5572 struct LDKEvent *data;
5574 * The number of elements pointed to by `data`.
5580 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
5581 * This corresponds to std::vector in C++
5583 typedef struct LDKCVec_TransactionZ {
5585 * The elements in the array.
5586 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5588 struct LDKTransaction *data;
5590 * The number of elements pointed to by `data`.
5593 } LDKCVec_TransactionZ;
5596 * A tuple of 2 elements. See the individual fields for the types contained.
5598 typedef struct LDKC2Tuple_u32TxOutZ {
5600 * The element at position 0
5604 * The element at position 1
5607 } LDKC2Tuple_u32TxOutZ;
5610 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
5611 * This corresponds to std::vector in C++
5613 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
5615 * The elements in the array.
5616 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5618 struct LDKC2Tuple_u32TxOutZ *data;
5620 * The number of elements pointed to by `data`.
5623 } LDKCVec_C2Tuple_u32TxOutZZ;
5626 * A tuple of 2 elements. See the individual fields for the types contained.
5628 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
5630 * The element at position 0
5632 struct LDKThirtyTwoBytes a;
5634 * The element at position 1
5636 struct LDKCVec_C2Tuple_u32TxOutZZ b;
5637 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
5640 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
5641 * This corresponds to std::vector in C++
5643 typedef struct LDKCVec_TransactionOutputsZ {
5645 * The elements in the array.
5646 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5648 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
5650 * The number of elements pointed to by `data`.
5653 } LDKCVec_TransactionOutputsZ;
5656 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
5658 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
5660 * A pointer to the contents in the success state.
5661 * Reading from this pointer when `result_ok` is not set is undefined.
5663 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
5665 * A pointer to the contents in the error state.
5666 * Reading from this pointer when `result_ok` is set is undefined.
5668 struct LDKDecodeError *err;
5669 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
5672 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
5673 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
5674 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5676 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
5678 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
5679 * `err` or `result` depending on the state of `result_ok`.
5681 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
5683 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
5686 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
5689 * The contents of CResult_boolLightningErrorZ
5691 typedef union LDKCResult_boolLightningErrorZPtr {
5693 * A pointer to the contents in the success state.
5694 * Reading from this pointer when `result_ok` is not set is undefined.
5698 * A pointer to the contents in the error state.
5699 * Reading from this pointer when `result_ok` is set is undefined.
5701 struct LDKLightningError *err;
5702 } LDKCResult_boolLightningErrorZPtr;
5705 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
5706 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
5707 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5709 typedef struct LDKCResult_boolLightningErrorZ {
5711 * The contents of this CResult_boolLightningErrorZ, accessible via either
5712 * `err` or `result` depending on the state of `result_ok`.
5714 union LDKCResult_boolLightningErrorZPtr contents;
5716 * Whether this CResult_boolLightningErrorZ represents a success state.
5719 } LDKCResult_boolLightningErrorZ;
5722 * A tuple of 3 elements. See the individual fields for the types contained.
5724 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
5726 * The element at position 0
5728 struct LDKChannelAnnouncement a;
5730 * The element at position 1
5732 struct LDKChannelUpdate b;
5734 * The element at position 2
5736 struct LDKChannelUpdate c;
5737 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
5740 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
5741 * This corresponds to std::vector in C++
5743 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
5745 * The elements in the array.
5746 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5748 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
5750 * The number of elements pointed to by `data`.
5753 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
5756 * A dynamically-allocated array of crate::lightning::ln::msgs::NodeAnnouncements of arbitrary size.
5757 * This corresponds to std::vector in C++
5759 typedef struct LDKCVec_NodeAnnouncementZ {
5761 * The elements in the array.
5762 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5764 struct LDKNodeAnnouncement *data;
5766 * The number of elements pointed to by `data`.
5769 } LDKCVec_NodeAnnouncementZ;
5772 * The contents of CResult_NoneLightningErrorZ
5774 typedef union LDKCResult_NoneLightningErrorZPtr {
5776 * Note that this value is always NULL, as there are no contents in the OK variant
5780 * A pointer to the contents in the error state.
5781 * Reading from this pointer when `result_ok` is set is undefined.
5783 struct LDKLightningError *err;
5784 } LDKCResult_NoneLightningErrorZPtr;
5787 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
5788 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
5789 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5791 typedef struct LDKCResult_NoneLightningErrorZ {
5793 * The contents of this CResult_NoneLightningErrorZ, accessible via either
5794 * `err` or `result` depending on the state of `result_ok`.
5796 union LDKCResult_NoneLightningErrorZPtr contents;
5798 * Whether this CResult_NoneLightningErrorZ represents a success state.
5801 } LDKCResult_NoneLightningErrorZ;
5804 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
5805 * This corresponds to std::vector in C++
5807 typedef struct LDKCVec_PublicKeyZ {
5809 * The elements in the array.
5810 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5812 struct LDKPublicKey *data;
5814 * The number of elements pointed to by `data`.
5817 } LDKCVec_PublicKeyZ;
5822 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
5823 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
5826 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
5828 * A pointer to the opaque Rust object.
5829 * Nearly everywhere, inner must be non-null, however in places where
5830 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5832 LDKnativePeerHandleError *inner;
5834 * Indicates that this is the only struct which contains the same pointer.
5835 * Rust functions which take ownership of an object provided via an argument require
5836 * this to be true and invalidate the object pointed to by inner.
5839 } LDKPeerHandleError;
5842 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
5844 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
5846 * A pointer to the contents in the success state.
5847 * Reading from this pointer when `result_ok` is not set is undefined.
5849 struct LDKCVec_u8Z *result;
5851 * A pointer to the contents in the error state.
5852 * Reading from this pointer when `result_ok` is set is undefined.
5854 struct LDKPeerHandleError *err;
5855 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
5858 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
5859 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
5860 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5862 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
5864 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
5865 * `err` or `result` depending on the state of `result_ok`.
5867 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
5869 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
5872 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
5875 * The contents of CResult_NonePeerHandleErrorZ
5877 typedef union LDKCResult_NonePeerHandleErrorZPtr {
5879 * Note that this value is always NULL, as there are no contents in the OK variant
5883 * A pointer to the contents in the error state.
5884 * Reading from this pointer when `result_ok` is set is undefined.
5886 struct LDKPeerHandleError *err;
5887 } LDKCResult_NonePeerHandleErrorZPtr;
5890 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
5891 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
5892 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5894 typedef struct LDKCResult_NonePeerHandleErrorZ {
5896 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
5897 * `err` or `result` depending on the state of `result_ok`.
5899 union LDKCResult_NonePeerHandleErrorZPtr contents;
5901 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
5904 } LDKCResult_NonePeerHandleErrorZ;
5907 * The contents of CResult_boolPeerHandleErrorZ
5909 typedef union LDKCResult_boolPeerHandleErrorZPtr {
5911 * A pointer to the contents in the success state.
5912 * Reading from this pointer when `result_ok` is not set is undefined.
5916 * A pointer to the contents in the error state.
5917 * Reading from this pointer when `result_ok` is set is undefined.
5919 struct LDKPeerHandleError *err;
5920 } LDKCResult_boolPeerHandleErrorZPtr;
5923 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
5924 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
5925 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5927 typedef struct LDKCResult_boolPeerHandleErrorZ {
5929 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
5930 * `err` or `result` depending on the state of `result_ok`.
5932 union LDKCResult_boolPeerHandleErrorZPtr contents;
5934 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
5937 } LDKCResult_boolPeerHandleErrorZ;
5942 * Details about one direction of a channel. Received
5943 * within a channel update.
5945 typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
5947 * A pointer to the opaque Rust object.
5948 * Nearly everywhere, inner must be non-null, however in places where
5949 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5951 LDKnativeDirectionalChannelInfo *inner;
5953 * Indicates that this is the only struct which contains the same pointer.
5954 * Rust functions which take ownership of an object provided via an argument require
5955 * this to be true and invalidate the object pointed to by inner.
5958 } LDKDirectionalChannelInfo;
5961 * The contents of CResult_DirectionalChannelInfoDecodeErrorZ
5963 typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr {
5965 * A pointer to the contents in the success state.
5966 * Reading from this pointer when `result_ok` is not set is undefined.
5968 struct LDKDirectionalChannelInfo *result;
5970 * A pointer to the contents in the error state.
5971 * Reading from this pointer when `result_ok` is set is undefined.
5973 struct LDKDecodeError *err;
5974 } LDKCResult_DirectionalChannelInfoDecodeErrorZPtr;
5977 * A CResult_DirectionalChannelInfoDecodeErrorZ represents the result of a fallible operation,
5978 * containing a crate::lightning::routing::network_graph::DirectionalChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5979 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5981 typedef struct LDKCResult_DirectionalChannelInfoDecodeErrorZ {
5983 * The contents of this CResult_DirectionalChannelInfoDecodeErrorZ, accessible via either
5984 * `err` or `result` depending on the state of `result_ok`.
5986 union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents;
5988 * Whether this CResult_DirectionalChannelInfoDecodeErrorZ represents a success state.
5991 } LDKCResult_DirectionalChannelInfoDecodeErrorZ;
5996 * Details about a channel (both directions).
5997 * Received within a channel announcement.
5999 typedef struct MUST_USE_STRUCT LDKChannelInfo {
6001 * A pointer to the opaque Rust object.
6002 * Nearly everywhere, inner must be non-null, however in places where
6003 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6005 LDKnativeChannelInfo *inner;
6007 * Indicates that this is the only struct which contains the same pointer.
6008 * Rust functions which take ownership of an object provided via an argument require
6009 * this to be true and invalidate the object pointed to by inner.
6015 * The contents of CResult_ChannelInfoDecodeErrorZ
6017 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
6019 * A pointer to the contents in the success state.
6020 * Reading from this pointer when `result_ok` is not set is undefined.
6022 struct LDKChannelInfo *result;
6024 * A pointer to the contents in the error state.
6025 * Reading from this pointer when `result_ok` is set is undefined.
6027 struct LDKDecodeError *err;
6028 } LDKCResult_ChannelInfoDecodeErrorZPtr;
6031 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
6032 * containing a crate::lightning::routing::network_graph::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6033 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6035 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
6037 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
6038 * `err` or `result` depending on the state of `result_ok`.
6040 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
6042 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
6045 } LDKCResult_ChannelInfoDecodeErrorZ;
6050 * Fees for routing via a given channel or a node
6052 typedef struct MUST_USE_STRUCT LDKRoutingFees {
6054 * A pointer to the opaque Rust object.
6055 * Nearly everywhere, inner must be non-null, however in places where
6056 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6058 LDKnativeRoutingFees *inner;
6060 * Indicates that this is the only struct which contains the same pointer.
6061 * Rust functions which take ownership of an object provided via an argument require
6062 * this to be true and invalidate the object pointed to by inner.
6068 * The contents of CResult_RoutingFeesDecodeErrorZ
6070 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
6072 * A pointer to the contents in the success state.
6073 * Reading from this pointer when `result_ok` is not set is undefined.
6075 struct LDKRoutingFees *result;
6077 * A pointer to the contents in the error state.
6078 * Reading from this pointer when `result_ok` is set is undefined.
6080 struct LDKDecodeError *err;
6081 } LDKCResult_RoutingFeesDecodeErrorZPtr;
6084 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
6085 * containing a crate::lightning::routing::network_graph::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
6086 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6088 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
6090 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
6091 * `err` or `result` depending on the state of `result_ok`.
6093 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
6095 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
6098 } LDKCResult_RoutingFeesDecodeErrorZ;
6103 * Information received in the latest node_announcement from this node.
6105 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
6107 * A pointer to the opaque Rust object.
6108 * Nearly everywhere, inner must be non-null, however in places where
6109 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6111 LDKnativeNodeAnnouncementInfo *inner;
6113 * Indicates that this is the only struct which contains the same pointer.
6114 * Rust functions which take ownership of an object provided via an argument require
6115 * this to be true and invalidate the object pointed to by inner.
6118 } LDKNodeAnnouncementInfo;
6121 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
6123 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
6125 * A pointer to the contents in the success state.
6126 * Reading from this pointer when `result_ok` is not set is undefined.
6128 struct LDKNodeAnnouncementInfo *result;
6130 * A pointer to the contents in the error state.
6131 * Reading from this pointer when `result_ok` is set is undefined.
6133 struct LDKDecodeError *err;
6134 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
6137 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
6138 * containing a crate::lightning::routing::network_graph::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6139 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6141 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
6143 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
6144 * `err` or `result` depending on the state of `result_ok`.
6146 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
6148 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
6151 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
6154 * A dynamically-allocated array of u64s of arbitrary size.
6155 * This corresponds to std::vector in C++
6157 typedef struct LDKCVec_u64Z {
6159 * The elements in the array.
6160 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6164 * The number of elements pointed to by `data`.
6172 * Details about a node in the network, known from the network announcement.
6174 typedef struct MUST_USE_STRUCT LDKNodeInfo {
6176 * A pointer to the opaque Rust object.
6177 * Nearly everywhere, inner must be non-null, however in places where
6178 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6180 LDKnativeNodeInfo *inner;
6182 * Indicates that this is the only struct which contains the same pointer.
6183 * Rust functions which take ownership of an object provided via an argument require
6184 * this to be true and invalidate the object pointed to by inner.
6190 * The contents of CResult_NodeInfoDecodeErrorZ
6192 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
6194 * A pointer to the contents in the success state.
6195 * Reading from this pointer when `result_ok` is not set is undefined.
6197 struct LDKNodeInfo *result;
6199 * A pointer to the contents in the error state.
6200 * Reading from this pointer when `result_ok` is set is undefined.
6202 struct LDKDecodeError *err;
6203 } LDKCResult_NodeInfoDecodeErrorZPtr;
6206 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
6207 * containing a crate::lightning::routing::network_graph::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6208 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6210 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
6212 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
6213 * `err` or `result` depending on the state of `result_ok`.
6215 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
6217 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
6220 } LDKCResult_NodeInfoDecodeErrorZ;
6225 * Represents the network as nodes and channels between them
6227 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
6229 * A pointer to the opaque Rust object.
6230 * Nearly everywhere, inner must be non-null, however in places where
6231 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6233 LDKnativeNetworkGraph *inner;
6235 * Indicates that this is the only struct which contains the same pointer.
6236 * Rust functions which take ownership of an object provided via an argument require
6237 * this to be true and invalidate the object pointed to by inner.
6243 * The contents of CResult_NetworkGraphDecodeErrorZ
6245 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
6247 * A pointer to the contents in the success state.
6248 * Reading from this pointer when `result_ok` is not set is undefined.
6250 struct LDKNetworkGraph *result;
6252 * A pointer to the contents in the error state.
6253 * Reading from this pointer when `result_ok` is set is undefined.
6255 struct LDKDecodeError *err;
6256 } LDKCResult_NetworkGraphDecodeErrorZPtr;
6259 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
6260 * containing a crate::lightning::routing::network_graph::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
6261 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6263 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
6265 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
6266 * `err` or `result` depending on the state of `result_ok`.
6268 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
6270 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
6273 } LDKCResult_NetworkGraphDecodeErrorZ;
6276 * The contents of CResult_NetAddressu8Z
6278 typedef union LDKCResult_NetAddressu8ZPtr {
6280 * A pointer to the contents in the success state.
6281 * Reading from this pointer when `result_ok` is not set is undefined.
6283 struct LDKNetAddress *result;
6285 * A pointer to the contents in the error state.
6286 * Reading from this pointer when `result_ok` is set is undefined.
6289 } LDKCResult_NetAddressu8ZPtr;
6292 * A CResult_NetAddressu8Z represents the result of a fallible operation,
6293 * containing a crate::lightning::ln::msgs::NetAddress on success and a u8 on failure.
6294 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6296 typedef struct LDKCResult_NetAddressu8Z {
6298 * The contents of this CResult_NetAddressu8Z, accessible via either
6299 * `err` or `result` depending on the state of `result_ok`.
6301 union LDKCResult_NetAddressu8ZPtr contents;
6303 * Whether this CResult_NetAddressu8Z represents a success state.
6306 } LDKCResult_NetAddressu8Z;
6309 * The contents of CResult_CResult_NetAddressu8ZDecodeErrorZ
6311 typedef union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr {
6313 * A pointer to the contents in the success state.
6314 * Reading from this pointer when `result_ok` is not set is undefined.
6316 struct LDKCResult_NetAddressu8Z *result;
6318 * A pointer to the contents in the error state.
6319 * Reading from this pointer when `result_ok` is set is undefined.
6321 struct LDKDecodeError *err;
6322 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr;
6325 * A CResult_CResult_NetAddressu8ZDecodeErrorZ represents the result of a fallible operation,
6326 * containing a crate::c_types::derived::CResult_NetAddressu8Z on success and a crate::lightning::ln::msgs::DecodeError on failure.
6327 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6329 typedef struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ {
6331 * The contents of this CResult_CResult_NetAddressu8ZDecodeErrorZ, accessible via either
6332 * `err` or `result` depending on the state of `result_ok`.
6334 union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr contents;
6336 * Whether this CResult_CResult_NetAddressu8ZDecodeErrorZ represents a success state.
6339 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZ;
6342 * The contents of CResult_NetAddressDecodeErrorZ
6344 typedef union LDKCResult_NetAddressDecodeErrorZPtr {
6346 * A pointer to the contents in the success state.
6347 * Reading from this pointer when `result_ok` is not set is undefined.
6349 struct LDKNetAddress *result;
6351 * A pointer to the contents in the error state.
6352 * Reading from this pointer when `result_ok` is set is undefined.
6354 struct LDKDecodeError *err;
6355 } LDKCResult_NetAddressDecodeErrorZPtr;
6358 * A CResult_NetAddressDecodeErrorZ represents the result of a fallible operation,
6359 * containing a crate::lightning::ln::msgs::NetAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
6360 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6362 typedef struct LDKCResult_NetAddressDecodeErrorZ {
6364 * The contents of this CResult_NetAddressDecodeErrorZ, accessible via either
6365 * `err` or `result` depending on the state of `result_ok`.
6367 union LDKCResult_NetAddressDecodeErrorZPtr contents;
6369 * Whether this CResult_NetAddressDecodeErrorZ represents a success state.
6372 } LDKCResult_NetAddressDecodeErrorZ;
6377 * An update_add_htlc message to be sent or received from a peer
6379 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
6381 * A pointer to the opaque Rust object.
6382 * Nearly everywhere, inner must be non-null, however in places where
6383 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6385 LDKnativeUpdateAddHTLC *inner;
6387 * Indicates that this is the only struct which contains the same pointer.
6388 * Rust functions which take ownership of an object provided via an argument require
6389 * this to be true and invalidate the object pointed to by inner.
6395 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
6396 * This corresponds to std::vector in C++
6398 typedef struct LDKCVec_UpdateAddHTLCZ {
6400 * The elements in the array.
6401 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6403 struct LDKUpdateAddHTLC *data;
6405 * The number of elements pointed to by `data`.
6408 } LDKCVec_UpdateAddHTLCZ;
6413 * An update_fulfill_htlc message to be sent or received from a peer
6415 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
6417 * A pointer to the opaque Rust object.
6418 * Nearly everywhere, inner must be non-null, however in places where
6419 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6421 LDKnativeUpdateFulfillHTLC *inner;
6423 * Indicates that this is the only struct which contains the same pointer.
6424 * Rust functions which take ownership of an object provided via an argument require
6425 * this to be true and invalidate the object pointed to by inner.
6428 } LDKUpdateFulfillHTLC;
6431 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
6432 * This corresponds to std::vector in C++
6434 typedef struct LDKCVec_UpdateFulfillHTLCZ {
6436 * The elements in the array.
6437 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6439 struct LDKUpdateFulfillHTLC *data;
6441 * The number of elements pointed to by `data`.
6444 } LDKCVec_UpdateFulfillHTLCZ;
6449 * An update_fail_htlc message to be sent or received from a peer
6451 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
6453 * A pointer to the opaque Rust object.
6454 * Nearly everywhere, inner must be non-null, however in places where
6455 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6457 LDKnativeUpdateFailHTLC *inner;
6459 * Indicates that this is the only struct which contains the same pointer.
6460 * Rust functions which take ownership of an object provided via an argument require
6461 * this to be true and invalidate the object pointed to by inner.
6464 } LDKUpdateFailHTLC;
6467 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
6468 * This corresponds to std::vector in C++
6470 typedef struct LDKCVec_UpdateFailHTLCZ {
6472 * The elements in the array.
6473 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6475 struct LDKUpdateFailHTLC *data;
6477 * The number of elements pointed to by `data`.
6480 } LDKCVec_UpdateFailHTLCZ;
6485 * An update_fail_malformed_htlc message to be sent or received from a peer
6487 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
6489 * A pointer to the opaque Rust object.
6490 * Nearly everywhere, inner must be non-null, however in places where
6491 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6493 LDKnativeUpdateFailMalformedHTLC *inner;
6495 * Indicates that this is the only struct which contains the same pointer.
6496 * Rust functions which take ownership of an object provided via an argument require
6497 * this to be true and invalidate the object pointed to by inner.
6500 } LDKUpdateFailMalformedHTLC;
6503 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
6504 * This corresponds to std::vector in C++
6506 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
6508 * The elements in the array.
6509 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6511 struct LDKUpdateFailMalformedHTLC *data;
6513 * The number of elements pointed to by `data`.
6516 } LDKCVec_UpdateFailMalformedHTLCZ;
6519 * The contents of CResult_AcceptChannelDecodeErrorZ
6521 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
6523 * A pointer to the contents in the success state.
6524 * Reading from this pointer when `result_ok` is not set is undefined.
6526 struct LDKAcceptChannel *result;
6528 * A pointer to the contents in the error state.
6529 * Reading from this pointer when `result_ok` is set is undefined.
6531 struct LDKDecodeError *err;
6532 } LDKCResult_AcceptChannelDecodeErrorZPtr;
6535 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
6536 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
6537 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6539 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
6541 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
6542 * `err` or `result` depending on the state of `result_ok`.
6544 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
6546 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
6549 } LDKCResult_AcceptChannelDecodeErrorZ;
6552 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
6554 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
6556 * A pointer to the contents in the success state.
6557 * Reading from this pointer when `result_ok` is not set is undefined.
6559 struct LDKAnnouncementSignatures *result;
6561 * A pointer to the contents in the error state.
6562 * Reading from this pointer when `result_ok` is set is undefined.
6564 struct LDKDecodeError *err;
6565 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
6568 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
6569 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6570 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6572 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
6574 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
6575 * `err` or `result` depending on the state of `result_ok`.
6577 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
6579 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
6582 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
6585 * The contents of CResult_ChannelReestablishDecodeErrorZ
6587 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
6589 * A pointer to the contents in the success state.
6590 * Reading from this pointer when `result_ok` is not set is undefined.
6592 struct LDKChannelReestablish *result;
6594 * A pointer to the contents in the error state.
6595 * Reading from this pointer when `result_ok` is set is undefined.
6597 struct LDKDecodeError *err;
6598 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
6601 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
6602 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
6603 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6605 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
6607 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
6608 * `err` or `result` depending on the state of `result_ok`.
6610 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
6612 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
6615 } LDKCResult_ChannelReestablishDecodeErrorZ;
6618 * The contents of CResult_ClosingSignedDecodeErrorZ
6620 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
6622 * A pointer to the contents in the success state.
6623 * Reading from this pointer when `result_ok` is not set is undefined.
6625 struct LDKClosingSigned *result;
6627 * A pointer to the contents in the error state.
6628 * Reading from this pointer when `result_ok` is set is undefined.
6630 struct LDKDecodeError *err;
6631 } LDKCResult_ClosingSignedDecodeErrorZPtr;
6634 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
6635 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
6636 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6638 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
6640 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
6641 * `err` or `result` depending on the state of `result_ok`.
6643 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
6645 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
6648 } LDKCResult_ClosingSignedDecodeErrorZ;
6653 * A commitment_signed message to be sent or received from a peer
6655 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
6657 * A pointer to the opaque Rust object.
6658 * Nearly everywhere, inner must be non-null, however in places where
6659 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6661 LDKnativeCommitmentSigned *inner;
6663 * Indicates that this is the only struct which contains the same pointer.
6664 * Rust functions which take ownership of an object provided via an argument require
6665 * this to be true and invalidate the object pointed to by inner.
6668 } LDKCommitmentSigned;
6671 * The contents of CResult_CommitmentSignedDecodeErrorZ
6673 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
6675 * A pointer to the contents in the success state.
6676 * Reading from this pointer when `result_ok` is not set is undefined.
6678 struct LDKCommitmentSigned *result;
6680 * A pointer to the contents in the error state.
6681 * Reading from this pointer when `result_ok` is set is undefined.
6683 struct LDKDecodeError *err;
6684 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
6687 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
6688 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
6689 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6691 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
6693 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
6694 * `err` or `result` depending on the state of `result_ok`.
6696 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
6698 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
6701 } LDKCResult_CommitmentSignedDecodeErrorZ;
6704 * The contents of CResult_FundingCreatedDecodeErrorZ
6706 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
6708 * A pointer to the contents in the success state.
6709 * Reading from this pointer when `result_ok` is not set is undefined.
6711 struct LDKFundingCreated *result;
6713 * A pointer to the contents in the error state.
6714 * Reading from this pointer when `result_ok` is set is undefined.
6716 struct LDKDecodeError *err;
6717 } LDKCResult_FundingCreatedDecodeErrorZPtr;
6720 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
6721 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
6722 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6724 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
6726 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
6727 * `err` or `result` depending on the state of `result_ok`.
6729 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
6731 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
6734 } LDKCResult_FundingCreatedDecodeErrorZ;
6737 * The contents of CResult_FundingSignedDecodeErrorZ
6739 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
6741 * A pointer to the contents in the success state.
6742 * Reading from this pointer when `result_ok` is not set is undefined.
6744 struct LDKFundingSigned *result;
6746 * A pointer to the contents in the error state.
6747 * Reading from this pointer when `result_ok` is set is undefined.
6749 struct LDKDecodeError *err;
6750 } LDKCResult_FundingSignedDecodeErrorZPtr;
6753 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
6754 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
6755 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6757 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
6759 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
6760 * `err` or `result` depending on the state of `result_ok`.
6762 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
6764 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
6767 } LDKCResult_FundingSignedDecodeErrorZ;
6770 * The contents of CResult_FundingLockedDecodeErrorZ
6772 typedef union LDKCResult_FundingLockedDecodeErrorZPtr {
6774 * A pointer to the contents in the success state.
6775 * Reading from this pointer when `result_ok` is not set is undefined.
6777 struct LDKFundingLocked *result;
6779 * A pointer to the contents in the error state.
6780 * Reading from this pointer when `result_ok` is set is undefined.
6782 struct LDKDecodeError *err;
6783 } LDKCResult_FundingLockedDecodeErrorZPtr;
6786 * A CResult_FundingLockedDecodeErrorZ represents the result of a fallible operation,
6787 * containing a crate::lightning::ln::msgs::FundingLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
6788 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6790 typedef struct LDKCResult_FundingLockedDecodeErrorZ {
6792 * The contents of this CResult_FundingLockedDecodeErrorZ, accessible via either
6793 * `err` or `result` depending on the state of `result_ok`.
6795 union LDKCResult_FundingLockedDecodeErrorZPtr contents;
6797 * Whether this CResult_FundingLockedDecodeErrorZ represents a success state.
6800 } LDKCResult_FundingLockedDecodeErrorZ;
6805 * An init message to be sent or received from a peer
6807 typedef struct MUST_USE_STRUCT LDKInit {
6809 * A pointer to the opaque Rust object.
6810 * Nearly everywhere, inner must be non-null, however in places where
6811 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6813 LDKnativeInit *inner;
6815 * Indicates that this is the only struct which contains the same pointer.
6816 * Rust functions which take ownership of an object provided via an argument require
6817 * this to be true and invalidate the object pointed to by inner.
6823 * The contents of CResult_InitDecodeErrorZ
6825 typedef union LDKCResult_InitDecodeErrorZPtr {
6827 * A pointer to the contents in the success state.
6828 * Reading from this pointer when `result_ok` is not set is undefined.
6830 struct LDKInit *result;
6832 * A pointer to the contents in the error state.
6833 * Reading from this pointer when `result_ok` is set is undefined.
6835 struct LDKDecodeError *err;
6836 } LDKCResult_InitDecodeErrorZPtr;
6839 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
6840 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
6841 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6843 typedef struct LDKCResult_InitDecodeErrorZ {
6845 * The contents of this CResult_InitDecodeErrorZ, accessible via either
6846 * `err` or `result` depending on the state of `result_ok`.
6848 union LDKCResult_InitDecodeErrorZPtr contents;
6850 * Whether this CResult_InitDecodeErrorZ represents a success state.
6853 } LDKCResult_InitDecodeErrorZ;
6856 * The contents of CResult_OpenChannelDecodeErrorZ
6858 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
6860 * A pointer to the contents in the success state.
6861 * Reading from this pointer when `result_ok` is not set is undefined.
6863 struct LDKOpenChannel *result;
6865 * A pointer to the contents in the error state.
6866 * Reading from this pointer when `result_ok` is set is undefined.
6868 struct LDKDecodeError *err;
6869 } LDKCResult_OpenChannelDecodeErrorZPtr;
6872 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
6873 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
6874 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6876 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
6878 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
6879 * `err` or `result` depending on the state of `result_ok`.
6881 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
6883 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
6886 } LDKCResult_OpenChannelDecodeErrorZ;
6889 * The contents of CResult_RevokeAndACKDecodeErrorZ
6891 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
6893 * A pointer to the contents in the success state.
6894 * Reading from this pointer when `result_ok` is not set is undefined.
6896 struct LDKRevokeAndACK *result;
6898 * A pointer to the contents in the error state.
6899 * Reading from this pointer when `result_ok` is set is undefined.
6901 struct LDKDecodeError *err;
6902 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
6905 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
6906 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
6907 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6909 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
6911 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
6912 * `err` or `result` depending on the state of `result_ok`.
6914 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
6916 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
6919 } LDKCResult_RevokeAndACKDecodeErrorZ;
6922 * The contents of CResult_ShutdownDecodeErrorZ
6924 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
6926 * A pointer to the contents in the success state.
6927 * Reading from this pointer when `result_ok` is not set is undefined.
6929 struct LDKShutdown *result;
6931 * A pointer to the contents in the error state.
6932 * Reading from this pointer when `result_ok` is set is undefined.
6934 struct LDKDecodeError *err;
6935 } LDKCResult_ShutdownDecodeErrorZPtr;
6938 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
6939 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
6940 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6942 typedef struct LDKCResult_ShutdownDecodeErrorZ {
6944 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
6945 * `err` or `result` depending on the state of `result_ok`.
6947 union LDKCResult_ShutdownDecodeErrorZPtr contents;
6949 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
6952 } LDKCResult_ShutdownDecodeErrorZ;
6955 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
6957 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
6959 * A pointer to the contents in the success state.
6960 * Reading from this pointer when `result_ok` is not set is undefined.
6962 struct LDKUpdateFailHTLC *result;
6964 * A pointer to the contents in the error state.
6965 * Reading from this pointer when `result_ok` is set is undefined.
6967 struct LDKDecodeError *err;
6968 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
6971 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
6972 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
6973 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6975 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
6977 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
6978 * `err` or `result` depending on the state of `result_ok`.
6980 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
6982 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
6985 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
6988 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
6990 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
6992 * A pointer to the contents in the success state.
6993 * Reading from this pointer when `result_ok` is not set is undefined.
6995 struct LDKUpdateFailMalformedHTLC *result;
6997 * A pointer to the contents in the error state.
6998 * Reading from this pointer when `result_ok` is set is undefined.
7000 struct LDKDecodeError *err;
7001 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
7004 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
7005 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
7006 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7008 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
7010 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
7011 * `err` or `result` depending on the state of `result_ok`.
7013 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
7015 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
7018 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
7023 * An update_fee message to be sent or received from a peer
7025 typedef struct MUST_USE_STRUCT LDKUpdateFee {
7027 * A pointer to the opaque Rust object.
7028 * Nearly everywhere, inner must be non-null, however in places where
7029 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7031 LDKnativeUpdateFee *inner;
7033 * Indicates that this is the only struct which contains the same pointer.
7034 * Rust functions which take ownership of an object provided via an argument require
7035 * this to be true and invalidate the object pointed to by inner.
7041 * The contents of CResult_UpdateFeeDecodeErrorZ
7043 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
7045 * A pointer to the contents in the success state.
7046 * Reading from this pointer when `result_ok` is not set is undefined.
7048 struct LDKUpdateFee *result;
7050 * A pointer to the contents in the error state.
7051 * Reading from this pointer when `result_ok` is set is undefined.
7053 struct LDKDecodeError *err;
7054 } LDKCResult_UpdateFeeDecodeErrorZPtr;
7057 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
7058 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
7059 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7061 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
7063 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
7064 * `err` or `result` depending on the state of `result_ok`.
7066 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
7068 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
7071 } LDKCResult_UpdateFeeDecodeErrorZ;
7074 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
7076 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
7078 * A pointer to the contents in the success state.
7079 * Reading from this pointer when `result_ok` is not set is undefined.
7081 struct LDKUpdateFulfillHTLC *result;
7083 * A pointer to the contents in the error state.
7084 * Reading from this pointer when `result_ok` is set is undefined.
7086 struct LDKDecodeError *err;
7087 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
7090 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
7091 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
7092 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7094 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
7096 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
7097 * `err` or `result` depending on the state of `result_ok`.
7099 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
7101 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
7104 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
7107 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
7109 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
7111 * A pointer to the contents in the success state.
7112 * Reading from this pointer when `result_ok` is not set is undefined.
7114 struct LDKUpdateAddHTLC *result;
7116 * A pointer to the contents in the error state.
7117 * Reading from this pointer when `result_ok` is set is undefined.
7119 struct LDKDecodeError *err;
7120 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
7123 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
7124 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
7125 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7127 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
7129 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
7130 * `err` or `result` depending on the state of `result_ok`.
7132 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
7134 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
7137 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
7142 * A ping message to be sent or received from a peer
7144 typedef struct MUST_USE_STRUCT LDKPing {
7146 * A pointer to the opaque Rust object.
7147 * Nearly everywhere, inner must be non-null, however in places where
7148 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7150 LDKnativePing *inner;
7152 * Indicates that this is the only struct which contains the same pointer.
7153 * Rust functions which take ownership of an object provided via an argument require
7154 * this to be true and invalidate the object pointed to by inner.
7160 * The contents of CResult_PingDecodeErrorZ
7162 typedef union LDKCResult_PingDecodeErrorZPtr {
7164 * A pointer to the contents in the success state.
7165 * Reading from this pointer when `result_ok` is not set is undefined.
7167 struct LDKPing *result;
7169 * A pointer to the contents in the error state.
7170 * Reading from this pointer when `result_ok` is set is undefined.
7172 struct LDKDecodeError *err;
7173 } LDKCResult_PingDecodeErrorZPtr;
7176 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
7177 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
7178 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7180 typedef struct LDKCResult_PingDecodeErrorZ {
7182 * The contents of this CResult_PingDecodeErrorZ, accessible via either
7183 * `err` or `result` depending on the state of `result_ok`.
7185 union LDKCResult_PingDecodeErrorZPtr contents;
7187 * Whether this CResult_PingDecodeErrorZ represents a success state.
7190 } LDKCResult_PingDecodeErrorZ;
7195 * A pong message to be sent or received from a peer
7197 typedef struct MUST_USE_STRUCT LDKPong {
7199 * A pointer to the opaque Rust object.
7200 * Nearly everywhere, inner must be non-null, however in places where
7201 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7203 LDKnativePong *inner;
7205 * Indicates that this is the only struct which contains the same pointer.
7206 * Rust functions which take ownership of an object provided via an argument require
7207 * this to be true and invalidate the object pointed to by inner.
7213 * The contents of CResult_PongDecodeErrorZ
7215 typedef union LDKCResult_PongDecodeErrorZPtr {
7217 * A pointer to the contents in the success state.
7218 * Reading from this pointer when `result_ok` is not set is undefined.
7220 struct LDKPong *result;
7222 * A pointer to the contents in the error state.
7223 * Reading from this pointer when `result_ok` is set is undefined.
7225 struct LDKDecodeError *err;
7226 } LDKCResult_PongDecodeErrorZPtr;
7229 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
7230 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
7231 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7233 typedef struct LDKCResult_PongDecodeErrorZ {
7235 * The contents of this CResult_PongDecodeErrorZ, accessible via either
7236 * `err` or `result` depending on the state of `result_ok`.
7238 union LDKCResult_PongDecodeErrorZPtr contents;
7240 * Whether this CResult_PongDecodeErrorZ represents a success state.
7243 } LDKCResult_PongDecodeErrorZ;
7246 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
7248 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
7250 * A pointer to the contents in the success state.
7251 * Reading from this pointer when `result_ok` is not set is undefined.
7253 struct LDKUnsignedChannelAnnouncement *result;
7255 * A pointer to the contents in the error state.
7256 * Reading from this pointer when `result_ok` is set is undefined.
7258 struct LDKDecodeError *err;
7259 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
7262 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
7263 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
7264 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7266 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
7268 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
7269 * `err` or `result` depending on the state of `result_ok`.
7271 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
7273 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
7276 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
7279 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
7281 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
7283 * A pointer to the contents in the success state.
7284 * Reading from this pointer when `result_ok` is not set is undefined.
7286 struct LDKChannelAnnouncement *result;
7288 * A pointer to the contents in the error state.
7289 * Reading from this pointer when `result_ok` is set is undefined.
7291 struct LDKDecodeError *err;
7292 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
7295 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
7296 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
7297 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7299 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
7301 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
7302 * `err` or `result` depending on the state of `result_ok`.
7304 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
7306 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
7309 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
7314 * The unsigned part of a channel_update
7316 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
7318 * A pointer to the opaque Rust object.
7319 * Nearly everywhere, inner must be non-null, however in places where
7320 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7322 LDKnativeUnsignedChannelUpdate *inner;
7324 * Indicates that this is the only struct which contains the same pointer.
7325 * Rust functions which take ownership of an object provided via an argument require
7326 * this to be true and invalidate the object pointed to by inner.
7329 } LDKUnsignedChannelUpdate;
7332 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
7334 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
7336 * A pointer to the contents in the success state.
7337 * Reading from this pointer when `result_ok` is not set is undefined.
7339 struct LDKUnsignedChannelUpdate *result;
7341 * A pointer to the contents in the error state.
7342 * Reading from this pointer when `result_ok` is set is undefined.
7344 struct LDKDecodeError *err;
7345 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
7348 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
7349 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
7350 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7352 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
7354 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
7355 * `err` or `result` depending on the state of `result_ok`.
7357 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
7359 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
7362 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
7365 * The contents of CResult_ChannelUpdateDecodeErrorZ
7367 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
7369 * A pointer to the contents in the success state.
7370 * Reading from this pointer when `result_ok` is not set is undefined.
7372 struct LDKChannelUpdate *result;
7374 * A pointer to the contents in the error state.
7375 * Reading from this pointer when `result_ok` is set is undefined.
7377 struct LDKDecodeError *err;
7378 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
7381 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
7382 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
7383 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7385 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
7387 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
7388 * `err` or `result` depending on the state of `result_ok`.
7390 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
7392 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
7395 } LDKCResult_ChannelUpdateDecodeErrorZ;
7398 * The contents of CResult_ErrorMessageDecodeErrorZ
7400 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
7402 * A pointer to the contents in the success state.
7403 * Reading from this pointer when `result_ok` is not set is undefined.
7405 struct LDKErrorMessage *result;
7407 * A pointer to the contents in the error state.
7408 * Reading from this pointer when `result_ok` is set is undefined.
7410 struct LDKDecodeError *err;
7411 } LDKCResult_ErrorMessageDecodeErrorZPtr;
7414 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
7415 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
7416 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7418 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
7420 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
7421 * `err` or `result` depending on the state of `result_ok`.
7423 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
7425 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
7428 } LDKCResult_ErrorMessageDecodeErrorZ;
7433 * The unsigned part of a node_announcement
7435 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
7437 * A pointer to the opaque Rust object.
7438 * Nearly everywhere, inner must be non-null, however in places where
7439 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7441 LDKnativeUnsignedNodeAnnouncement *inner;
7443 * Indicates that this is the only struct which contains the same pointer.
7444 * Rust functions which take ownership of an object provided via an argument require
7445 * this to be true and invalidate the object pointed to by inner.
7448 } LDKUnsignedNodeAnnouncement;
7451 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
7453 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
7455 * A pointer to the contents in the success state.
7456 * Reading from this pointer when `result_ok` is not set is undefined.
7458 struct LDKUnsignedNodeAnnouncement *result;
7460 * A pointer to the contents in the error state.
7461 * Reading from this pointer when `result_ok` is set is undefined.
7463 struct LDKDecodeError *err;
7464 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
7467 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
7468 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
7469 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7471 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
7473 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
7474 * `err` or `result` depending on the state of `result_ok`.
7476 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
7478 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
7481 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
7484 * The contents of CResult_NodeAnnouncementDecodeErrorZ
7486 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
7488 * A pointer to the contents in the success state.
7489 * Reading from this pointer when `result_ok` is not set is undefined.
7491 struct LDKNodeAnnouncement *result;
7493 * A pointer to the contents in the error state.
7494 * Reading from this pointer when `result_ok` is set is undefined.
7496 struct LDKDecodeError *err;
7497 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
7500 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
7501 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
7502 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7504 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
7506 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
7507 * `err` or `result` depending on the state of `result_ok`.
7509 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
7511 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
7514 } LDKCResult_NodeAnnouncementDecodeErrorZ;
7517 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
7519 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
7521 * A pointer to the contents in the success state.
7522 * Reading from this pointer when `result_ok` is not set is undefined.
7524 struct LDKQueryShortChannelIds *result;
7526 * A pointer to the contents in the error state.
7527 * Reading from this pointer when `result_ok` is set is undefined.
7529 struct LDKDecodeError *err;
7530 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
7533 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
7534 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
7535 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7537 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
7539 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
7540 * `err` or `result` depending on the state of `result_ok`.
7542 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
7544 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
7547 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
7552 * A reply_short_channel_ids_end message is sent as a reply to a
7553 * query_short_channel_ids message. The query recipient makes a best
7554 * effort to respond based on their local network view which may not be
7555 * a perfect view of the network.
7557 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
7559 * A pointer to the opaque Rust object.
7560 * Nearly everywhere, inner must be non-null, however in places where
7561 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7563 LDKnativeReplyShortChannelIdsEnd *inner;
7565 * Indicates that this is the only struct which contains the same pointer.
7566 * Rust functions which take ownership of an object provided via an argument require
7567 * this to be true and invalidate the object pointed to by inner.
7570 } LDKReplyShortChannelIdsEnd;
7573 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
7575 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
7577 * A pointer to the contents in the success state.
7578 * Reading from this pointer when `result_ok` is not set is undefined.
7580 struct LDKReplyShortChannelIdsEnd *result;
7582 * A pointer to the contents in the error state.
7583 * Reading from this pointer when `result_ok` is set is undefined.
7585 struct LDKDecodeError *err;
7586 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
7589 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
7590 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
7591 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7593 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
7595 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
7596 * `err` or `result` depending on the state of `result_ok`.
7598 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
7600 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
7603 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
7606 * The contents of CResult_QueryChannelRangeDecodeErrorZ
7608 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
7610 * A pointer to the contents in the success state.
7611 * Reading from this pointer when `result_ok` is not set is undefined.
7613 struct LDKQueryChannelRange *result;
7615 * A pointer to the contents in the error state.
7616 * Reading from this pointer when `result_ok` is set is undefined.
7618 struct LDKDecodeError *err;
7619 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
7622 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
7623 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
7624 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7626 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
7628 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
7629 * `err` or `result` depending on the state of `result_ok`.
7631 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
7633 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
7636 } LDKCResult_QueryChannelRangeDecodeErrorZ;
7639 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
7641 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
7643 * A pointer to the contents in the success state.
7644 * Reading from this pointer when `result_ok` is not set is undefined.
7646 struct LDKReplyChannelRange *result;
7648 * A pointer to the contents in the error state.
7649 * Reading from this pointer when `result_ok` is set is undefined.
7651 struct LDKDecodeError *err;
7652 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
7655 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
7656 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
7657 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7659 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
7661 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
7662 * `err` or `result` depending on the state of `result_ok`.
7664 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
7666 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
7669 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
7674 * A gossip_timestamp_filter message is used by a node to request
7675 * gossip relay for messages in the requested time range when the
7676 * gossip_queries feature has been negotiated.
7678 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
7680 * A pointer to the opaque Rust object.
7681 * Nearly everywhere, inner must be non-null, however in places where
7682 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7684 LDKnativeGossipTimestampFilter *inner;
7686 * Indicates that this is the only struct which contains the same pointer.
7687 * Rust functions which take ownership of an object provided via an argument require
7688 * this to be true and invalidate the object pointed to by inner.
7691 } LDKGossipTimestampFilter;
7694 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
7696 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
7698 * A pointer to the contents in the success state.
7699 * Reading from this pointer when `result_ok` is not set is undefined.
7701 struct LDKGossipTimestampFilter *result;
7703 * A pointer to the contents in the error state.
7704 * Reading from this pointer when `result_ok` is set is undefined.
7706 struct LDKDecodeError *err;
7707 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
7710 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
7711 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
7712 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7714 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
7716 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
7717 * `err` or `result` depending on the state of `result_ok`.
7719 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
7721 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
7724 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
7727 * When signing using a fallible method either an user-supplied `SignError` or a `CreationError`
7730 typedef enum LDKSignOrCreationError_Tag {
7732 * An error occurred during signing
7734 LDKSignOrCreationError_SignError,
7736 * An error occurred while building the transaction
7738 LDKSignOrCreationError_CreationError,
7740 * Must be last for serialization purposes
7742 LDKSignOrCreationError_Sentinel,
7743 } LDKSignOrCreationError_Tag;
7745 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
7746 LDKSignOrCreationError_Tag tag;
7749 enum LDKCreationError creation_error;
7752 } LDKSignOrCreationError;
7755 * The contents of CResult_InvoiceSignOrCreationErrorZ
7757 typedef union LDKCResult_InvoiceSignOrCreationErrorZPtr {
7759 * A pointer to the contents in the success state.
7760 * Reading from this pointer when `result_ok` is not set is undefined.
7762 struct LDKInvoice *result;
7764 * A pointer to the contents in the error state.
7765 * Reading from this pointer when `result_ok` is set is undefined.
7767 struct LDKSignOrCreationError *err;
7768 } LDKCResult_InvoiceSignOrCreationErrorZPtr;
7771 * A CResult_InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
7772 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
7773 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7775 typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
7777 * The contents of this CResult_InvoiceSignOrCreationErrorZ, accessible via either
7778 * `err` or `result` depending on the state of `result_ok`.
7780 union LDKCResult_InvoiceSignOrCreationErrorZPtr contents;
7782 * Whether this CResult_InvoiceSignOrCreationErrorZ represents a success state.
7785 } LDKCResult_InvoiceSignOrCreationErrorZ;
7788 * A trait indicating an object may generate message send events
7790 typedef struct LDKMessageSendEventsProvider {
7792 * An opaque pointer which is passed to your function implementations as an argument.
7793 * This has no meaning in the LDK, and can be NULL or any other value.
7797 * Gets the list of pending events which were generated by previous actions, clearing the list
7800 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
7802 * Frees any resources associated with this object given its this_arg pointer.
7803 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7805 void (*free)(void *this_arg);
7806 } LDKMessageSendEventsProvider;
7809 * A trait implemented for objects handling events from [`EventsProvider`].
7811 typedef struct LDKEventHandler {
7813 * An opaque pointer which is passed to your function implementations as an argument.
7814 * This has no meaning in the LDK, and can be NULL or any other value.
7818 * Handles the given [`Event`].
7820 * See [`EventsProvider`] for details that must be considered when implementing this method.
7822 void (*handle_event)(const void *this_arg, struct LDKEvent event);
7824 * Frees any resources associated with this object given its this_arg pointer.
7825 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7827 void (*free)(void *this_arg);
7831 * A trait indicating an object may generate events.
7833 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
7837 * See [`process_pending_events`] for requirements around event processing.
7839 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
7840 * event since the last invocation. The handler must either act upon the event immediately
7841 * or preserve it for later handling.
7843 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
7844 * consult the provider's documentation on the implication of processing events and how a handler
7845 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
7846 * [`ChainMonitor::process_pending_events`]).
7848 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
7851 * [`process_pending_events`]: Self::process_pending_events
7852 * [`handle_event`]: EventHandler::handle_event
7853 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
7854 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
7856 typedef struct LDKEventsProvider {
7858 * An opaque pointer which is passed to your function implementations as an argument.
7859 * This has no meaning in the LDK, and can be NULL or any other value.
7863 * Processes any events generated since the last call using the given event handler.
7865 * Subsequent calls must only process new events. However, handlers must be capable of handling
7866 * duplicate events across process restarts. This may occur if the provider was recovered from
7867 * an old state (i.e., it hadn't been successfully persisted after processing pending events).
7869 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
7871 * Frees any resources associated with this object given its this_arg pointer.
7872 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7874 void (*free)(void *this_arg);
7875 } LDKEventsProvider;
7880 * Configuration we set when applicable.
7882 * Default::default() provides sane defaults.
7884 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
7886 * A pointer to the opaque Rust object.
7887 * Nearly everywhere, inner must be non-null, however in places where
7888 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7890 LDKnativeChannelHandshakeConfig *inner;
7892 * Indicates that this is the only struct which contains the same pointer.
7893 * Rust functions which take ownership of an object provided via an argument require
7894 * this to be true and invalidate the object pointed to by inner.
7897 } LDKChannelHandshakeConfig;
7902 * Optional channel limits which are applied during channel creation.
7904 * These limits are only applied to our counterparty's limits, not our own.
7906 * Use 0/<type>::max_value() as appropriate to skip checking.
7908 * Provides sane defaults for most configurations.
7910 * Most additional limits are disabled except those with which specify a default in individual
7911 * field documentation. Note that this may result in barely-usable channels, but since they
7912 * are applied mostly only to incoming channels that's not much of a problem.
7914 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
7916 * A pointer to the opaque Rust object.
7917 * Nearly everywhere, inner must be non-null, however in places where
7918 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7920 LDKnativeChannelHandshakeLimits *inner;
7922 * Indicates that this is the only struct which contains the same pointer.
7923 * Rust functions which take ownership of an object provided via an argument require
7924 * this to be true and invalidate the object pointed to by inner.
7927 } LDKChannelHandshakeLimits;
7932 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
7934 * Default::default() provides sane defaults for most configurations
7935 * (but currently with 0 relay fees!)
7937 typedef struct MUST_USE_STRUCT LDKUserConfig {
7939 * A pointer to the opaque Rust object.
7940 * Nearly everywhere, inner must be non-null, however in places where
7941 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7943 LDKnativeUserConfig *inner;
7945 * Indicates that this is the only struct which contains the same pointer.
7946 * Rust functions which take ownership of an object provided via an argument require
7947 * this to be true and invalidate the object pointed to by inner.
7955 * The best known block as identified by its hash and height.
7957 typedef struct MUST_USE_STRUCT LDKBestBlock {
7959 * A pointer to the opaque Rust object.
7960 * Nearly everywhere, inner must be non-null, however in places where
7961 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7963 LDKnativeBestBlock *inner;
7965 * Indicates that this is the only struct which contains the same pointer.
7966 * Rust functions which take ownership of an object provided via an argument require
7967 * this to be true and invalidate the object pointed to by inner.
7973 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
7976 typedef struct LDKAccess {
7978 * An opaque pointer which is passed to your function implementations as an argument.
7979 * This has no meaning in the LDK, and can be NULL or any other value.
7983 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
7984 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
7987 * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
7989 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
7991 * Frees any resources associated with this object given its this_arg pointer.
7992 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7994 void (*free)(void *this_arg);
7998 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
8001 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
8002 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
8003 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
8006 typedef struct LDKListen {
8008 * An opaque pointer which is passed to your function implementations as an argument.
8009 * This has no meaning in the LDK, and can be NULL or any other value.
8013 * Notifies the listener that a block was added at the given height.
8015 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
8017 * Notifies the listener that a block was removed at the given height.
8019 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
8021 * Frees any resources associated with this object given its this_arg pointer.
8022 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8024 void (*free)(void *this_arg);
8028 * The `Confirm` trait is used to notify when transactions have been confirmed on chain or
8029 * unconfirmed during a chain reorganization.
8031 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
8032 * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity
8033 * related to registered transactions and outputs. Upon notification, it would pass along the
8034 * matching transactions using this interface.
8038 * The intended use is as follows:
8039 * - Call [`transactions_confirmed`] to process any on-chain activity of interest.
8040 * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`]
8041 * that has been reorganized out of the chain.
8042 * - Call [`best_block_updated`] whenever a new chain tip becomes available.
8046 * Clients must call these methods in chain order. Specifically:
8047 * - Transactions confirmed in a block must be given before transactions confirmed in a later
8049 * - Dependent transactions within the same block must be given in topological order, possibly in
8051 * - Unconfirmed transactions must be given after the original confirmations and before any
8054 * See individual method documentation for further details.
8056 * [`transactions_confirmed`]: Self::transactions_confirmed
8057 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
8058 * [`best_block_updated`]: Self::best_block_updated
8059 * [`get_relevant_txids`]: Self::get_relevant_txids
8061 typedef struct LDKConfirm {
8063 * An opaque pointer which is passed to your function implementations as an argument.
8064 * This has no meaning in the LDK, and can be NULL or any other value.
8068 * Processes transactions confirmed in a block with a given header and height.
8070 * Should be called for any transactions registered by [`Filter::register_tx`] or any
8071 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
8072 * appearing in the same block do not need to be included in the same call; instead, multiple
8073 * calls with additional transactions may be made so long as they are made in [chain order].
8075 * May be called before or after [`best_block_updated`] for the corresponding block. However,
8076 * in the event of a chain reorganization, it must not be called with a `header` that is no
8077 * longer in the chain as of the last call to [`best_block_updated`].
8079 * [chain order]: Confirm#Order
8080 * [`best_block_updated`]: Self::best_block_updated
8082 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
8084 * Processes a transaction that is no longer confirmed as result of a chain reorganization.
8086 * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
8087 * reorganized out of the best chain. Once called, the given transaction should not be returned
8088 * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`].
8090 * [`get_relevant_txids`]: Self::get_relevant_txids
8091 * [`transactions_confirmed`]: Self::transactions_confirmed
8093 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
8095 * Processes an update to the best header connected at the given height.
8097 * Should be called when a new header is available but may be skipped for intermediary blocks
8098 * if they become available at the same time.
8100 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
8102 * Returns transactions that should be monitored for reorganization out of the chain.
8104 * Should include any transactions passed to [`transactions_confirmed`] that have insufficient
8105 * confirmations to be safe from a chain reorganization. Should not include any transactions
8106 * passed to [`transaction_unconfirmed`] unless later reconfirmed.
8108 * May be called to determine the subset of transactions that must still be monitored for
8109 * reorganization. Will be idempotent between calls but may change as a result of calls to the
8110 * other interface methods. Thus, this is useful to determine which transactions may need to be
8111 * given to [`transaction_unconfirmed`].
8113 * [`transactions_confirmed`]: Self::transactions_confirmed
8114 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
8116 struct LDKCVec_TxidZ (*get_relevant_txids)(const void *this_arg);
8118 * Frees any resources associated with this object given its this_arg pointer.
8119 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8121 void (*free)(void *this_arg);
8127 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
8129 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
8130 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
8131 * the return value of [`Filter::register_output`].
8133 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
8134 * may have been spent there. See [`Filter::register_output`] for details.
8136 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
8137 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
8139 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
8141 * A pointer to the opaque Rust object.
8142 * Nearly everywhere, inner must be non-null, however in places where
8143 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8145 LDKnativeWatchedOutput *inner;
8147 * Indicates that this is the only struct which contains the same pointer.
8148 * Rust functions which take ownership of an object provided via an argument require
8149 * this to be true and invalidate the object pointed to by inner.
8155 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
8158 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
8159 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
8160 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
8161 * receiving full blocks from a chain source, any further filtering is unnecessary.
8163 * After an output has been registered, subsequent block retrievals from the chain source must not
8164 * exclude any transactions matching the new criteria nor any in-block descendants of such
8167 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
8168 * should not block on I/O. Implementations should instead queue the newly monitored data to be
8169 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
8170 * invocation that has called the `Filter` must return [`TemporaryFailure`].
8172 * [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure
8173 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
8174 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
8176 typedef struct LDKFilter {
8178 * An opaque pointer which is passed to your function implementations as an argument.
8179 * This has no meaning in the LDK, and can be NULL or any other value.
8183 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
8184 * a spending condition.
8186 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
8188 * Registers interest in spends of a transaction output.
8190 * Optionally, when `output.block_hash` is set, should return any transaction spending the
8191 * output that is found in the corresponding block along with its index.
8193 * This return value is useful for Electrum clients in order to supply in-block descendant
8194 * transactions which otherwise were not included. This is not necessary for other clients if
8195 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
8198 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
8200 * Frees any resources associated with this object given its this_arg pointer.
8201 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8203 void (*free)(void *this_arg);
8207 * `Persist` defines behavior for persisting channel monitors: this could mean
8208 * writing once to disk, and/or uploading to one or more backup services.
8210 * Note that for every new monitor, you **must** persist the new `ChannelMonitor`
8211 * to disk/backups. And, on every update, you **must** persist either the
8212 * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk
8213 * of situations such as revoking a transaction, then crashing before this
8214 * revocation can be persisted, then unintentionally broadcasting a revoked
8215 * transaction and losing money. This is a risk because previous channel states
8216 * are toxic, so it's important that whatever channel state is persisted is
8219 typedef struct LDKPersist {
8221 * An opaque pointer which is passed to your function implementations as an argument.
8222 * This has no meaning in the LDK, and can be NULL or any other value.
8226 * Persist a new channel's data. The data can be stored any way you want, but
8227 * the identifier provided by Rust-Lightning is the channel's outpoint (and
8228 * it is up to you to maintain a correct mapping between the outpoint and the
8229 * stored channel data). Note that you **must** persist every new monitor to
8230 * disk. See the `Persist` trait documentation for more details.
8232 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
8233 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
8235 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data);
8237 * Update one channel's data. The provided `ChannelMonitor` has already
8238 * applied the given update.
8240 * Note that on every update, you **must** persist either the
8241 * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See
8242 * the `Persist` trait documentation for more details.
8244 * If an implementer chooses to persist the updates only, they need to make
8245 * sure that all the updates are applied to the `ChannelMonitors` *before*
8246 * the set of channel monitors is given to the `ChannelManager`
8247 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
8248 * applying a monitor update to a monitor. If full `ChannelMonitors` are
8249 * persisted, then there is no need to persist individual updates.
8251 * Note that there could be a performance tradeoff between persisting complete
8252 * channel monitors on every update vs. persisting only updates and applying
8253 * them in batches. The size of each monitor grows `O(number of state updates)`
8254 * whereas updates are small and `O(1)`.
8256 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
8257 * [`ChannelMonitorUpdate::write`] for writing out an update, and
8258 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
8260 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);
8262 * Frees any resources associated with this object given its this_arg pointer.
8263 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8265 void (*free)(void *this_arg);
8271 * An implementation of [`chain::Watch`] for monitoring channels.
8273 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
8274 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
8275 * or used independently to monitor channels remotely. See the [module-level documentation] for
8278 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
8279 * [module-level documentation]: crate::chain::chainmonitor
8281 typedef struct MUST_USE_STRUCT LDKChainMonitor {
8283 * A pointer to the opaque Rust object.
8284 * Nearly everywhere, inner must be non-null, however in places where
8285 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8287 LDKnativeChainMonitor *inner;
8289 * Indicates that this is the only struct which contains the same pointer.
8290 * Rust functions which take ownership of an object provided via an argument require
8291 * this to be true and invalidate the object pointed to by inner.
8299 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
8300 * and derives keys from that.
8302 * Your node_id is seed/0'
8303 * ChannelMonitor closes may use seed/1'
8304 * Cooperative closes may use seed/2'
8305 * The two close keys may be needed to claim on-chain funds!
8307 typedef struct MUST_USE_STRUCT LDKKeysManager {
8309 * A pointer to the opaque Rust object.
8310 * Nearly everywhere, inner must be non-null, however in places where
8311 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8313 LDKnativeKeysManager *inner;
8315 * Indicates that this is the only struct which contains the same pointer.
8316 * Rust functions which take ownership of an object provided via an argument require
8317 * this to be true and invalidate the object pointed to by inner.
8325 * Chain-related parameters used to construct a new `ChannelManager`.
8327 * Typically, the block-specific parameters are derived from the best block hash for the network,
8328 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
8329 * are not needed when deserializing a previously constructed `ChannelManager`.
8331 typedef struct MUST_USE_STRUCT LDKChainParameters {
8333 * A pointer to the opaque Rust object.
8334 * Nearly everywhere, inner must be non-null, however in places where
8335 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8337 LDKnativeChainParameters *inner;
8339 * Indicates that this is the only struct which contains the same pointer.
8340 * Rust functions which take ownership of an object provided via an argument require
8341 * this to be true and invalidate the object pointed to by inner.
8344 } LDKChainParameters;
8349 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
8350 * to better separate parameters.
8352 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
8354 * A pointer to the opaque Rust object.
8355 * Nearly everywhere, inner must be non-null, however in places where
8356 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8358 LDKnativeChannelCounterparty *inner;
8360 * Indicates that this is the only struct which contains the same pointer.
8361 * Rust functions which take ownership of an object provided via an argument require
8362 * this to be true and invalidate the object pointed to by inner.
8365 } LDKChannelCounterparty;
8368 * A 3-byte byte array.
8370 typedef struct LDKThreeBytes {
8378 * A trait to describe an object which can receive channel messages.
8380 * Messages MAY be called in parallel when they originate from different their_node_ids, however
8381 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
8383 typedef struct LDKChannelMessageHandler {
8385 * An opaque pointer which is passed to your function implementations as an argument.
8386 * This has no meaning in the LDK, and can be NULL or any other value.
8390 * Handle an incoming open_channel message from the given peer.
8392 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
8394 * Handle an incoming accept_channel message from the given peer.
8396 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
8398 * Handle an incoming funding_created message from the given peer.
8400 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
8402 * Handle an incoming funding_signed message from the given peer.
8404 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
8406 * Handle an incoming funding_locked message from the given peer.
8408 void (*handle_funding_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg);
8410 * Handle an incoming shutdown message from the given peer.
8412 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);
8414 * Handle an incoming closing_signed message from the given peer.
8416 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
8418 * Handle an incoming update_add_htlc message from the given peer.
8420 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
8422 * Handle an incoming update_fulfill_htlc message from the given peer.
8424 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
8426 * Handle an incoming update_fail_htlc message from the given peer.
8428 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
8430 * Handle an incoming update_fail_malformed_htlc message from the given peer.
8432 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
8434 * Handle an incoming commitment_signed message from the given peer.
8436 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
8438 * Handle an incoming revoke_and_ack message from the given peer.
8440 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
8442 * Handle an incoming update_fee message from the given peer.
8444 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
8446 * Handle an incoming announcement_signatures message from the given peer.
8448 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
8450 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
8451 * is believed to be possible in the future (eg they're sending us messages we don't
8452 * understand or indicate they require unknown feature bits), no_connection_possible is set
8453 * and any outstanding channels should be failed.
8455 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
8457 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
8459 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
8461 * Handle an incoming channel_reestablish message from the given peer.
8463 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
8465 * Handle an incoming channel update from the given peer.
8467 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
8469 * Handle an incoming error message from the given peer.
8471 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
8473 * Implementation of MessageSendEventsProvider for this object.
8475 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
8477 * Frees any resources associated with this object given its this_arg pointer.
8478 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8480 void (*free)(void *this_arg);
8481 } LDKChannelMessageHandler;
8486 * Arguments for the creation of a ChannelManager that are not deserialized.
8488 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
8490 * 1) Deserialize all stored ChannelMonitors.
8491 * 2) Deserialize the ChannelManager by filling in this struct and calling:
8492 * <(BlockHash, ChannelManager)>::read(reader, args)
8493 * This may result in closing some Channels if the ChannelMonitor is newer than the stored
8494 * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted.
8495 * 3) If you are not fetching full blocks, register all relevant ChannelMonitor outpoints the same
8496 * way you would handle a `chain::Filter` call using ChannelMonitor::get_outputs_to_watch() and
8497 * ChannelMonitor::get_funding_txo().
8498 * 4) Reconnect blocks on your ChannelMonitors.
8499 * 5) Disconnect/connect blocks on the ChannelManager.
8500 * 6) Move the ChannelMonitors into your local chain::Watch.
8502 * Note that the ordering of #4-6 is not of importance, however all three must occur before you
8503 * call any other methods on the newly-deserialized ChannelManager.
8505 * Note that because some channels may be closed during deserialization, it is critical that you
8506 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
8507 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
8508 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
8509 * not force-close the same channels but consider them live), you may end up revoking a state for
8510 * which you've already broadcasted the transaction.
8512 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
8514 * A pointer to the opaque Rust object.
8515 * Nearly everywhere, inner must be non-null, however in places where
8516 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8518 LDKnativeChannelManagerReadArgs *inner;
8520 * Indicates that this is the only struct which contains the same pointer.
8521 * Rust functions which take ownership of an object provided via an argument require
8522 * this to be true and invalidate the object pointed to by inner.
8525 } LDKChannelManagerReadArgs;
8530 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
8531 * This is used to convince the recipient that the channel is at a certain commitment
8532 * number even if they lost that data due to a local failure. Of course, the peer may lie
8533 * and even later commitments may have been revoked.
8535 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
8537 * A pointer to the opaque Rust object.
8538 * Nearly everywhere, inner must be non-null, however in places where
8539 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8541 LDKnativeDataLossProtect *inner;
8543 * Indicates that this is the only struct which contains the same pointer.
8544 * Rust functions which take ownership of an object provided via an argument require
8545 * this to be true and invalidate the object pointed to by inner.
8548 } LDKDataLossProtect;
8551 * A trait to describe an object which can receive routing messages.
8553 * # Implementor DoS Warnings
8555 * For `gossip_queries` messages there are potential DoS vectors when handling
8556 * inbound queries. Implementors using an on-disk network graph should be aware of
8557 * repeated disk I/O for queries accessing different parts of the network graph.
8559 typedef struct LDKRoutingMessageHandler {
8561 * An opaque pointer which is passed to your function implementations as an argument.
8562 * This has no meaning in the LDK, and can be NULL or any other value.
8566 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
8567 * false or returning an Err otherwise.
8569 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
8571 * Handle a channel_announcement message, returning true if it should be forwarded on, false
8572 * or returning an Err otherwise.
8574 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
8576 * Handle an incoming channel_update message, returning true if it should be forwarded on,
8577 * false or returning an Err otherwise.
8579 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
8581 * Handle some updates to the route graph that we learned due to an outbound failed payment.
8583 void (*handle_htlc_fail_channel_update)(const void *this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update);
8585 * Gets a subset of the channel announcements and updates required to dump our routing table
8586 * to a remote node, starting at the short_channel_id indicated by starting_point and
8587 * including the batch_amount entries immediately higher in numerical value than starting_point.
8589 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
8591 * Gets a subset of the node announcements required to dump our routing table to a remote node,
8592 * starting at the node *after* the provided publickey and including batch_amount entries
8593 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
8594 * If None is provided for starting_point, we start at the first node.
8596 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
8598 * Called when a connection is established with a peer. This can be used to
8599 * perform routing table synchronization using a strategy defined by the
8602 void (*sync_routing_table)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
8604 * Handles the reply of a query we initiated to learn about channels
8605 * for a given range of blocks. We can expect to receive one or more
8606 * replies to a single query.
8608 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
8610 * Handles the reply of a query we initiated asking for routing gossip
8611 * messages for a list of channels. We should receive this message when
8612 * a node has completed its best effort to send us the pertaining routing
8615 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
8617 * Handles when a peer asks us to send a list of short_channel_ids
8618 * for the requested range of blocks.
8620 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
8622 * Handles when a peer asks us to send routing gossip messages for a
8623 * list of short_channel_ids.
8625 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
8627 * Implementation of MessageSendEventsProvider for this object.
8629 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
8631 * Frees any resources associated with this object given its this_arg pointer.
8632 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8634 void (*free)(void *this_arg);
8635 } LDKRoutingMessageHandler;
8640 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
8641 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
8643 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
8645 * A pointer to the opaque Rust object.
8646 * Nearly everywhere, inner must be non-null, however in places where
8647 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8649 LDKnativeIgnoringMessageHandler *inner;
8651 * Indicates that this is the only struct which contains the same pointer.
8652 * Rust functions which take ownership of an object provided via an argument require
8653 * this to be true and invalidate the object pointed to by inner.
8656 } LDKIgnoringMessageHandler;
8661 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
8662 * You can provide one of these as the route_handler in a MessageHandler.
8664 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
8666 * A pointer to the opaque Rust object.
8667 * Nearly everywhere, inner must be non-null, however in places where
8668 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8670 LDKnativeErroringMessageHandler *inner;
8672 * Indicates that this is the only struct which contains the same pointer.
8673 * Rust functions which take ownership of an object provided via an argument require
8674 * this to be true and invalidate the object pointed to by inner.
8677 } LDKErroringMessageHandler;
8682 * Provides references to trait impls which handle different types of messages.
8684 typedef struct MUST_USE_STRUCT LDKMessageHandler {
8686 * A pointer to the opaque Rust object.
8687 * Nearly everywhere, inner must be non-null, however in places where
8688 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8690 LDKnativeMessageHandler *inner;
8692 * Indicates that this is the only struct which contains the same pointer.
8693 * Rust functions which take ownership of an object provided via an argument require
8694 * this to be true and invalidate the object pointed to by inner.
8697 } LDKMessageHandler;
8700 * Provides an object which can be used to send data to and which uniquely identifies a connection
8701 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
8702 * implement Hash to meet the PeerManager API.
8704 * For efficiency, Clone should be relatively cheap for this type.
8706 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
8707 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
8708 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
8709 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
8710 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
8711 * to simply use another value which is guaranteed to be globally unique instead.
8713 typedef struct LDKSocketDescriptor {
8715 * An opaque pointer which is passed to your function implementations as an argument.
8716 * This has no meaning in the LDK, and can be NULL or any other value.
8720 * Attempts to send some data from the given slice to the peer.
8722 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
8723 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
8724 * called and further write attempts may occur until that time.
8726 * If the returned size is smaller than `data.len()`, a
8727 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
8728 * written. Additionally, until a `send_data` event completes fully, no further
8729 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
8730 * prevent denial-of-service issues, you should not read or buffer any data from the socket
8733 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
8734 * (indicating that read events should be paused to prevent DoS in the send buffer),
8735 * `resume_read` may be set indicating that read events on this descriptor should resume. A
8736 * `resume_read` of false carries no meaning, and should not cause any action.
8738 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
8740 * Disconnect the socket pointed to by this SocketDescriptor.
8742 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
8743 * call (doing so is a noop).
8745 void (*disconnect_socket)(void *this_arg);
8747 * Checks if two objects are equal given this object's this_arg pointer and another object.
8749 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
8751 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
8752 * This is used, for example, for inclusion of this object in a hash map.
8754 uint64_t (*hash)(const void *this_arg);
8756 * Creates a copy of the object pointed to by this_arg, for a copy of this SocketDescriptor.
8757 * Note that the ultimate copy of the SocketDescriptor will have all function pointers the same as the original.
8758 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new SocketDescriptor.
8760 void *(*clone)(const void *this_arg);
8762 * Frees any resources associated with this object given its this_arg pointer.
8763 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8765 void (*free)(void *this_arg);
8766 } LDKSocketDescriptor;
8771 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
8772 * socket events into messages which it passes on to its [`MessageHandler`].
8774 * Locks are taken internally, so you must never assume that reentrancy from a
8775 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
8777 * Calls to [`read_event`] will decode relevant messages and pass them to the
8778 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
8779 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
8780 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
8781 * calls only after previous ones have returned.
8783 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
8784 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
8785 * essentially you should default to using a SimpleRefPeerManager, and use a
8786 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
8787 * you're using lightning-net-tokio.
8789 * [`read_event`]: PeerManager::read_event
8791 typedef struct MUST_USE_STRUCT LDKPeerManager {
8793 * A pointer to the opaque Rust object.
8794 * Nearly everywhere, inner must be non-null, however in places where
8795 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8797 LDKnativePeerManager *inner;
8799 * Indicates that this is the only struct which contains the same pointer.
8800 * Rust functions which take ownership of an object provided via an argument require
8801 * this to be true and invalidate the object pointed to by inner.
8809 * Static channel fields used to build transactions given per-commitment fields, organized by
8810 * broadcaster/countersignatory.
8812 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
8813 * as_holder_broadcastable and as_counterparty_broadcastable functions.
8815 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
8817 * A pointer to the opaque Rust object.
8818 * Nearly everywhere, inner must be non-null, however in places where
8819 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8821 LDKnativeDirectedChannelTransactionParameters *inner;
8823 * Indicates that this is the only struct which contains the same pointer.
8824 * Rust functions which take ownership of an object provided via an argument require
8825 * this to be true and invalidate the object pointed to by inner.
8828 } LDKDirectedChannelTransactionParameters;
8833 * A channel descriptor for a hop along a payment path.
8835 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
8837 * A pointer to the opaque Rust object.
8838 * Nearly everywhere, inner must be non-null, however in places where
8839 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8841 LDKnativeRouteHintHop *inner;
8843 * Indicates that this is the only struct which contains the same pointer.
8844 * Rust functions which take ownership of an object provided via an argument require
8845 * this to be true and invalidate the object pointed to by inner.
8853 * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
8854 * This exists only to make accessing a RwLock<NetworkGraph> possible from
8855 * the C bindings, as it can be done directly in Rust code.
8857 typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
8859 * A pointer to the opaque Rust object.
8860 * Nearly everywhere, inner must be non-null, however in places where
8861 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8863 LDKnativeLockedNetworkGraph *inner;
8865 * Indicates that this is the only struct which contains the same pointer.
8866 * Rust functions which take ownership of an object provided via an argument require
8867 * this to be true and invalidate the object pointed to by inner.
8870 } LDKLockedNetworkGraph;
8875 * Receives and validates network updates from peers,
8876 * stores authentic and relevant data as a network graph.
8877 * This network graph is then used for routing payments.
8878 * Provides interface to help with initial routing sync by
8879 * serving historical announcements.
8881 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
8883 * A pointer to the opaque Rust object.
8884 * Nearly everywhere, inner must be non-null, however in places where
8885 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8887 LDKnativeNetGraphMsgHandler *inner;
8889 * Indicates that this is the only struct which contains the same pointer.
8890 * Rust functions which take ownership of an object provided via an argument require
8891 * this to be true and invalidate the object pointed to by inner.
8894 } LDKNetGraphMsgHandler;
8899 * FilesystemPersister persists channel data on disk, where each channel's
8900 * data is stored in a file named after its funding outpoint.
8902 * Warning: this module does the best it can with calls to persist data, but it
8903 * can only guarantee that the data is passed to the drive. It is up to the
8904 * drive manufacturers to do the actual persistence properly, which they often
8905 * don't (especially on consumer-grade hardware). Therefore, it is up to the
8906 * user to validate their entire storage stack, to ensure the writes are
8908 * Corollary: especially when dealing with larger amounts of money, it is best
8909 * practice to have multiple channel data backups and not rely only on one
8910 * FilesystemPersister.
8912 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
8914 * A pointer to the opaque Rust object.
8915 * Nearly everywhere, inner must be non-null, however in places where
8916 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8918 LDKnativeFilesystemPersister *inner;
8920 * Indicates that this is the only struct which contains the same pointer.
8921 * Rust functions which take ownership of an object provided via an argument require
8922 * this to be true and invalidate the object pointed to by inner.
8925 } LDKFilesystemPersister;
8930 * BackgroundProcessor takes care of tasks that (1) need to happen periodically to keep
8931 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
8932 * responsibilities are:
8933 * * Monitoring whether the ChannelManager needs to be re-persisted to disk, and if so,
8934 * writing it to disk/backups by invoking the callback given to it at startup.
8935 * ChannelManager persistence should be done in the background.
8936 * * Calling `ChannelManager::timer_tick_occurred()` and
8937 * `PeerManager::timer_tick_occurred()` every minute (can be done in the
8940 * Note that if ChannelManager persistence fails and the persisted manager becomes out-of-date,
8941 * then there is a risk of channels force-closing on startup when the manager realizes it's
8942 * outdated. However, as long as `ChannelMonitor` backups are sound, no funds besides those used
8943 * for unilateral chain closure fees are at risk.
8945 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
8947 * A pointer to the opaque Rust object.
8948 * Nearly everywhere, inner must be non-null, however in places where
8949 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8951 LDKnativeBackgroundProcessor *inner;
8953 * Indicates that this is the only struct which contains the same pointer.
8954 * Rust functions which take ownership of an object provided via an argument require
8955 * this to be true and invalidate the object pointed to by inner.
8958 } LDKBackgroundProcessor;
8961 * Trait which handles persisting a [`ChannelManager`] to disk.
8963 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
8965 typedef struct LDKChannelManagerPersister {
8967 * An opaque pointer which is passed to your function implementations as an argument.
8968 * This has no meaning in the LDK, and can be NULL or any other value.
8972 * Persist the given [`ChannelManager`] to disk, returning an error if persistence failed
8973 * (which will cause the [`BackgroundProcessor`] which called this method to exit.
8975 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
8977 struct LDKCResult_NoneErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
8979 * Frees any resources associated with this object given its this_arg pointer.
8980 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8982 void (*free)(void *this_arg);
8983 } LDKChannelManagerPersister;
8988 * Data of the `RawInvoice` that is encoded in the data part
8990 typedef struct MUST_USE_STRUCT LDKRawDataPart {
8992 * A pointer to the opaque Rust object.
8993 * Nearly everywhere, inner must be non-null, however in places where
8994 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8996 LDKnativeRawDataPart *inner;
8998 * Indicates that this is the only struct which contains the same pointer.
8999 * Rust functions which take ownership of an object provided via an argument require
9000 * this to be true and invalidate the object pointed to by inner.
9010 typedef struct MUST_USE_STRUCT LDKSha256 {
9012 * A pointer to the opaque Rust object.
9013 * Nearly everywhere, inner must be non-null, however in places where
9014 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9016 LDKnativeSha256 *inner;
9018 * Indicates that this is the only struct which contains the same pointer.
9019 * Rust functions which take ownership of an object provided via an argument require
9020 * this to be true and invalidate the object pointed to by inner.
9028 * `min_final_cltv_expiry` to use for the last HTLC in the route
9030 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiry {
9032 * A pointer to the opaque Rust object.
9033 * Nearly everywhere, inner must be non-null, however in places where
9034 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9036 LDKnativeMinFinalCltvExpiry *inner;
9038 * Indicates that this is the only struct which contains the same pointer.
9039 * Rust functions which take ownership of an object provided via an argument require
9040 * this to be true and invalidate the object pointed to by inner.
9043 } LDKMinFinalCltvExpiry;
9046 * Integer in the range `0..32`
9048 typedef struct LDKu5 {
9053 * A 20-byte byte array.
9055 typedef struct LDKTwentyBytes {
9063 * Fallback address in case no LN payment is possible
9065 typedef enum LDKFallback_Tag {
9066 LDKFallback_SegWitProgram,
9067 LDKFallback_PubKeyHash,
9068 LDKFallback_ScriptHash,
9070 * Must be last for serialization purposes
9072 LDKFallback_Sentinel,
9075 typedef struct LDKFallback_LDKSegWitProgram_Body {
9076 struct LDKu5 version;
9077 struct LDKCVec_u8Z program;
9078 } LDKFallback_LDKSegWitProgram_Body;
9080 typedef struct MUST_USE_STRUCT LDKFallback {
9081 LDKFallback_Tag tag;
9083 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
9085 struct LDKTwentyBytes pub_key_hash;
9088 struct LDKTwentyBytes script_hash;
9093 extern const uintptr_t MAX_BUF_SIZE;
9095 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
9097 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
9099 extern const uint32_t ANTI_REORG_DELAY;
9101 extern const uint16_t BREAKDOWN_TIMEOUT;
9103 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
9105 extern const uint32_t MIN_FINAL_CLTV_EXPIRY;
9107 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
9109 extern const uint64_t DEFAULT_EXPIRY_TIME;
9111 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY;
9113 extern const uint8_t TAG_PAYMENT_HASH;
9115 extern const uint8_t TAG_DESCRIPTION;
9117 extern const uint8_t TAG_PAYEE_PUB_KEY;
9119 extern const uint8_t TAG_DESCRIPTION_HASH;
9121 extern const uint8_t TAG_EXPIRY_TIME;
9123 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
9125 extern const uint8_t TAG_FALLBACK;
9127 extern const uint8_t TAG_PRIVATE_ROUTE;
9129 extern const uint8_t TAG_PAYMENT_SECRET;
9131 extern const uint8_t TAG_FEATURES;
9133 struct LDKStr _ldk_get_compiled_version(void);
9135 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
9138 * Frees the data buffer, if data_is_owned is set and datalen > 0.
9140 void Transaction_free(struct LDKTransaction _res);
9143 * Frees the data pointed to by script_pubkey.
9145 void TxOut_free(struct LDKTxOut _res);
9148 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
9150 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
9153 * Frees the data buffer, if chars_is_owned is set and len > 0.
9155 void Str_free(struct LDKStr _res);
9158 * Creates a new CResult_SecretKeyErrorZ in the success state.
9160 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
9163 * Creates a new CResult_SecretKeyErrorZ in the error state.
9165 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
9168 * Frees any resources used by the CResult_SecretKeyErrorZ.
9170 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
9173 * Creates a new CResult_PublicKeyErrorZ in the success state.
9175 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
9178 * Creates a new CResult_PublicKeyErrorZ in the error state.
9180 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
9183 * Frees any resources used by the CResult_PublicKeyErrorZ.
9185 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
9188 * Creates a new CResult_PublicKeyErrorZ which has the same data as `orig`
9189 * but with all dynamically-allocated buffers duplicated in new buffers.
9191 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig);
9194 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
9196 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
9199 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
9201 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
9204 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
9206 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
9209 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
9210 * but with all dynamically-allocated buffers duplicated in new buffers.
9212 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
9215 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
9217 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
9220 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
9222 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
9225 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
9227 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
9230 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
9231 * but with all dynamically-allocated buffers duplicated in new buffers.
9233 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
9236 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
9238 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
9241 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
9243 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
9246 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
9248 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
9251 * Creates a new CResult_TxCreationKeysErrorZ which has the same data as `orig`
9252 * but with all dynamically-allocated buffers duplicated in new buffers.
9254 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_clone(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR orig);
9257 * Constructs a new COption_u32Z containing a u32
9259 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
9262 * Constructs a new COption_u32Z containing nothing
9264 struct LDKCOption_u32Z COption_u32Z_none(void);
9267 * Frees any resources associated with the u32, if we are in the Some state
9269 void COption_u32Z_free(struct LDKCOption_u32Z _res);
9272 * Creates a new COption_u32Z which has the same data as `orig`
9273 * but with all dynamically-allocated buffers duplicated in new buffers.
9275 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
9278 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
9280 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
9283 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
9285 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
9288 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
9290 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
9293 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
9294 * but with all dynamically-allocated buffers duplicated in new buffers.
9296 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
9299 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
9301 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
9304 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
9306 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
9309 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
9311 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
9314 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
9315 * but with all dynamically-allocated buffers duplicated in new buffers.
9317 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
9320 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
9322 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
9325 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
9327 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
9330 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
9332 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
9335 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
9336 * but with all dynamically-allocated buffers duplicated in new buffers.
9338 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
9341 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9343 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
9346 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
9348 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
9351 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
9353 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9356 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
9358 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
9361 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
9362 * but with all dynamically-allocated buffers duplicated in new buffers.
9364 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9367 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
9369 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
9372 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
9374 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9377 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
9379 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
9382 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
9383 * but with all dynamically-allocated buffers duplicated in new buffers.
9385 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9388 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
9390 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
9393 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
9395 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9398 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
9400 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
9403 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
9404 * but with all dynamically-allocated buffers duplicated in new buffers.
9406 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9409 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
9411 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
9414 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
9416 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
9419 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
9421 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
9424 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
9426 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
9429 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
9431 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
9434 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
9436 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
9439 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
9440 * but with all dynamically-allocated buffers duplicated in new buffers.
9442 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
9445 * Creates a new CResult_NoneErrorZ in the success state.
9447 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
9450 * Creates a new CResult_NoneErrorZ in the error state.
9452 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
9455 * Frees any resources used by the CResult_NoneErrorZ.
9457 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
9460 * Creates a new CResult_NoneErrorZ which has the same data as `orig`
9461 * but with all dynamically-allocated buffers duplicated in new buffers.
9463 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig);
9466 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
9468 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
9471 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
9473 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
9476 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
9478 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
9481 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
9482 * but with all dynamically-allocated buffers duplicated in new buffers.
9484 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
9487 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9489 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
9492 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9494 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
9497 * Creates a new CResult_RouteDecodeErrorZ in the success state.
9499 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
9502 * Creates a new CResult_RouteDecodeErrorZ in the error state.
9504 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
9507 * Frees any resources used by the CResult_RouteDecodeErrorZ.
9509 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
9512 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
9513 * but with all dynamically-allocated buffers duplicated in new buffers.
9515 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
9518 * Constructs a new COption_u64Z containing a u64
9520 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
9523 * Constructs a new COption_u64Z containing nothing
9525 struct LDKCOption_u64Z COption_u64Z_none(void);
9528 * Frees any resources associated with the u64, if we are in the Some state
9530 void COption_u64Z_free(struct LDKCOption_u64Z _res);
9533 * Creates a new COption_u64Z which has the same data as `orig`
9534 * but with all dynamically-allocated buffers duplicated in new buffers.
9536 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
9539 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9541 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
9544 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9546 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
9549 * Creates a new CResult_RouteLightningErrorZ in the success state.
9551 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
9554 * Creates a new CResult_RouteLightningErrorZ in the error state.
9556 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
9559 * Frees any resources used by the CResult_RouteLightningErrorZ.
9561 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
9564 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
9565 * but with all dynamically-allocated buffers duplicated in new buffers.
9567 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
9570 * Creates a new CResult_TxOutAccessErrorZ in the success state.
9572 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
9575 * Creates a new CResult_TxOutAccessErrorZ in the error state.
9577 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
9580 * Frees any resources used by the CResult_TxOutAccessErrorZ.
9582 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
9585 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
9586 * but with all dynamically-allocated buffers duplicated in new buffers.
9588 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
9591 * Creates a new tuple which has the same data as `orig`
9592 * but with all dynamically-allocated buffers duplicated in new buffers.
9594 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
9597 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
9599 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
9602 * Frees any resources used by the C2Tuple_usizeTransactionZ.
9604 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
9607 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9609 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
9612 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9614 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
9617 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
9619 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
9622 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
9624 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
9627 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
9629 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
9632 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
9633 * but with all dynamically-allocated buffers duplicated in new buffers.
9635 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
9638 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9640 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
9643 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
9645 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
9648 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
9650 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
9653 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
9655 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
9658 * Creates a new COption_C2Tuple_usizeTransactionZZ which has the same data as `orig`
9659 * but with all dynamically-allocated buffers duplicated in new buffers.
9661 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_clone(const struct LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR orig);
9664 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9666 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
9669 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9671 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
9674 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
9676 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
9679 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
9681 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
9684 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
9686 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
9689 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
9691 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
9694 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
9696 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
9699 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
9701 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
9704 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
9706 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
9709 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
9711 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
9714 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
9716 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
9719 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
9721 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
9724 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
9726 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
9729 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
9731 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
9734 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
9736 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
9739 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
9741 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
9744 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
9746 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
9749 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
9750 * but with all dynamically-allocated buffers duplicated in new buffers.
9752 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
9755 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
9757 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
9760 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
9762 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
9765 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
9767 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
9770 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
9771 * but with all dynamically-allocated buffers duplicated in new buffers.
9773 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
9776 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
9778 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
9781 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
9783 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
9786 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
9788 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
9791 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
9792 * but with all dynamically-allocated buffers duplicated in new buffers.
9794 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
9797 * Creates a new tuple which has the same data as `orig`
9798 * but with all dynamically-allocated buffers duplicated in new buffers.
9800 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
9803 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
9805 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
9808 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
9810 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
9813 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
9815 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
9818 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
9820 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
9823 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
9825 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
9828 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
9829 * but with all dynamically-allocated buffers duplicated in new buffers.
9831 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
9834 * Creates a new CResult_SignatureNoneZ in the success state.
9836 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
9839 * Creates a new CResult_SignatureNoneZ in the error state.
9841 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
9844 * Frees any resources used by the CResult_SignatureNoneZ.
9846 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
9849 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
9850 * but with all dynamically-allocated buffers duplicated in new buffers.
9852 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
9855 * Creates a new CResult_SignDecodeErrorZ in the success state.
9857 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
9860 * Creates a new CResult_SignDecodeErrorZ in the error state.
9862 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
9865 * Frees any resources used by the CResult_SignDecodeErrorZ.
9867 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
9870 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
9871 * but with all dynamically-allocated buffers duplicated in new buffers.
9873 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
9876 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9878 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
9881 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
9883 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
9886 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
9888 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
9891 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
9893 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
9896 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
9897 * but with all dynamically-allocated buffers duplicated in new buffers.
9899 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
9902 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9904 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
9907 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
9909 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
9912 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
9914 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
9917 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
9919 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
9922 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
9923 * but with all dynamically-allocated buffers duplicated in new buffers.
9925 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
9928 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
9930 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
9933 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
9935 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
9938 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
9940 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
9943 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
9944 * but with all dynamically-allocated buffers duplicated in new buffers.
9946 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
9949 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9951 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
9954 * Creates a new CResult_TransactionNoneZ in the success state.
9956 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
9959 * Creates a new CResult_TransactionNoneZ in the error state.
9961 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
9964 * Frees any resources used by the CResult_TransactionNoneZ.
9966 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
9969 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
9970 * but with all dynamically-allocated buffers duplicated in new buffers.
9972 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
9975 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
9977 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
9980 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
9982 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
9985 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9987 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
9990 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
9992 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
9995 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
9997 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
10000 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
10002 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
10005 * Constructs a new COption_u16Z containing a u16
10007 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
10010 * Constructs a new COption_u16Z containing nothing
10012 struct LDKCOption_u16Z COption_u16Z_none(void);
10015 * Frees any resources associated with the u16, if we are in the Some state
10017 void COption_u16Z_free(struct LDKCOption_u16Z _res);
10020 * Creates a new COption_u16Z which has the same data as `orig`
10021 * but with all dynamically-allocated buffers duplicated in new buffers.
10023 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
10026 * Creates a new CResult_NoneAPIErrorZ in the success state.
10028 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
10031 * Creates a new CResult_NoneAPIErrorZ in the error state.
10033 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
10036 * Frees any resources used by the CResult_NoneAPIErrorZ.
10038 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
10041 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
10042 * but with all dynamically-allocated buffers duplicated in new buffers.
10044 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
10047 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10049 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
10052 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10054 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
10057 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
10059 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
10062 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
10064 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
10067 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
10069 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
10072 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
10073 * but with all dynamically-allocated buffers duplicated in new buffers.
10075 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
10078 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10080 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
10083 * Creates a new tuple which has the same data as `orig`
10084 * but with all dynamically-allocated buffers duplicated in new buffers.
10086 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig);
10089 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
10091 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
10094 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
10096 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
10099 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
10101 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
10104 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
10106 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
10109 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
10111 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
10114 * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig`
10115 * but with all dynamically-allocated buffers duplicated in new buffers.
10117 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig);
10120 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10122 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
10125 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
10127 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
10130 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
10132 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
10135 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
10137 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
10140 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
10142 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
10145 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
10147 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
10150 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
10152 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
10155 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
10157 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
10160 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
10162 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
10165 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
10166 * but with all dynamically-allocated buffers duplicated in new buffers.
10168 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
10171 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
10173 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
10176 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
10178 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
10181 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
10183 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
10186 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
10187 * but with all dynamically-allocated buffers duplicated in new buffers.
10189 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
10192 * Creates a new CResult_SiPrefixNoneZ in the success state.
10194 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_ok(enum LDKSiPrefix o);
10197 * Creates a new CResult_SiPrefixNoneZ in the error state.
10199 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_err(void);
10202 * Frees any resources used by the CResult_SiPrefixNoneZ.
10204 void CResult_SiPrefixNoneZ_free(struct LDKCResult_SiPrefixNoneZ _res);
10207 * Creates a new CResult_SiPrefixNoneZ which has the same data as `orig`
10208 * but with all dynamically-allocated buffers duplicated in new buffers.
10210 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_clone(const struct LDKCResult_SiPrefixNoneZ *NONNULL_PTR orig);
10213 * Creates a new CResult_InvoiceNoneZ in the success state.
10215 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_ok(struct LDKInvoice o);
10218 * Creates a new CResult_InvoiceNoneZ in the error state.
10220 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_err(void);
10223 * Frees any resources used by the CResult_InvoiceNoneZ.
10225 void CResult_InvoiceNoneZ_free(struct LDKCResult_InvoiceNoneZ _res);
10228 * Creates a new CResult_InvoiceNoneZ which has the same data as `orig`
10229 * but with all dynamically-allocated buffers duplicated in new buffers.
10231 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_clone(const struct LDKCResult_InvoiceNoneZ *NONNULL_PTR orig);
10234 * Creates a new CResult_SignedRawInvoiceNoneZ in the success state.
10236 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_ok(struct LDKSignedRawInvoice o);
10239 * Creates a new CResult_SignedRawInvoiceNoneZ in the error state.
10241 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_err(void);
10244 * Frees any resources used by the CResult_SignedRawInvoiceNoneZ.
10246 void CResult_SignedRawInvoiceNoneZ_free(struct LDKCResult_SignedRawInvoiceNoneZ _res);
10249 * Creates a new CResult_SignedRawInvoiceNoneZ which has the same data as `orig`
10250 * but with all dynamically-allocated buffers duplicated in new buffers.
10252 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_clone(const struct LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR orig);
10255 * Creates a new tuple which has the same data as `orig`
10256 * but with all dynamically-allocated buffers duplicated in new buffers.
10258 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig);
10261 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
10263 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
10266 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
10268 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
10271 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
10273 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
10276 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
10278 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
10281 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
10283 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
10286 * Creates a new CResult_PayeePubKeyErrorZ which has the same data as `orig`
10287 * but with all dynamically-allocated buffers duplicated in new buffers.
10289 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig);
10292 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10294 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
10297 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
10299 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
10302 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
10304 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
10307 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
10309 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
10312 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
10313 * but with all dynamically-allocated buffers duplicated in new buffers.
10315 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
10318 * Creates a new CResult_NoneSemanticErrorZ in the success state.
10320 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
10323 * Creates a new CResult_NoneSemanticErrorZ in the error state.
10325 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
10328 * Frees any resources used by the CResult_NoneSemanticErrorZ.
10330 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
10333 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
10334 * but with all dynamically-allocated buffers duplicated in new buffers.
10336 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
10339 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
10341 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
10344 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
10346 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
10349 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
10351 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
10354 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
10355 * but with all dynamically-allocated buffers duplicated in new buffers.
10357 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
10360 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
10362 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
10365 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
10367 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
10370 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
10372 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
10375 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
10376 * but with all dynamically-allocated buffers duplicated in new buffers.
10378 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
10381 * Creates a new CResult_ExpiryTimeCreationErrorZ in the success state.
10383 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_ok(struct LDKExpiryTime o);
10386 * Creates a new CResult_ExpiryTimeCreationErrorZ in the error state.
10388 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_err(enum LDKCreationError e);
10391 * Frees any resources used by the CResult_ExpiryTimeCreationErrorZ.
10393 void CResult_ExpiryTimeCreationErrorZ_free(struct LDKCResult_ExpiryTimeCreationErrorZ _res);
10396 * Creates a new CResult_ExpiryTimeCreationErrorZ which has the same data as `orig`
10397 * but with all dynamically-allocated buffers duplicated in new buffers.
10399 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_clone(const struct LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR orig);
10402 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
10404 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
10407 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
10409 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
10412 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
10414 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
10417 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
10418 * but with all dynamically-allocated buffers duplicated in new buffers.
10420 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
10423 * Creates a new CResult_StringErrorZ in the success state.
10425 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
10428 * Creates a new CResult_StringErrorZ in the error state.
10430 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
10433 * Frees any resources used by the CResult_StringErrorZ.
10435 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
10438 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
10440 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
10443 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
10445 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
10448 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
10450 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
10453 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
10454 * but with all dynamically-allocated buffers duplicated in new buffers.
10456 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
10459 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
10461 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
10464 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
10466 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
10469 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
10471 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
10474 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
10475 * but with all dynamically-allocated buffers duplicated in new buffers.
10477 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
10480 * Creates a new CResult_NoneMonitorUpdateErrorZ in the success state.
10482 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
10485 * Creates a new CResult_NoneMonitorUpdateErrorZ in the error state.
10487 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
10490 * Frees any resources used by the CResult_NoneMonitorUpdateErrorZ.
10492 void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res);
10495 * Creates a new CResult_NoneMonitorUpdateErrorZ which has the same data as `orig`
10496 * but with all dynamically-allocated buffers duplicated in new buffers.
10498 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
10501 * Creates a new tuple which has the same data as `orig`
10502 * but with all dynamically-allocated buffers duplicated in new buffers.
10504 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
10507 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
10509 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
10512 * Frees any resources used by the C2Tuple_OutPointScriptZ.
10514 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
10517 * Creates a new tuple which has the same data as `orig`
10518 * but with all dynamically-allocated buffers duplicated in new buffers.
10520 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
10523 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
10525 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
10528 * Frees any resources used by the C2Tuple_u32ScriptZ.
10530 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
10533 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10535 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
10538 * Creates a new tuple which has the same data as `orig`
10539 * but with all dynamically-allocated buffers duplicated in new buffers.
10541 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig);
10544 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
10546 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
10549 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
10551 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
10554 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10556 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
10559 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10561 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
10564 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10566 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
10569 * Creates a new tuple which has the same data as `orig`
10570 * but with all dynamically-allocated buffers duplicated in new buffers.
10572 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
10575 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
10577 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
10580 * Frees any resources used by the C2Tuple_u32TxOutZ.
10582 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
10585 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10587 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
10590 * Creates a new tuple which has the same data as `orig`
10591 * but with all dynamically-allocated buffers duplicated in new buffers.
10593 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
10596 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
10598 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
10601 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
10603 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
10606 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10608 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
10611 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
10613 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
10616 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
10618 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
10621 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
10623 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
10626 * Creates a new CResult_boolLightningErrorZ in the success state.
10628 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
10631 * Creates a new CResult_boolLightningErrorZ in the error state.
10633 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
10636 * Frees any resources used by the CResult_boolLightningErrorZ.
10638 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
10641 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
10642 * but with all dynamically-allocated buffers duplicated in new buffers.
10644 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
10647 * Creates a new tuple which has the same data as `orig`
10648 * but with all dynamically-allocated buffers duplicated in new buffers.
10650 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
10653 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
10655 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
10658 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
10660 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
10663 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10665 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
10668 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10670 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
10673 * Creates a new CResult_NoneLightningErrorZ in the success state.
10675 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
10678 * Creates a new CResult_NoneLightningErrorZ in the error state.
10680 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
10683 * Frees any resources used by the CResult_NoneLightningErrorZ.
10685 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
10688 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
10689 * but with all dynamically-allocated buffers duplicated in new buffers.
10691 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
10694 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10696 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
10699 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
10701 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
10704 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
10706 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
10709 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
10711 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
10714 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
10715 * but with all dynamically-allocated buffers duplicated in new buffers.
10717 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
10720 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
10722 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
10725 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
10727 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
10730 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
10732 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
10735 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
10736 * but with all dynamically-allocated buffers duplicated in new buffers.
10738 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
10741 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
10743 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
10746 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
10748 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
10751 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
10753 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
10756 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
10757 * but with all dynamically-allocated buffers duplicated in new buffers.
10759 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
10762 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the success state.
10764 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
10767 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the error state.
10769 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
10772 * Frees any resources used by the CResult_DirectionalChannelInfoDecodeErrorZ.
10774 void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
10777 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ which has the same data as `orig`
10778 * but with all dynamically-allocated buffers duplicated in new buffers.
10780 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
10783 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
10785 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
10788 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
10790 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
10793 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
10795 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
10798 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
10799 * but with all dynamically-allocated buffers duplicated in new buffers.
10801 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
10804 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
10806 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
10809 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
10811 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
10814 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
10816 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
10819 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
10820 * but with all dynamically-allocated buffers duplicated in new buffers.
10822 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
10825 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
10827 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
10830 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
10832 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
10835 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
10837 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
10840 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
10841 * but with all dynamically-allocated buffers duplicated in new buffers.
10843 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
10846 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10848 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
10851 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
10853 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
10856 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
10858 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
10861 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
10863 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
10866 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
10867 * but with all dynamically-allocated buffers duplicated in new buffers.
10869 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
10872 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
10874 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
10877 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
10879 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
10882 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
10884 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
10887 * Creates a new CResult_NetworkGraphDecodeErrorZ which has the same data as `orig`
10888 * but with all dynamically-allocated buffers duplicated in new buffers.
10890 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
10893 * Creates a new CResult_NetAddressu8Z in the success state.
10895 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
10898 * Creates a new CResult_NetAddressu8Z in the error state.
10900 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
10903 * Frees any resources used by the CResult_NetAddressu8Z.
10905 void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
10908 * Creates a new CResult_NetAddressu8Z which has the same data as `orig`
10909 * but with all dynamically-allocated buffers duplicated in new buffers.
10911 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
10914 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the success state.
10916 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
10919 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the error state.
10921 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
10924 * Frees any resources used by the CResult_CResult_NetAddressu8ZDecodeErrorZ.
10926 void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
10929 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ which has the same data as `orig`
10930 * but with all dynamically-allocated buffers duplicated in new buffers.
10932 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
10935 * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
10937 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
10940 * Creates a new CResult_NetAddressDecodeErrorZ in the error state.
10942 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
10945 * Frees any resources used by the CResult_NetAddressDecodeErrorZ.
10947 void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
10950 * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig`
10951 * but with all dynamically-allocated buffers duplicated in new buffers.
10953 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
10956 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10958 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
10961 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10963 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
10966 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10968 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
10971 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10973 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
10976 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
10978 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
10981 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
10983 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
10986 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
10988 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
10991 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
10992 * but with all dynamically-allocated buffers duplicated in new buffers.
10994 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
10997 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
10999 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
11002 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
11004 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
11007 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
11009 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
11012 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
11013 * but with all dynamically-allocated buffers duplicated in new buffers.
11015 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
11018 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
11020 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
11023 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
11025 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
11028 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
11030 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
11033 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
11034 * but with all dynamically-allocated buffers duplicated in new buffers.
11036 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
11039 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
11041 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
11044 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
11046 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
11049 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
11051 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
11054 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
11055 * but with all dynamically-allocated buffers duplicated in new buffers.
11057 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
11060 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
11062 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
11065 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
11067 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
11070 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
11072 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
11075 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
11076 * but with all dynamically-allocated buffers duplicated in new buffers.
11078 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
11081 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
11083 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
11086 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
11088 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
11091 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
11093 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
11096 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
11097 * but with all dynamically-allocated buffers duplicated in new buffers.
11099 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
11102 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
11104 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
11107 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
11109 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
11112 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
11114 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
11117 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
11118 * but with all dynamically-allocated buffers duplicated in new buffers.
11120 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
11123 * Creates a new CResult_FundingLockedDecodeErrorZ in the success state.
11125 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
11128 * Creates a new CResult_FundingLockedDecodeErrorZ in the error state.
11130 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
11133 * Frees any resources used by the CResult_FundingLockedDecodeErrorZ.
11135 void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
11138 * Creates a new CResult_FundingLockedDecodeErrorZ which has the same data as `orig`
11139 * but with all dynamically-allocated buffers duplicated in new buffers.
11141 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
11144 * Creates a new CResult_InitDecodeErrorZ in the success state.
11146 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
11149 * Creates a new CResult_InitDecodeErrorZ in the error state.
11151 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
11154 * Frees any resources used by the CResult_InitDecodeErrorZ.
11156 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
11159 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
11160 * but with all dynamically-allocated buffers duplicated in new buffers.
11162 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
11165 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
11167 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
11170 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
11172 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
11175 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
11177 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
11180 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
11181 * but with all dynamically-allocated buffers duplicated in new buffers.
11183 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
11186 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
11188 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
11191 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
11193 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
11196 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
11198 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
11201 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
11202 * but with all dynamically-allocated buffers duplicated in new buffers.
11204 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
11207 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
11209 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
11212 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
11214 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
11217 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
11219 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
11222 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
11223 * but with all dynamically-allocated buffers duplicated in new buffers.
11225 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
11228 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
11230 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
11233 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
11235 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
11238 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
11240 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
11243 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
11244 * but with all dynamically-allocated buffers duplicated in new buffers.
11246 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
11249 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
11251 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
11254 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
11256 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
11259 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
11261 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
11264 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
11265 * but with all dynamically-allocated buffers duplicated in new buffers.
11267 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
11270 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
11272 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
11275 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
11277 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
11280 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
11282 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
11285 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
11286 * but with all dynamically-allocated buffers duplicated in new buffers.
11288 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
11291 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
11293 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
11296 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
11298 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
11301 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
11303 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
11306 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
11307 * but with all dynamically-allocated buffers duplicated in new buffers.
11309 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
11312 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
11314 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
11317 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
11319 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
11322 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
11324 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
11327 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
11328 * but with all dynamically-allocated buffers duplicated in new buffers.
11330 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
11333 * Creates a new CResult_PingDecodeErrorZ in the success state.
11335 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
11338 * Creates a new CResult_PingDecodeErrorZ in the error state.
11340 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
11343 * Frees any resources used by the CResult_PingDecodeErrorZ.
11345 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
11348 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
11349 * but with all dynamically-allocated buffers duplicated in new buffers.
11351 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
11354 * Creates a new CResult_PongDecodeErrorZ in the success state.
11356 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
11359 * Creates a new CResult_PongDecodeErrorZ in the error state.
11361 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
11364 * Frees any resources used by the CResult_PongDecodeErrorZ.
11366 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
11369 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
11370 * but with all dynamically-allocated buffers duplicated in new buffers.
11372 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
11375 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
11377 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
11380 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
11382 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
11385 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
11387 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
11390 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
11391 * but with all dynamically-allocated buffers duplicated in new buffers.
11393 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
11396 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
11398 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
11401 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
11403 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
11406 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
11408 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
11411 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
11412 * but with all dynamically-allocated buffers duplicated in new buffers.
11414 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
11417 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
11419 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
11422 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
11424 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
11427 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
11429 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
11432 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
11433 * but with all dynamically-allocated buffers duplicated in new buffers.
11435 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
11438 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
11440 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
11443 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
11445 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
11448 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
11450 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
11453 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
11454 * but with all dynamically-allocated buffers duplicated in new buffers.
11456 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
11459 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
11461 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
11464 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
11466 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
11469 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
11471 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
11474 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
11475 * but with all dynamically-allocated buffers duplicated in new buffers.
11477 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
11480 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
11482 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
11485 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
11487 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
11490 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
11492 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
11495 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
11496 * but with all dynamically-allocated buffers duplicated in new buffers.
11498 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
11501 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
11503 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
11506 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
11508 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
11511 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
11513 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
11516 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
11517 * but with all dynamically-allocated buffers duplicated in new buffers.
11519 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
11522 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
11524 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
11527 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
11529 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
11532 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
11534 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
11537 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
11538 * but with all dynamically-allocated buffers duplicated in new buffers.
11540 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
11543 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
11545 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
11548 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
11550 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
11553 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
11555 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
11558 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
11559 * but with all dynamically-allocated buffers duplicated in new buffers.
11561 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
11564 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
11566 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
11569 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
11571 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
11574 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
11576 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
11579 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
11580 * but with all dynamically-allocated buffers duplicated in new buffers.
11582 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
11585 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
11587 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
11590 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
11592 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
11595 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
11597 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
11600 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
11601 * but with all dynamically-allocated buffers duplicated in new buffers.
11603 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
11606 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
11608 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
11611 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
11613 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
11616 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
11618 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
11621 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
11622 * but with all dynamically-allocated buffers duplicated in new buffers.
11624 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
11627 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state.
11629 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o);
11632 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state.
11634 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
11637 * Frees any resources used by the CResult_InvoiceSignOrCreationErrorZ.
11639 void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res);
11642 * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig`
11643 * but with all dynamically-allocated buffers duplicated in new buffers.
11645 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
11648 * Frees any resources used by the Event
11650 void Event_free(struct LDKEvent this_ptr);
11653 * Creates a copy of the Event
11655 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
11658 * Serialize the Event object into a byte array which can be read by Event_read
11660 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
11663 * Frees any resources used by the MessageSendEvent
11665 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
11668 * Creates a copy of the MessageSendEvent
11670 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
11673 * Calls the free function if one is set
11675 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
11678 * Calls the free function if one is set
11680 void EventsProvider_free(struct LDKEventsProvider this_ptr);
11683 * Calls the free function if one is set
11685 void EventHandler_free(struct LDKEventHandler this_ptr);
11688 * Frees any resources used by the APIError
11690 void APIError_free(struct LDKAPIError this_ptr);
11693 * Creates a copy of the APIError
11695 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
11698 * Creates a digital signature of a message given a SecretKey, like the node's secret.
11699 * 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.
11700 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
11702 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
11705 * Recovers the PublicKey of the signer of the message given the message and the signature.
11707 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
11710 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
11711 * and the PublicKey.
11713 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
11716 * Creates a copy of the Level
11718 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
11721 * Checks if two Levels contain equal inner contents.
11722 * This ignores pointers and is_owned flags and looks at the values in fields.
11724 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
11727 * Checks if two Levels contain equal inner contents.
11729 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
11732 * Returns the most verbose logging level.
11734 MUST_USE_RES enum LDKLevel Level_max(void);
11737 * Calls the free function if one is set
11739 void Logger_free(struct LDKLogger this_ptr);
11742 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
11744 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
11747 * Confirmations we will wait for before considering the channel locked in.
11748 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
11749 * equivalent limit applied to outbound channels).
11751 * Default value: 6.
11753 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
11756 * Confirmations we will wait for before considering the channel locked in.
11757 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
11758 * equivalent limit applied to outbound channels).
11760 * Default value: 6.
11762 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
11765 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
11766 * the number of blocks we have to punish our counterparty if they broadcast a revoked
11769 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
11770 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
11771 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
11772 * possibly with time in between to RBF the spending transaction).
11774 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
11775 * case of an honest unilateral channel close, which implicitly decrease the economic value of
11778 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
11779 * can tweak config to ask for more security, not less.
11781 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
11784 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
11785 * the number of blocks we have to punish our counterparty if they broadcast a revoked
11788 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
11789 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
11790 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
11791 * possibly with time in between to RBF the spending transaction).
11793 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
11794 * case of an honest unilateral channel close, which implicitly decrease the economic value of
11797 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
11798 * can tweak config to ask for more security, not less.
11800 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
11803 * Set to the smallest value HTLC we will accept to process.
11805 * This value is sent to our counterparty on channel-open and we close the channel any time
11806 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
11808 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
11811 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
11814 * Set to the smallest value HTLC we will accept to process.
11816 * This value is sent to our counterparty on channel-open and we close the channel any time
11817 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
11819 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
11822 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
11825 * Constructs a new ChannelHandshakeConfig given each field
11827 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);
11830 * Creates a copy of the ChannelHandshakeConfig
11832 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
11835 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
11837 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
11840 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
11842 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
11845 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
11846 * only applies to inbound channels.
11848 * Default value: 0.
11850 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11853 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
11854 * only applies to inbound channels.
11856 * Default value: 0.
11858 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11861 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
11862 * you to limit the maximum minimum-size they can require.
11864 * Default value: u64::max_value.
11866 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11869 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
11870 * you to limit the maximum minimum-size they can require.
11872 * Default value: u64::max_value.
11874 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11877 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
11878 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
11880 * Default value: 0.
11882 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11885 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
11886 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
11888 * Default value: 0.
11890 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11893 * The remote node will require we keep a certain amount in direct payment to ourselves at all
11894 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
11895 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
11897 * Default value: u64::max_value.
11899 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11902 * The remote node will require we keep a certain amount in direct payment to ourselves at all
11903 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
11904 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
11906 * Default value: u64::max_value.
11908 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11911 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
11912 * time. This allows you to set a minimum such value.
11914 * Default value: 0.
11916 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11919 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
11920 * time. This allows you to set a minimum such value.
11922 * Default value: 0.
11924 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
11927 * Before a channel is usable the funding transaction will need to be confirmed by at least a
11928 * certain number of blocks, specified by the node which is not the funder (as the funder can
11929 * assume they aren't going to double-spend themselves).
11930 * This config allows you to set a limit on the maximum amount of time to wait.
11932 * Default value: 144, or roughly one day and only applies to outbound channels.
11934 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11937 * Before a channel is usable the funding transaction will need to be confirmed by at least a
11938 * certain number of blocks, specified by the node which is not the funder (as the funder can
11939 * assume they aren't going to double-spend themselves).
11940 * This config allows you to set a limit on the maximum amount of time to wait.
11942 * Default value: 144, or roughly one day and only applies to outbound channels.
11944 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
11947 * Set to force an incoming channel to match our announced channel preference in
11948 * [`ChannelConfig::announced_channel`].
11950 * For a node which is not online reliably, this should be set to true and
11951 * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
11952 * channels will ever be opened.
11954 * Default value: true.
11956 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11959 * Set to force an incoming channel to match our announced channel preference in
11960 * [`ChannelConfig::announced_channel`].
11962 * For a node which is not online reliably, this should be set to true and
11963 * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
11964 * channels will ever be opened.
11966 * Default value: true.
11968 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
11971 * Set to the amount of time we're willing to wait to claim money back to us.
11973 * Not checking this value would be a security issue, as our peer would be able to set it to
11974 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
11976 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
11977 * reduce the loss of having useless locked funds (if your peer accepts)
11979 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11982 * Set to the amount of time we're willing to wait to claim money back to us.
11984 * Not checking this value would be a security issue, as our peer would be able to set it to
11985 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
11987 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
11988 * reduce the loss of having useless locked funds (if your peer accepts)
11990 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
11993 * Constructs a new ChannelHandshakeLimits given each field
11995 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);
11998 * Creates a copy of the ChannelHandshakeLimits
12000 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
12003 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
12005 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
12008 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
12010 void ChannelConfig_free(struct LDKChannelConfig this_obj);
12013 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
12014 * over the channel.
12015 * This may be allowed to change at runtime in a later update, however doing so must result in
12016 * update messages sent to notify all nodes of our updated relay fee.
12018 * Default value: 0.
12020 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
12023 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
12024 * over the channel.
12025 * This may be allowed to change at runtime in a later update, however doing so must result in
12026 * update messages sent to notify all nodes of our updated relay fee.
12028 * Default value: 0.
12030 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
12033 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
12034 * excess of [`forwarding_fee_proportional_millionths`].
12035 * This may be allowed to change at runtime in a later update, however doing so must result in
12036 * update messages sent to notify all nodes of our updated relay fee.
12038 * The default value of a single satoshi roughly matches the market rate on many routing nodes
12039 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
12042 * Default value: 1000.
12044 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
12046 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
12049 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
12050 * excess of [`forwarding_fee_proportional_millionths`].
12051 * This may be allowed to change at runtime in a later update, however doing so must result in
12052 * update messages sent to notify all nodes of our updated relay fee.
12054 * The default value of a single satoshi roughly matches the market rate on many routing nodes
12055 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
12058 * Default value: 1000.
12060 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
12062 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
12065 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
12066 * the channel this config applies to.
12068 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
12069 * HTLC balance when a channel appears on-chain whereas
12070 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
12071 * (non-HTLC-encumbered) balance.
12073 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
12074 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
12075 * commitment transaction at least once per this many blocks (minus some margin to allow us
12076 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
12077 * the spending transaction).
12079 * Default value: 72 (12 hours at an average of 6 blocks/hour).
12080 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
12081 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
12083 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
12085 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
12088 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
12089 * the channel this config applies to.
12091 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
12092 * HTLC balance when a channel appears on-chain whereas
12093 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
12094 * (non-HTLC-encumbered) balance.
12096 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
12097 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
12098 * commitment transaction at least once per this many blocks (minus some margin to allow us
12099 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
12100 * the spending transaction).
12102 * Default value: 72 (12 hours at an average of 6 blocks/hour).
12103 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
12104 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
12106 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
12108 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
12111 * Set to announce the channel publicly and notify all nodes that they can route via this
12114 * This should only be set to true for nodes which expect to be online reliably.
12116 * As the node which funds a channel picks this value this will only apply for new outbound
12117 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
12119 * This cannot be changed after the initial channel handshake.
12121 * Default value: false.
12123 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
12126 * Set to announce the channel publicly and notify all nodes that they can route via this
12129 * This should only be set to true for nodes which expect to be online reliably.
12131 * As the node which funds a channel picks this value this will only apply for new outbound
12132 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
12134 * This cannot be changed after the initial channel handshake.
12136 * Default value: false.
12138 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
12141 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
12142 * supports it, they will then enforce the mutual-close output to us matches what we provided
12143 * at intialization, preventing us from closing to an alternate pubkey.
12145 * This is set to true by default to provide a slight increase in security, though ultimately
12146 * any attacker who is able to take control of a channel can just as easily send the funds via
12147 * lightning payments, so we never require that our counterparties support this option.
12149 * This cannot be changed after a channel has been initialized.
12151 * Default value: true.
12153 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
12156 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
12157 * supports it, they will then enforce the mutual-close output to us matches what we provided
12158 * at intialization, preventing us from closing to an alternate pubkey.
12160 * This is set to true by default to provide a slight increase in security, though ultimately
12161 * any attacker who is able to take control of a channel can just as easily send the funds via
12162 * lightning payments, so we never require that our counterparties support this option.
12164 * This cannot be changed after a channel has been initialized.
12166 * Default value: true.
12168 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
12171 * Constructs a new ChannelConfig given each field
12173 MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t forwarding_fee_proportional_millionths_arg, uint32_t forwarding_fee_base_msat_arg, uint16_t cltv_expiry_delta_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
12176 * Creates a copy of the ChannelConfig
12178 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
12181 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
12183 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
12186 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
12188 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
12191 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
12193 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
12196 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
12198 void UserConfig_free(struct LDKUserConfig this_obj);
12201 * Channel config that we propose to our counterparty.
12203 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
12206 * Channel config that we propose to our counterparty.
12208 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
12211 * Limits applied to our counterparty's proposed channel config settings.
12213 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
12216 * Limits applied to our counterparty's proposed channel config settings.
12218 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
12221 * Channel config which affects behavior during channel lifetime.
12223 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
12226 * Channel config which affects behavior during channel lifetime.
12228 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
12231 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
12232 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
12233 * node which is not online reliably.
12235 * For nodes which are not online reliably, you should set all channels to *not* be announced
12236 * (using [`ChannelConfig::announced_channel`] and
12237 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
12238 * ensure you are not exposed to any forwarding risk.
12240 * Note that because you cannot change a channel's announced state after creation, there is no
12241 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
12242 * from a publicly-announced forwarding node to a private non-forwarding node you must close
12243 * all your channels and open new ones. For privacy, you should also change your node_id
12244 * (swapping all private and public key material for new ones) at that time.
12246 * Default value: false.
12248 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
12251 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
12252 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
12253 * node which is not online reliably.
12255 * For nodes which are not online reliably, you should set all channels to *not* be announced
12256 * (using [`ChannelConfig::announced_channel`] and
12257 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
12258 * ensure you are not exposed to any forwarding risk.
12260 * Note that because you cannot change a channel's announced state after creation, there is no
12261 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
12262 * from a publicly-announced forwarding node to a private non-forwarding node you must close
12263 * all your channels and open new ones. For privacy, you should also change your node_id
12264 * (swapping all private and public key material for new ones) at that time.
12266 * Default value: false.
12268 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
12271 * Constructs a new UserConfig given each field
12273 MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig own_channel_config_arg, struct LDKChannelHandshakeLimits peer_channel_config_limits_arg, struct LDKChannelConfig channel_options_arg, bool accept_forwards_to_priv_channels_arg);
12276 * Creates a copy of the UserConfig
12278 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
12281 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
12283 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
12286 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
12288 void BestBlock_free(struct LDKBestBlock this_obj);
12291 * Creates a copy of the BestBlock
12293 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
12296 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
12299 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
12302 * Returns a `BestBlock` as identified by the given block hash and height.
12304 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
12307 * Returns the best block hash.
12309 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
12312 * Returns the best block height.
12314 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
12317 * Creates a copy of the AccessError
12319 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
12322 * Calls the free function if one is set
12324 void Access_free(struct LDKAccess this_ptr);
12327 * Calls the free function if one is set
12329 void Listen_free(struct LDKListen this_ptr);
12332 * Calls the free function if one is set
12334 void Confirm_free(struct LDKConfirm this_ptr);
12337 * Calls the free function if one is set
12339 void Watch_free(struct LDKWatch this_ptr);
12342 * Calls the free function if one is set
12344 void Filter_free(struct LDKFilter this_ptr);
12347 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
12349 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
12352 * First block where the transaction output may have been spent.
12354 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
12357 * First block where the transaction output may have been spent.
12359 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12362 * Outpoint identifying the transaction output.
12364 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
12367 * Outpoint identifying the transaction output.
12369 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
12372 * Spending condition of the transaction output.
12374 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
12377 * Spending condition of the transaction output.
12379 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
12382 * Constructs a new WatchedOutput given each field
12384 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
12387 * Creates a copy of the WatchedOutput
12389 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
12392 * Checks if two WatchedOutputs contain equal inner contents.
12394 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
12397 * Calls the free function if one is set
12399 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
12402 * Creates a copy of the ConfirmationTarget
12404 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
12407 * Calls the free function if one is set
12409 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
12412 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
12414 void ChainMonitor_free(struct LDKChainMonitor this_obj);
12417 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
12419 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
12420 * will call back to it indicating transactions and outputs of interest. This allows clients to
12421 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
12422 * always need to fetch full blocks absent another means for determining which blocks contain
12423 * transactions relevant to the watched channels.
12425 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
12428 * Constructs a new Listen which calls the relevant methods on this_arg.
12429 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
12431 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
12434 * Constructs a new Confirm which calls the relevant methods on this_arg.
12435 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
12437 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
12440 * Constructs a new Watch which calls the relevant methods on this_arg.
12441 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
12443 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
12446 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
12447 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
12449 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
12452 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
12454 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
12457 * The sequence number of this update. Updates *must* be replayed in-order according to this
12458 * sequence number (and updates may panic if they are not). The update_id values are strictly
12459 * increasing and increase by one for each new update, with one exception specified below.
12461 * This sequence number is also used to track up to which points updates which returned
12462 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
12463 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
12465 * The only instance where update_id values are not strictly increasing is the case where we
12466 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
12467 * its docs for more details.
12469 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
12472 * The sequence number of this update. Updates *must* be replayed in-order according to this
12473 * sequence number (and updates may panic if they are not). The update_id values are strictly
12474 * increasing and increase by one for each new update, with one exception specified below.
12476 * This sequence number is also used to track up to which points updates which returned
12477 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
12478 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
12480 * The only instance where update_id values are not strictly increasing is the case where we
12481 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
12482 * its docs for more details.
12484 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
12487 * Creates a copy of the ChannelMonitorUpdate
12489 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
12492 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
12494 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
12497 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
12499 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
12502 * Creates a copy of the ChannelMonitorUpdateErr
12504 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
12507 * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
12509 void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
12512 * Creates a copy of the MonitorUpdateError
12514 struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
12517 * Frees any resources used by the MonitorEvent
12519 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
12522 * Creates a copy of the MonitorEvent
12524 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
12527 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
12529 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
12532 * Creates a copy of the HTLCUpdate
12534 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
12537 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
12539 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
12542 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
12544 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
12547 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
12549 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
12552 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
12554 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
12557 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
12560 * panics if the given update is not the next update by update_id.
12562 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);
12565 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
12568 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12571 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
12573 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12576 * Gets a list of txids, with their output scripts (in the order they appear in the
12577 * transaction), which we must learn about spends of via block_connected().
12579 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12582 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
12583 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
12584 * have been registered.
12586 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
12589 * Get the list of HTLCs who's status has been updated on chain. This should be called by
12590 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
12592 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12595 * Gets the list of pending events which were generated by previous actions, clearing the list
12598 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
12599 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
12600 * no internal locking in ChannelMonitors.
12602 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12605 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
12606 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
12607 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
12608 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
12609 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
12610 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
12611 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
12612 * out-of-band the other node operator to coordinate with him if option is available to you.
12613 * In any-case, choice is up to the user.
12615 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);
12618 * Processes transactions in a newly connected block, which may result in any of the following:
12619 * - update the monitor's state against resolved HTLCs
12620 * - punish the counterparty in the case of seeing a revoked commitment transaction
12621 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
12622 * - detect settled outputs for later spending
12623 * - schedule and bump any in-flight claims
12625 * Returns any new outputs to watch from `txdata`; after called, these are also included in
12626 * [`get_outputs_to_watch`].
12628 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
12630 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);
12633 * Determines if the disconnected block contained any transactions of interest and updates
12636 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);
12639 * Processes transactions confirmed in a block with the given header and height, returning new
12640 * outputs to watch. See [`block_connected`] for details.
12642 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
12643 * blocks. See [`chain::Confirm`] for calling expectations.
12645 * [`block_connected`]: Self::block_connected
12647 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);
12650 * Processes a transaction that was reorganized out of the chain.
12652 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
12653 * than blocks. See [`chain::Confirm`] for calling expectations.
12655 * [`block_disconnected`]: Self::block_disconnected
12657 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);
12660 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
12661 * [`block_connected`] for details.
12663 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
12664 * blocks. See [`chain::Confirm`] for calling expectations.
12666 * [`block_connected`]: Self::block_connected
12668 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);
12671 * Returns the set of txids that should be monitored for re-organization out of the chain.
12673 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12676 * Gets the latest best block which was connected either via the [`chain::Listen`] or
12677 * [`chain::Confirm`] interfaces.
12679 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12682 * Calls the free function if one is set
12684 void Persist_free(struct LDKPersist this_ptr);
12687 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
12689 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
12692 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
12694 void OutPoint_free(struct LDKOutPoint this_obj);
12697 * The referenced transaction's txid.
12699 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
12702 * The referenced transaction's txid.
12704 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12707 * The index of the referenced output in its transaction's vout.
12709 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
12712 * The index of the referenced output in its transaction's vout.
12714 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
12717 * Constructs a new OutPoint given each field
12719 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
12722 * Creates a copy of the OutPoint
12724 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
12727 * Checks if two OutPoints contain equal inner contents.
12728 * This ignores pointers and is_owned flags and looks at the values in fields.
12729 * Two objects with NULL inner values will be considered "equal" here.
12731 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
12734 * Checks if two OutPoints contain equal inner contents.
12736 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
12739 * Convert an `OutPoint` to a lightning channel id.
12741 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
12744 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
12746 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
12749 * Read a OutPoint from a byte array, created by OutPoint_write
12751 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
12754 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
12756 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
12759 * The outpoint which is spendable
12761 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12764 * The outpoint which is spendable
12766 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
12769 * Per commitment point to derive delayed_payment_key by key holder
12771 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12774 * Per commitment point to derive delayed_payment_key by key holder
12776 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12779 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
12780 * the witness_script.
12782 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12785 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
12786 * the witness_script.
12788 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
12791 * The output which is referenced by the given outpoint
12793 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
12796 * The revocation point specific to the commitment transaction which was broadcast. Used to
12797 * derive the witnessScript for this output.
12799 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12802 * The revocation point specific to the commitment transaction which was broadcast. Used to
12803 * derive the witnessScript for this output.
12805 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12808 * Arbitrary identification information returned by a call to
12809 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12810 * the channel to spend the output.
12812 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
12815 * Arbitrary identification information returned by a call to
12816 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12817 * the channel to spend the output.
12819 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12822 * The value of the channel which this output originated from, possibly indirectly.
12824 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12827 * The value of the channel which this output originated from, possibly indirectly.
12829 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
12832 * Constructs a new DelayedPaymentOutputDescriptor given each field
12834 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);
12837 * Creates a copy of the DelayedPaymentOutputDescriptor
12839 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
12842 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
12844 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
12847 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
12849 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
12852 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
12854 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
12857 * The outpoint which is spendable
12859 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12862 * The outpoint which is spendable
12864 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
12867 * The output which is referenced by the given outpoint
12869 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
12872 * Arbitrary identification information returned by a call to
12873 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12874 * the channel to spend the output.
12876 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
12879 * Arbitrary identification information returned by a call to
12880 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12881 * the channel to spend the output.
12883 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12886 * The value of the channel which this transactions spends.
12888 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12891 * The value of the channel which this transactions spends.
12893 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
12896 * Constructs a new StaticPaymentOutputDescriptor given each field
12898 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);
12901 * Creates a copy of the StaticPaymentOutputDescriptor
12903 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
12906 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
12908 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
12911 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
12913 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
12916 * Frees any resources used by the SpendableOutputDescriptor
12918 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
12921 * Creates a copy of the SpendableOutputDescriptor
12923 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
12926 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
12928 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
12931 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
12933 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
12936 * Calls the free function if one is set
12938 void BaseSign_free(struct LDKBaseSign this_ptr);
12941 * Creates a copy of a Sign
12943 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
12946 * Calls the free function if one is set
12948 void Sign_free(struct LDKSign this_ptr);
12951 * Calls the free function if one is set
12953 void KeysInterface_free(struct LDKKeysInterface this_ptr);
12956 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
12958 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
12961 * Private key of anchor tx
12963 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12966 * Private key of anchor tx
12968 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12971 * Holder secret key for blinded revocation pubkey
12973 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12976 * Holder secret key for blinded revocation pubkey
12978 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12981 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
12983 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12986 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
12988 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12991 * Holder secret key used in HTLC tx
12993 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12996 * Holder secret key used in HTLC tx
12998 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
13001 * Holder htlc secret key used in commitment tx htlc outputs
13003 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
13006 * Holder htlc secret key used in commitment tx htlc outputs
13008 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
13013 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
13018 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13021 * Creates a copy of the InMemorySigner
13023 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
13026 * Create a new InMemorySigner
13028 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);
13031 * Counterparty pubkeys.
13032 * Will panic if ready_channel wasn't called.
13034 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13037 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
13038 * transactions, ie the amount of time that we have to wait to recover our funds if we
13039 * broadcast a transaction.
13040 * Will panic if ready_channel wasn't called.
13042 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13045 * The contest_delay value specified by us and applied on transactions broadcastable
13046 * by our counterparty, ie the amount of time that they have to wait to recover their funds
13047 * if they broadcast a transaction.
13048 * Will panic if ready_channel wasn't called.
13050 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13053 * Whether the holder is the initiator
13054 * Will panic if ready_channel wasn't called.
13056 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13060 * Will panic if ready_channel wasn't called.
13062 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13065 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
13066 * building transactions.
13068 * Will panic if ready_channel wasn't called.
13070 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13073 * Sign the single input of spend_tx at index `input_idx` which spends the output
13074 * described by descriptor, returning the witness stack for the input.
13076 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
13077 * or is not spending the outpoint described by `descriptor.outpoint`.
13079 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);
13082 * Sign the single input of spend_tx at index `input_idx` which spends the output
13083 * described by descriptor, returning the witness stack for the input.
13085 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
13086 * is not spending the outpoint described by `descriptor.outpoint`, or does not have a
13087 * sequence set to `descriptor.to_self_delay`.
13089 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);
13092 * Constructs a new BaseSign which calls the relevant methods on this_arg.
13093 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
13095 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13098 * Constructs a new Sign which calls the relevant methods on this_arg.
13099 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
13101 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13104 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
13106 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
13109 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
13111 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
13114 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
13116 void KeysManager_free(struct LDKKeysManager this_obj);
13119 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
13120 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
13121 * starting_time isn't strictly required to actually be a time, but it must absolutely,
13122 * without a doubt, be unique to this instance. ie if you start multiple times with the same
13123 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
13124 * simply use the current time (with very high precision).
13126 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
13127 * obviously, starting_time should be unique every time you reload the library - it is only
13128 * used to generate new ephemeral key data (which will be stored by the individual channel if
13131 * Note that the seed is required to recover certain on-chain funds independent of
13132 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
13133 * channel, and some on-chain during-closing funds.
13135 * Note that until the 0.1 release there is no guarantee of backward compatibility between
13136 * versions. Once the library is more fully supported, the docs will be updated to include a
13137 * detailed description of the guarantee.
13139 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
13142 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
13144 * Key derivation parameters are accessible through a per-channel secrets
13145 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
13146 * onchain output detection for which a corresponding delayed_payment_key must be derived.
13148 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]);
13151 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
13152 * output to the given change destination (if sufficient change value remains). The
13153 * transaction will have a feerate, at least, of the given value.
13155 * Returns `Err(())` if the output value is greater than the input value minus required fee or
13156 * if a descriptor was duplicated.
13158 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
13160 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
13161 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
13163 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);
13166 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
13167 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
13169 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
13172 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
13174 void ChannelManager_free(struct LDKChannelManager this_obj);
13177 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
13179 void ChainParameters_free(struct LDKChainParameters this_obj);
13182 * The network for determining the `chain_hash` in Lightning messages.
13184 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
13187 * The network for determining the `chain_hash` in Lightning messages.
13189 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
13192 * The hash and height of the latest block successfully connected.
13194 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
13196 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
13199 * The hash and height of the latest block successfully connected.
13201 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
13203 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
13206 * Constructs a new ChainParameters given each field
13208 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
13211 * Creates a copy of the ChainParameters
13213 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
13216 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
13218 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
13221 * The node_id of our counterparty
13223 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
13226 * The node_id of our counterparty
13228 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13231 * The Features the channel counterparty provided upon last connection.
13232 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
13233 * many routing-relevant features are present in the init context.
13235 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
13238 * The Features the channel counterparty provided upon last connection.
13239 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
13240 * many routing-relevant features are present in the init context.
13242 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
13245 * The value, in satoshis, that must always be held in the channel for our counterparty. This
13246 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
13247 * claiming at least this value on chain.
13249 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
13251 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
13253 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
13256 * The value, in satoshis, that must always be held in the channel for our counterparty. This
13257 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
13258 * claiming at least this value on chain.
13260 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
13262 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
13264 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
13267 * Creates a copy of the ChannelCounterparty
13269 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
13272 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
13274 void ChannelDetails_free(struct LDKChannelDetails this_obj);
13277 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
13278 * thereafter this is the txid of the funding transaction xor the funding transaction output).
13279 * Note that this means this value is *not* persistent - it can change once during the
13280 * lifetime of the channel.
13282 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
13285 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
13286 * thereafter this is the txid of the funding transaction xor the funding transaction output).
13287 * Note that this means this value is *not* persistent - it can change once during the
13288 * lifetime of the channel.
13290 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13293 * Parameters which apply to our counterparty. See individual fields for more information.
13295 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13298 * Parameters which apply to our counterparty. See individual fields for more information.
13300 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
13303 * The Channel's funding transaction output, if we've negotiated the funding transaction with
13304 * our counterparty already.
13306 * Note that, if this has been set, `channel_id` will be equivalent to
13307 * `funding_txo.unwrap().to_channel_id()`.
13309 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13312 * The Channel's funding transaction output, if we've negotiated the funding transaction with
13313 * our counterparty already.
13315 * Note that, if this has been set, `channel_id` will be equivalent to
13316 * `funding_txo.unwrap().to_channel_id()`.
13318 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
13321 * The position of the funding transaction in the chain. None if the funding transaction has
13322 * not yet been confirmed and the channel fully opened.
13324 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13327 * The position of the funding transaction in the chain. None if the funding transaction has
13328 * not yet been confirmed and the channel fully opened.
13330 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
13333 * The value, in satoshis, of this channel as appears in the funding output
13335 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13338 * The value, in satoshis, of this channel as appears in the funding output
13340 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
13343 * The value, in satoshis, that must always be held in the channel for us. This value ensures
13344 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
13345 * this value on chain.
13347 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
13349 * This value will be `None` for outbound channels until the counterparty accepts the channel.
13351 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
13353 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13356 * The value, in satoshis, that must always be held in the channel for us. This value ensures
13357 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
13358 * this value on chain.
13360 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
13362 * This value will be `None` for outbound channels until the counterparty accepts the channel.
13364 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
13366 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
13369 * The user_id passed in to create_channel, or 0 if the channel was inbound.
13371 uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13374 * The user_id passed in to create_channel, or 0 if the channel was inbound.
13376 void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
13379 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
13380 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
13381 * available for inclusion in new outbound HTLCs). This further does not include any pending
13382 * outgoing HTLCs which are awaiting some other resolution to be sent.
13384 * This value is not exact. Due to various in-flight changes, feerate changes, and our
13385 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
13386 * should be able to spend nearly this amount.
13388 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13391 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
13392 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
13393 * available for inclusion in new outbound HTLCs). This further does not include any pending
13394 * outgoing HTLCs which are awaiting some other resolution to be sent.
13396 * This value is not exact. Due to various in-flight changes, feerate changes, and our
13397 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
13398 * should be able to spend nearly this amount.
13400 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
13403 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
13404 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
13405 * available for inclusion in new inbound HTLCs).
13406 * Note that there are some corner cases not fully handled here, so the actual available
13407 * inbound capacity may be slightly higher than this.
13409 * This value is not exact. Due to various in-flight changes, feerate changes, and our
13410 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
13411 * However, our counterparty should be able to spend nearly this amount.
13413 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13416 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
13417 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
13418 * available for inclusion in new inbound HTLCs).
13419 * Note that there are some corner cases not fully handled here, so the actual available
13420 * inbound capacity may be slightly higher than this.
13422 * This value is not exact. Due to various in-flight changes, feerate changes, and our
13423 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
13424 * However, our counterparty should be able to spend nearly this amount.
13426 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
13429 * The number of required confirmations on the funding transaction before the funding will be
13430 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
13431 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
13432 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
13433 * [`ChannelHandshakeLimits::max_minimum_depth`].
13435 * This value will be `None` for outbound channels until the counterparty accepts the channel.
13437 * [`is_outbound`]: ChannelDetails::is_outbound
13438 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
13439 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
13441 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13444 * The number of required confirmations on the funding transaction before the funding will be
13445 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
13446 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
13447 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
13448 * [`ChannelHandshakeLimits::max_minimum_depth`].
13450 * This value will be `None` for outbound channels until the counterparty accepts the channel.
13452 * [`is_outbound`]: ChannelDetails::is_outbound
13453 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
13454 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
13456 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
13459 * The number of blocks (after our commitment transaction confirms) that we will need to wait
13460 * until we can claim our funds after we force-close the channel. During this time our
13461 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
13462 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
13463 * time to claim our non-HTLC-encumbered funds.
13465 * This value will be `None` for outbound channels until the counterparty accepts the channel.
13467 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13470 * The number of blocks (after our commitment transaction confirms) that we will need to wait
13471 * until we can claim our funds after we force-close the channel. During this time our
13472 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
13473 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
13474 * time to claim our non-HTLC-encumbered funds.
13476 * This value will be `None` for outbound channels until the counterparty accepts the channel.
13478 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
13481 * True if the channel was initiated (and thus funded) by us.
13483 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13486 * True if the channel was initiated (and thus funded) by us.
13488 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
13491 * True if the channel is confirmed, funding_locked messages have been exchanged, and the
13492 * channel is not currently being shut down. `funding_locked` message exchange implies the
13493 * required confirmation count has been reached (and we were connected to the peer at some
13494 * point after the funding transaction received enough confirmations). The required
13495 * confirmation count is provided in [`confirmations_required`].
13497 * [`confirmations_required`]: ChannelDetails::confirmations_required
13499 bool ChannelDetails_get_is_funding_locked(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13502 * True if the channel is confirmed, funding_locked messages have been exchanged, and the
13503 * channel is not currently being shut down. `funding_locked` message exchange implies the
13504 * required confirmation count has been reached (and we were connected to the peer at some
13505 * point after the funding transaction received enough confirmations). The required
13506 * confirmation count is provided in [`confirmations_required`].
13508 * [`confirmations_required`]: ChannelDetails::confirmations_required
13510 void ChannelDetails_set_is_funding_locked(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
13513 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
13514 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
13516 * This is a strict superset of `is_funding_locked`.
13518 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13521 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
13522 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
13524 * This is a strict superset of `is_funding_locked`.
13526 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
13529 * True if this channel is (or will be) publicly-announced.
13531 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
13534 * True if this channel is (or will be) publicly-announced.
13536 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
13539 * Constructs a new ChannelDetails given each field
13541 MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKCOption_u64Z short_channel_id_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, uint64_t user_id_arg, uint64_t outbound_capacity_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_funding_locked_arg, bool is_usable_arg, bool is_public_arg);
13544 * Creates a copy of the ChannelDetails
13546 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
13549 * Frees any resources used by the PaymentSendFailure
13551 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
13554 * Creates a copy of the PaymentSendFailure
13556 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
13559 * Constructs a new ChannelManager to hold several channels and route between them.
13561 * This is the main \"logic hub\" for all channel-related actions, and implements
13562 * ChannelMessageHandler.
13564 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
13566 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
13568 * Users need to notify the new ChannelManager when a new block is connected or
13569 * disconnected using its `block_connected` and `block_disconnected` methods, starting
13570 * from after `params.latest_hash`.
13572 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);
13575 * Gets the current configuration applied to all new channels, as
13577 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
13580 * Creates a new outbound channel to the given remote node and with the given value.
13582 * user_id will be provided back as user_channel_id in FundingGenerationReady events to allow
13583 * tracking of which events correspond with which create_channel call. Note that the
13584 * user_channel_id defaults to 0 for inbound channels, so you may wish to avoid using 0 for
13585 * user_id here. user_id has no meaning inside of LDK, it is simply copied to events and
13586 * otherwise ignored.
13588 * If successful, will generate a SendOpenChannel message event, so you should probably poll
13589 * PeerManager::process_events afterwards.
13591 * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
13592 * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
13594 * Note that we do not check if you are currently connected to the given peer. If no
13595 * connection is available, the outbound `open_channel` message may fail to send, resulting in
13596 * the channel eventually being silently forgotten.
13598 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);
13601 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
13602 * more information.
13604 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
13607 * Gets the list of usable channels, in random order. Useful as an argument to
13608 * get_route to ensure non-announced channels are used.
13610 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
13611 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
13614 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
13617 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
13618 * will be accepted on the given channel, and after additional timeout/the closing of all
13619 * pending HTLCs, the channel will be closed on chain.
13621 * May generate a SendShutdown message event on success, which should be relayed.
13623 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
13626 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
13627 * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
13629 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
13632 * Force close all channels, immediately broadcasting the latest local commitment transaction
13633 * for each to the chain and rejecting new HTLCs on each.
13635 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
13638 * Sends a payment along a given route.
13640 * Value parameters are provided via the last hop in route, see documentation for RouteHop
13641 * fields for more info.
13643 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
13644 * payment), we don't do anything to stop you! We always try to ensure that if the provided
13645 * next hop knows the preimage to payment_hash they can claim an additional amount as
13646 * specified in the last hop in the route! Thus, you should probably do your own
13647 * payment_preimage tracking (which you should already be doing as they represent \"proof of
13648 * payment\") and prevent double-sends yourself.
13650 * May generate SendHTLCs message(s) event on success, which should be relayed.
13652 * Each path may have a different return value, and PaymentSendValue may return a Vec with
13653 * each entry matching the corresponding-index entry in the route paths, see
13654 * PaymentSendFailure for more info.
13656 * In general, a path may raise:
13657 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
13658 * node public key) is specified.
13659 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
13660 * (including due to previous monitor update failure or new permanent monitor update
13662 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
13663 * relevant updates.
13665 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
13666 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
13667 * different route unless you intend to pay twice!
13669 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
13670 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
13671 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
13672 * must not contain multiple paths as multi-path payments require a recipient-provided
13674 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
13675 * bit set (either as required or as available). If multiple paths are present in the Route,
13676 * we assume the invoice had the basic_mpp feature set.
13678 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);
13681 * Call this upon creation of a funding transaction for the given channel.
13683 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
13684 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
13686 * Panics if a funding transaction has already been provided for this channel.
13688 * May panic if the output found in the funding transaction is duplicative with some other
13689 * channel (note that this should be trivially prevented by using unique funding transaction
13690 * keys per-channel).
13692 * Do NOT broadcast the funding transaction yourself. When we have safely received our
13693 * counterparty's signature the funding transaction will automatically be broadcast via the
13694 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
13696 * Note that this includes RBF or similar transaction replacement strategies - lightning does
13697 * not currently support replacing a funding transaction on an existing channel. Instead,
13698 * create a new channel with a conflicting funding transaction.
13700 * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
13702 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);
13705 * Regenerates channel_announcements and generates a signed node_announcement from the given
13706 * arguments, providing them in corresponding events via
13707 * [`get_and_clear_pending_msg_events`], if at least one public channel has been confirmed
13708 * on-chain. This effectively re-broadcasts all channel announcements and sends our node
13709 * announcement to ensure that the lightning P2P network is aware of the channels we have and
13710 * our network addresses.
13712 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
13713 * node to humans. They carry no in-protocol meaning.
13715 * `addresses` represent the set (possibly empty) of socket addresses on which this node
13716 * accepts incoming connections. These will be included in the node_announcement, publicly
13717 * tying these addresses together and to this node. If you wish to preserve user privacy,
13718 * addresses should likely contain only Tor Onion addresses.
13720 * Panics if `addresses` is absurdly large (more than 500).
13722 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
13724 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
13727 * Processes HTLCs which are pending waiting on random forward delay.
13729 * Should only really ever be called in response to a PendingHTLCsForwardable event.
13730 * Will likely generate further events.
13732 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
13735 * If a peer is disconnected we mark any channels with that peer as 'disabled'.
13736 * After some time, if channels are still disabled we need to broadcast a ChannelUpdate
13737 * to inform the network about the uselessness of these channels.
13739 * This method handles all the details, and must be called roughly once per minute.
13741 * Note that in some rare cases this may generate a `chain::Watch::update_channel` call.
13743 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
13746 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
13747 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
13748 * along the path (including in our own channel on which we received it).
13749 * Returns false if no payment was found to fail backwards, true if the process of failing the
13750 * HTLC backwards has been started.
13752 MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
13755 * Provides a payment preimage in response to a PaymentReceived event, returning true and
13756 * generating message events for the net layer to claim the payment, if possible. Thus, you
13757 * should probably kick the net layer to go send messages if this returns true!
13759 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
13760 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
13761 * event matches your expectation. If you fail to do so and call this method, you may provide
13762 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
13764 * May panic if called except in response to a PaymentReceived event.
13766 * [`create_inbound_payment`]: Self::create_inbound_payment
13767 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
13769 MUST_USE_RES bool ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
13772 * Gets the node_id held by this ChannelManager
13774 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
13777 * Restores a single, given channel to normal operation after a
13778 * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update
13781 * All ChannelMonitor updates up to and including highest_applied_update_id must have been
13782 * fully committed in every copy of the given channels' ChannelMonitors.
13784 * Note that there is no effect to calling with a highest_applied_update_id other than the
13785 * current latest ChannelMonitorUpdate and one call to this function after multiple
13786 * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field
13787 * exists largely only to prevent races between this and concurrent update_monitor calls.
13789 * Thus, the anticipated use is, at a high level:
13790 * 1) You register a chain::Watch with this ChannelManager,
13791 * 2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of
13792 * said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures
13793 * any time it cannot do so instantly,
13794 * 3) update(s) are applied to each remote copy of a ChannelMonitor,
13795 * 4) once all remote copies are updated, you call this function with the update_id that
13796 * completed, and once it is the latest the Channel will be re-enabled.
13798 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);
13801 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
13804 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
13805 * [`PaymentHash`] and [`PaymentPreimage`] for you, returning the first and storing the second.
13807 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
13808 * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
13809 * passed directly to [`claim_funds`].
13811 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
13813 * [`claim_funds`]: Self::claim_funds
13814 * [`PaymentReceived`]: events::Event::PaymentReceived
13815 * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
13816 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
13818 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);
13821 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
13822 * stored external to LDK.
13824 * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a
13825 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
13826 * the `min_value_msat` provided here, if one is provided.
13828 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) must be globally unique. This
13829 * method may return an Err if another payment with the same payment_hash is still pending.
13831 * `user_payment_id` will be provided back in [`PaymentReceived::user_payment_id`] events to
13832 * allow tracking of which events correspond with which calls to this and
13833 * [`create_inbound_payment`]. `user_payment_id` has no meaning inside of LDK, it is simply
13834 * copied to events and otherwise ignored. It may be used to correlate PaymentReceived events
13835 * with invoice metadata stored elsewhere.
13837 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
13838 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
13839 * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the
13840 * sender \"proof-of-payment\" unless they have paid the required amount.
13842 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
13843 * in excess of the current time. This should roughly match the expiry time set in the invoice.
13844 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
13845 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
13846 * invoices when no timeout is set.
13848 * Note that we use block header time to time-out pending inbound payments (with some margin
13849 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
13850 * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry.
13851 * If you need exact expiry semantics, you should enforce them upon receipt of
13852 * [`PaymentReceived`].
13854 * Pending inbound payments are stored in memory and in serialized versions of this
13855 * [`ChannelManager`]. If potentially unbounded numbers of inbound payments may exist and
13856 * space is limited, you may wish to rate-limit inbound payment creation.
13858 * May panic if `invoice_expiry_delta_secs` is greater than one year.
13860 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
13861 * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
13863 * [`create_inbound_payment`]: Self::create_inbound_payment
13864 * [`PaymentReceived`]: events::Event::PaymentReceived
13865 * [`PaymentReceived::user_payment_id`]: events::Event::PaymentReceived::user_payment_id
13867 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);
13870 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
13871 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
13873 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
13876 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
13877 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
13879 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
13882 * Constructs a new Listen which calls the relevant methods on this_arg.
13883 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
13885 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
13888 * Constructs a new Confirm which calls the relevant methods on this_arg.
13889 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
13891 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
13894 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
13895 * indicating whether persistence is necessary. Only one listener on
13896 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
13898 * Note that the feature `allow_wallclock_use` must be enabled to use this function.
13900 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
13903 * Blocks until ChannelManager needs to be persisted. Only one listener on
13904 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
13907 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
13910 * Gets the latest best block which was connected either via the [`chain::Listen`] or
13911 * [`chain::Confirm`] interfaces.
13913 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
13916 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
13917 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
13919 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
13922 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
13924 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
13927 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
13929 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
13932 * The keys provider which will give us relevant keys. Some keys will be loaded during
13933 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
13936 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13939 * The keys provider which will give us relevant keys. Some keys will be loaded during
13940 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
13943 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
13946 * The fee_estimator for use in the ChannelManager in the future.
13948 * No calls to the FeeEstimator will be made during deserialization.
13950 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13953 * The fee_estimator for use in the ChannelManager in the future.
13955 * No calls to the FeeEstimator will be made during deserialization.
13957 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
13960 * The chain::Watch for use in the ChannelManager in the future.
13962 * No calls to the chain::Watch will be made during deserialization. It is assumed that
13963 * you have deserialized ChannelMonitors separately and will add them to your
13964 * chain::Watch after deserializing this ChannelManager.
13966 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13969 * The chain::Watch for use in the ChannelManager in the future.
13971 * No calls to the chain::Watch will be made during deserialization. It is assumed that
13972 * you have deserialized ChannelMonitors separately and will add them to your
13973 * chain::Watch after deserializing this ChannelManager.
13975 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
13978 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
13979 * used to broadcast the latest local commitment transactions of channels which must be
13980 * force-closed during deserialization.
13982 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13985 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
13986 * used to broadcast the latest local commitment transactions of channels which must be
13987 * force-closed during deserialization.
13989 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
13992 * The Logger for use in the ChannelManager and which may be used to log information during
13995 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13998 * The Logger for use in the ChannelManager and which may be used to log information during
14001 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
14004 * Default settings used for new channels. Any existing channels will continue to use the
14005 * runtime settings which were stored when the ChannelManager was serialized.
14007 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
14010 * Default settings used for new channels. Any existing channels will continue to use the
14011 * runtime settings which were stored when the ChannelManager was serialized.
14013 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
14016 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
14017 * HashMap for you. This is primarily useful for C bindings where it is not practical to
14018 * populate a HashMap directly from C.
14020 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);
14023 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
14025 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
14028 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
14030 void DecodeError_free(struct LDKDecodeError this_obj);
14033 * Creates a copy of the DecodeError
14035 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
14038 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
14040 void Init_free(struct LDKInit this_obj);
14043 * The relevant features which the sender supports
14045 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
14048 * The relevant features which the sender supports
14050 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
14053 * Constructs a new Init given each field
14055 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
14058 * Creates a copy of the Init
14060 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
14063 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
14065 void ErrorMessage_free(struct LDKErrorMessage this_obj);
14068 * The channel ID involved in the error
14070 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
14073 * The channel ID involved in the error
14075 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14078 * A possibly human-readable error description.
14079 * The string should be sanitized before it is used (e.g. emitted to logs
14080 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
14081 * vulnerability in the terminal emulator or the logging subsystem.
14083 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
14086 * A possibly human-readable error description.
14087 * The string should be sanitized before it is used (e.g. emitted to logs
14088 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
14089 * vulnerability in the terminal emulator or the logging subsystem.
14091 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
14094 * Constructs a new ErrorMessage given each field
14096 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
14099 * Creates a copy of the ErrorMessage
14101 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
14104 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
14106 void Ping_free(struct LDKPing this_obj);
14109 * The desired response length
14111 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
14114 * The desired response length
14116 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
14119 * The ping packet size.
14120 * This field is not sent on the wire. byteslen zeros are sent.
14122 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
14125 * The ping packet size.
14126 * This field is not sent on the wire. byteslen zeros are sent.
14128 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
14131 * Constructs a new Ping given each field
14133 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
14136 * Creates a copy of the Ping
14138 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
14141 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
14143 void Pong_free(struct LDKPong this_obj);
14146 * The pong packet size.
14147 * This field is not sent on the wire. byteslen zeros are sent.
14149 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
14152 * The pong packet size.
14153 * This field is not sent on the wire. byteslen zeros are sent.
14155 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
14158 * Constructs a new Pong given each field
14160 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
14163 * Creates a copy of the Pong
14165 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
14168 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
14170 void OpenChannel_free(struct LDKOpenChannel this_obj);
14173 * The genesis hash of the blockchain where the channel is to be opened
14175 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
14178 * The genesis hash of the blockchain where the channel is to be opened
14180 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14183 * A temporary channel ID, until the funding outpoint is announced
14185 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
14188 * A temporary channel ID, until the funding outpoint is announced
14190 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14193 * The channel value
14195 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14198 * The channel value
14200 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
14203 * The amount to push to the counterparty as part of the open, in milli-satoshi
14205 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14208 * The amount to push to the counterparty as part of the open, in milli-satoshi
14210 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
14213 * The threshold below which outputs on transactions broadcast by sender will be omitted
14215 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14218 * The threshold below which outputs on transactions broadcast by sender will be omitted
14220 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
14223 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
14225 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14228 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
14230 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
14233 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
14235 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14238 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
14240 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
14243 * The minimum HTLC size incoming to sender, in milli-satoshi
14245 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14248 * The minimum HTLC size incoming to sender, in milli-satoshi
14250 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
14253 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
14255 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14258 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
14260 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
14263 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
14265 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14268 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
14270 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
14273 * The maximum number of inbound HTLCs towards sender
14275 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14278 * The maximum number of inbound HTLCs towards sender
14280 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
14283 * The sender's key controlling the funding transaction
14285 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14288 * The sender's key controlling the funding transaction
14290 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14293 * Used to derive a revocation key for transactions broadcast by counterparty
14295 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14298 * Used to derive a revocation key for transactions broadcast by counterparty
14300 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14303 * A payment key to sender for transactions broadcast by counterparty
14305 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14308 * A payment key to sender for transactions broadcast by counterparty
14310 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14313 * Used to derive a payment key to sender for transactions broadcast by sender
14315 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14318 * Used to derive a payment key to sender for transactions broadcast by sender
14320 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14323 * Used to derive an HTLC payment key to sender
14325 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14328 * Used to derive an HTLC payment key to sender
14330 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14333 * The first to-be-broadcast-by-sender transaction's per commitment point
14335 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14338 * The first to-be-broadcast-by-sender transaction's per commitment point
14340 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14345 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
14350 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
14353 * Creates a copy of the OpenChannel
14355 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
14358 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
14360 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
14363 * A temporary channel ID, until the funding outpoint is announced
14365 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
14368 * A temporary channel ID, until the funding outpoint is announced
14370 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14373 * The threshold below which outputs on transactions broadcast by sender will be omitted
14375 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14378 * The threshold below which outputs on transactions broadcast by sender will be omitted
14380 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
14383 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
14385 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14388 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
14390 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
14393 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
14395 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14398 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
14400 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
14403 * The minimum HTLC size incoming to sender, in milli-satoshi
14405 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14408 * The minimum HTLC size incoming to sender, in milli-satoshi
14410 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
14413 * Minimum depth of the funding transaction before the channel is considered open
14415 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14418 * Minimum depth of the funding transaction before the channel is considered open
14420 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
14423 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
14425 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14428 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
14430 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
14433 * The maximum number of inbound HTLCs towards sender
14435 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14438 * The maximum number of inbound HTLCs towards sender
14440 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
14443 * The sender's key controlling the funding transaction
14445 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14448 * The sender's key controlling the funding transaction
14450 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14453 * Used to derive a revocation key for transactions broadcast by counterparty
14455 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14458 * Used to derive a revocation key for transactions broadcast by counterparty
14460 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14463 * A payment key to sender for transactions broadcast by counterparty
14465 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14468 * A payment key to sender for transactions broadcast by counterparty
14470 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14473 * Used to derive a payment key to sender for transactions broadcast by sender
14475 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14478 * Used to derive a payment key to sender for transactions broadcast by sender
14480 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14483 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
14485 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14488 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
14490 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14493 * The first to-be-broadcast-by-sender transaction's per commitment point
14495 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
14498 * The first to-be-broadcast-by-sender transaction's per commitment point
14500 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14503 * Creates a copy of the AcceptChannel
14505 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
14508 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
14510 void FundingCreated_free(struct LDKFundingCreated this_obj);
14513 * A temporary channel ID, until the funding is established
14515 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
14518 * A temporary channel ID, until the funding is established
14520 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14523 * The funding transaction ID
14525 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
14528 * The funding transaction ID
14530 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14533 * The specific output index funding this channel
14535 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
14538 * The specific output index funding this channel
14540 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
14543 * The signature of the channel initiator (funder) on the funding transaction
14545 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
14548 * The signature of the channel initiator (funder) on the funding transaction
14550 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
14553 * Constructs a new FundingCreated given each field
14555 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);
14558 * Creates a copy of the FundingCreated
14560 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
14563 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
14565 void FundingSigned_free(struct LDKFundingSigned this_obj);
14570 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
14575 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14578 * The signature of the channel acceptor (fundee) on the funding transaction
14580 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
14583 * The signature of the channel acceptor (fundee) on the funding transaction
14585 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
14588 * Constructs a new FundingSigned given each field
14590 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
14593 * Creates a copy of the FundingSigned
14595 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
14598 * Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
14600 void FundingLocked_free(struct LDKFundingLocked this_obj);
14605 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32];
14610 void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14613 * The per-commitment point of the second commitment transaction
14615 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
14618 * The per-commitment point of the second commitment transaction
14620 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14623 * Constructs a new FundingLocked given each field
14625 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
14628 * Creates a copy of the FundingLocked
14630 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
14633 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
14635 void Shutdown_free(struct LDKShutdown this_obj);
14640 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
14645 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14648 * The destination of this peer's funds on closing.
14649 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
14651 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
14654 * The destination of this peer's funds on closing.
14655 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
14657 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
14660 * Constructs a new Shutdown given each field
14662 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
14665 * Creates a copy of the Shutdown
14667 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
14670 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
14672 void ClosingSigned_free(struct LDKClosingSigned this_obj);
14677 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
14682 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14685 * The proposed total fee for the closing transaction
14687 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
14690 * The proposed total fee for the closing transaction
14692 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
14695 * A signature on the closing transaction
14697 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
14700 * A signature on the closing transaction
14702 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
14705 * Constructs a new ClosingSigned given each field
14707 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg);
14710 * Creates a copy of the ClosingSigned
14712 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
14715 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
14717 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
14722 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
14727 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14732 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
14737 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
14740 * The HTLC value in milli-satoshi
14742 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
14745 * The HTLC value in milli-satoshi
14747 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
14750 * The payment hash, the pre-image of which controls HTLC redemption
14752 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
14755 * The payment hash, the pre-image of which controls HTLC redemption
14757 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14760 * The expiry height of the HTLC
14762 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
14765 * The expiry height of the HTLC
14767 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
14770 * Creates a copy of the UpdateAddHTLC
14772 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
14775 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
14777 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
14782 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
14787 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14792 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
14797 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
14800 * The pre-image of the payment hash, allowing HTLC redemption
14802 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
14805 * The pre-image of the payment hash, allowing HTLC redemption
14807 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14810 * Constructs a new UpdateFulfillHTLC given each field
14812 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
14815 * Creates a copy of the UpdateFulfillHTLC
14817 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
14820 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
14822 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
14827 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
14832 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14837 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
14842 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
14845 * Creates a copy of the UpdateFailHTLC
14847 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
14850 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
14852 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
14857 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
14862 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14867 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
14872 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
14877 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
14882 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
14885 * Creates a copy of the UpdateFailMalformedHTLC
14887 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
14890 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
14892 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
14897 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
14902 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14905 * A signature on the commitment transaction
14907 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
14910 * A signature on the commitment transaction
14912 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
14915 * Signatures on the HTLC transactions
14917 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
14920 * Constructs a new CommitmentSigned given each field
14922 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
14925 * Creates a copy of the CommitmentSigned
14927 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
14930 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
14932 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
14937 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
14942 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14945 * The secret corresponding to the per-commitment point
14947 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
14950 * The secret corresponding to the per-commitment point
14952 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14955 * The next sender-broadcast commitment transaction's per-commitment point
14957 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
14960 * The next sender-broadcast commitment transaction's per-commitment point
14962 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14965 * Constructs a new RevokeAndACK given each field
14967 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);
14970 * Creates a copy of the RevokeAndACK
14972 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
14975 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
14977 void UpdateFee_free(struct LDKUpdateFee this_obj);
14982 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
14987 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14990 * Fee rate per 1000-weight of the transaction
14992 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
14995 * Fee rate per 1000-weight of the transaction
14997 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
15000 * Constructs a new UpdateFee given each field
15002 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
15005 * Creates a copy of the UpdateFee
15007 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
15010 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
15012 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
15015 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
15016 * belonging to the recipient
15018 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
15021 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
15022 * belonging to the recipient
15024 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15027 * The sender's per-commitment point for their current commitment transaction
15029 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
15032 * The sender's per-commitment point for their current commitment transaction
15034 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15037 * Constructs a new DataLossProtect given each field
15039 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
15042 * Creates a copy of the DataLossProtect
15044 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
15047 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
15049 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
15054 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
15059 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15062 * The next commitment number for the sender
15064 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
15067 * The next commitment number for the sender
15069 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
15072 * The next commitment number for the recipient
15074 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
15077 * The next commitment number for the recipient
15079 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
15082 * Creates a copy of the ChannelReestablish
15084 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
15087 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
15089 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
15094 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
15099 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15102 * The short channel ID
15104 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
15107 * The short channel ID
15109 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
15112 * A signature by the node key
15114 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
15117 * A signature by the node key
15119 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
15122 * A signature by the funding key
15124 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
15127 * A signature by the funding key
15129 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
15132 * Constructs a new AnnouncementSignatures given each field
15134 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);
15137 * Creates a copy of the AnnouncementSignatures
15139 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
15142 * Frees any resources used by the NetAddress
15144 void NetAddress_free(struct LDKNetAddress this_ptr);
15147 * Creates a copy of the NetAddress
15149 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
15152 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
15154 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
15157 * Read a Result from a byte array, created by Result_write
15159 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
15162 * Read a NetAddress from a byte array, created by NetAddress_write
15164 struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
15167 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
15169 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
15172 * The advertised features
15174 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
15177 * The advertised features
15179 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
15182 * A strictly monotonic announcement counter, with gaps allowed
15184 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
15187 * A strictly monotonic announcement counter, with gaps allowed
15189 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
15192 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
15195 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
15198 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
15201 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15204 * An RGB color for UI purposes
15206 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
15209 * An RGB color for UI purposes
15211 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
15214 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
15217 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
15220 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
15223 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15226 * List of addresses on which this node is reachable
15228 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
15231 * Creates a copy of the UnsignedNodeAnnouncement
15233 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
15236 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
15238 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
15241 * The signature by the node key
15243 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
15246 * The signature by the node key
15248 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
15251 * The actual content of the announcement
15253 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
15256 * The actual content of the announcement
15258 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
15261 * Constructs a new NodeAnnouncement given each field
15263 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
15266 * Creates a copy of the NodeAnnouncement
15268 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
15271 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
15273 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
15276 * The advertised channel features
15278 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
15281 * The advertised channel features
15283 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
15286 * The genesis hash of the blockchain where the channel is to be opened
15288 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
15291 * The genesis hash of the blockchain where the channel is to be opened
15293 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15296 * The short channel ID
15298 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
15301 * The short channel ID
15303 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
15306 * One of the two node_ids which are endpoints of this channel
15308 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
15311 * One of the two node_ids which are endpoints of this channel
15313 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15316 * The other of the two node_ids which are endpoints of this channel
15318 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
15321 * The other of the two node_ids which are endpoints of this channel
15323 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15326 * The funding key for the first node
15328 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
15331 * The funding key for the first node
15333 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15336 * The funding key for the second node
15338 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
15341 * The funding key for the second node
15343 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15346 * Creates a copy of the UnsignedChannelAnnouncement
15348 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
15351 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
15353 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
15356 * Authentication of the announcement by the first public node
15358 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
15361 * Authentication of the announcement by the first public node
15363 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
15366 * Authentication of the announcement by the second public node
15368 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
15371 * Authentication of the announcement by the second public node
15373 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
15376 * Proof of funding UTXO ownership by the first public node
15378 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
15381 * Proof of funding UTXO ownership by the first public node
15383 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
15386 * Proof of funding UTXO ownership by the second public node
15388 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
15391 * Proof of funding UTXO ownership by the second public node
15393 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
15396 * The actual announcement
15398 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
15401 * The actual announcement
15403 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
15406 * Constructs a new ChannelAnnouncement given each field
15408 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);
15411 * Creates a copy of the ChannelAnnouncement
15413 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
15416 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
15418 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
15421 * The genesis hash of the blockchain where the channel is to be opened
15423 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
15426 * The genesis hash of the blockchain where the channel is to be opened
15428 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15431 * The short channel ID
15433 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15436 * The short channel ID
15438 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
15441 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
15443 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15446 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
15448 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
15453 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15458 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
15461 * The number of blocks such that if:
15462 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
15463 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
15464 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
15465 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
15466 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
15467 * forwarding. Note that the HTLC sender is the one who originally sets this value when
15468 * constructing the route.
15470 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15473 * The number of blocks such that if:
15474 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
15475 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
15476 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
15477 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
15478 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
15479 * forwarding. Note that the HTLC sender is the one who originally sets this value when
15480 * constructing the route.
15482 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
15485 * The minimum HTLC size incoming to sender, in milli-satoshi
15487 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15490 * The minimum HTLC size incoming to sender, in milli-satoshi
15492 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
15495 * The base HTLC fee charged by sender, in milli-satoshi
15497 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15500 * The base HTLC fee charged by sender, in milli-satoshi
15502 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
15505 * The amount to fee multiplier, in micro-satoshi
15507 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
15510 * The amount to fee multiplier, in micro-satoshi
15512 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
15515 * Creates a copy of the UnsignedChannelUpdate
15517 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
15520 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
15522 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
15525 * A signature of the channel update
15527 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
15530 * A signature of the channel update
15532 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
15535 * The actual channel update
15537 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
15540 * The actual channel update
15542 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
15545 * Constructs a new ChannelUpdate given each field
15547 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
15550 * Creates a copy of the ChannelUpdate
15552 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
15555 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
15557 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
15560 * The genesis hash of the blockchain being queried
15562 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
15565 * The genesis hash of the blockchain being queried
15567 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15570 * The height of the first block for the channel UTXOs being queried
15572 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
15575 * The height of the first block for the channel UTXOs being queried
15577 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
15580 * The number of blocks to include in the query results
15582 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
15585 * The number of blocks to include in the query results
15587 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
15590 * Constructs a new QueryChannelRange given each field
15592 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
15595 * Creates a copy of the QueryChannelRange
15597 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
15600 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
15602 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
15605 * The genesis hash of the blockchain being queried
15607 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
15610 * The genesis hash of the blockchain being queried
15612 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15615 * The height of the first block in the range of the reply
15617 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
15620 * The height of the first block in the range of the reply
15622 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
15625 * The number of blocks included in the range of the reply
15627 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
15630 * The number of blocks included in the range of the reply
15632 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
15635 * True when this is the final reply for a query
15637 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
15640 * True when this is the final reply for a query
15642 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
15645 * The short_channel_ids in the channel range
15647 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
15650 * Constructs a new ReplyChannelRange given each field
15652 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);
15655 * Creates a copy of the ReplyChannelRange
15657 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
15660 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
15662 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
15665 * The genesis hash of the blockchain being queried
15667 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
15670 * The genesis hash of the blockchain being queried
15672 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15675 * The short_channel_ids that are being queried
15677 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
15680 * Constructs a new QueryShortChannelIds given each field
15682 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
15685 * Creates a copy of the QueryShortChannelIds
15687 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
15690 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
15692 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
15695 * The genesis hash of the blockchain that was queried
15697 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
15700 * The genesis hash of the blockchain that was queried
15702 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15705 * Indicates if the query recipient maintains up-to-date channel
15706 * information for the chain_hash
15708 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
15711 * Indicates if the query recipient maintains up-to-date channel
15712 * information for the chain_hash
15714 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
15717 * Constructs a new ReplyShortChannelIdsEnd given each field
15719 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
15722 * Creates a copy of the ReplyShortChannelIdsEnd
15724 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
15727 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
15729 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
15732 * The genesis hash of the blockchain for channel and node information
15734 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
15737 * The genesis hash of the blockchain for channel and node information
15739 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15742 * The starting unix timestamp
15744 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
15747 * The starting unix timestamp
15749 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
15752 * The range of information in seconds
15754 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
15757 * The range of information in seconds
15759 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
15762 * Constructs a new GossipTimestampFilter given each field
15764 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
15767 * Creates a copy of the GossipTimestampFilter
15769 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
15772 * Frees any resources used by the ErrorAction
15774 void ErrorAction_free(struct LDKErrorAction this_ptr);
15777 * Creates a copy of the ErrorAction
15779 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
15782 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
15784 void LightningError_free(struct LDKLightningError this_obj);
15787 * A human-readable message describing the error
15789 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
15792 * A human-readable message describing the error
15794 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
15797 * The action which should be taken against the offending peer.
15799 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
15802 * The action which should be taken against the offending peer.
15804 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
15807 * Constructs a new LightningError given each field
15809 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
15812 * Creates a copy of the LightningError
15814 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
15817 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
15819 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
15822 * update_add_htlc messages which should be sent
15824 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
15827 * update_fulfill_htlc messages which should be sent
15829 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
15832 * update_fail_htlc messages which should be sent
15834 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
15837 * update_fail_malformed_htlc messages which should be sent
15839 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
15842 * An update_fee message which should be sent
15844 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
15847 * An update_fee message which should be sent
15849 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
15852 * Finally, the commitment_signed message which should be sent
15854 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
15857 * Finally, the commitment_signed message which should be sent
15859 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
15862 * Constructs a new CommitmentUpdate given each field
15864 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);
15867 * Creates a copy of the CommitmentUpdate
15869 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
15872 * Frees any resources used by the HTLCFailChannelUpdate
15874 void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
15877 * Creates a copy of the HTLCFailChannelUpdate
15879 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
15882 * Calls the free function if one is set
15884 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
15887 * Calls the free function if one is set
15889 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
15892 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
15894 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
15897 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
15899 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
15902 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
15904 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
15907 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
15909 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
15912 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
15914 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
15917 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
15919 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
15922 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
15924 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
15927 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
15929 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
15932 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
15934 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
15937 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
15939 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
15942 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
15944 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
15947 * Read a FundingCreated from a byte array, created by FundingCreated_write
15949 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
15952 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
15954 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
15957 * Read a FundingSigned from a byte array, created by FundingSigned_write
15959 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
15962 * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
15964 struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
15967 * Read a FundingLocked from a byte array, created by FundingLocked_write
15969 struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
15972 * Serialize the Init object into a byte array which can be read by Init_read
15974 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
15977 * Read a Init from a byte array, created by Init_write
15979 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
15982 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
15984 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
15987 * Read a OpenChannel from a byte array, created by OpenChannel_write
15989 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
15992 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
15994 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
15997 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
15999 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
16002 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
16004 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
16007 * Read a Shutdown from a byte array, created by Shutdown_write
16009 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
16012 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
16014 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
16017 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
16019 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
16022 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
16024 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
16027 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
16029 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
16032 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
16034 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
16037 * Read a UpdateFee from a byte array, created by UpdateFee_write
16039 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
16042 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
16044 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
16047 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
16049 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
16052 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
16054 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
16057 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
16059 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
16062 * Serialize the Ping object into a byte array which can be read by Ping_read
16064 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
16067 * Read a Ping from a byte array, created by Ping_write
16069 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
16072 * Serialize the Pong object into a byte array which can be read by Pong_read
16074 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
16077 * Read a Pong from a byte array, created by Pong_write
16079 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
16082 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
16084 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
16087 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
16089 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
16092 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
16094 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
16097 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
16099 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
16102 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
16104 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
16107 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
16109 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
16112 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
16114 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
16117 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
16119 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
16122 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
16124 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
16127 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
16129 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
16132 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
16134 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
16137 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
16139 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
16142 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
16144 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
16147 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
16149 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
16152 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
16154 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
16157 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
16159 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
16162 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
16164 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
16167 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
16169 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
16172 *\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
16174 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
16177 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
16179 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
16182 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
16184 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
16187 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
16189 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
16192 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
16194 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
16197 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
16199 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
16202 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
16204 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
16207 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
16209 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
16212 * Constructs a new IgnoringMessageHandler given each field
16214 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
16217 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
16218 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
16220 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
16223 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
16224 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
16226 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
16229 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
16231 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
16234 * Constructs a new ErroringMessageHandler
16236 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
16239 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
16240 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
16242 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
16245 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
16246 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
16248 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
16251 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
16253 void MessageHandler_free(struct LDKMessageHandler this_obj);
16256 * A message handler which handles messages specific to channels. Usually this is just a
16257 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
16259 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
16261 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
16264 * A message handler which handles messages specific to channels. Usually this is just a
16265 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
16267 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
16269 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
16272 * A message handler which handles messages updating our knowledge of the network channel
16273 * graph. Usually this is just a [`NetGraphMsgHandler`] object or an
16274 * [`IgnoringMessageHandler`].
16276 * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler
16278 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
16281 * A message handler which handles messages updating our knowledge of the network channel
16282 * graph. Usually this is just a [`NetGraphMsgHandler`] object or an
16283 * [`IgnoringMessageHandler`].
16285 * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler
16287 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
16290 * Constructs a new MessageHandler given each field
16292 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
16295 * Creates a copy of a SocketDescriptor
16297 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
16300 * Calls the free function if one is set
16302 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
16305 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
16307 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
16310 * Used to indicate that we probably can't make any future connections to this peer, implying
16311 * we should go ahead and force-close any channels we have with it.
16313 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
16316 * Used to indicate that we probably can't make any future connections to this peer, implying
16317 * we should go ahead and force-close any channels we have with it.
16319 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
16322 * Constructs a new PeerHandleError given each field
16324 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
16327 * Creates a copy of the PeerHandleError
16329 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
16332 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
16334 void PeerManager_free(struct LDKPeerManager this_obj);
16337 * Constructs a new PeerManager with the given message handlers and node_id secret key
16338 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
16339 * cryptographically secure random bytes.
16341 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);
16344 * Get the list of node ids for peers which have completed the initial handshake.
16346 * For outbound connections, this will be the same as the their_node_id parameter passed in to
16347 * new_outbound_connection, however entries will only appear once the initial handshake has
16348 * completed and we are sure the remote peer has the private key for the given node_id.
16350 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
16353 * Indicates a new outbound connection has been established to a node with the given node_id.
16354 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
16355 * descriptor but must disconnect the connection immediately.
16357 * Returns a small number of bytes to send to the remote node (currently always 50).
16359 * Panics if descriptor is duplicative with some other descriptor which has not yet been
16360 * [`socket_disconnected()`].
16362 * [`socket_disconnected()`]: PeerManager::socket_disconnected
16364 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);
16367 * Indicates a new inbound connection has been established.
16369 * May refuse the connection by returning an Err, but will never write bytes to the remote end
16370 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
16371 * call socket_disconnected for the new descriptor but must disconnect the connection
16374 * Panics if descriptor is duplicative with some other descriptor which has not yet been
16375 * [`socket_disconnected()`].
16377 * [`socket_disconnected()`]: PeerManager::socket_disconnected
16379 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor);
16382 * Indicates that there is room to write data to the given socket descriptor.
16384 * May return an Err to indicate that the connection should be closed.
16386 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
16387 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
16388 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
16389 * ready to call `[write_buffer_space_avail`] again if a write call generated here isn't
16392 * [`send_data`]: SocketDescriptor::send_data
16393 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
16395 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
16398 * Indicates that data was read from the given socket descriptor.
16400 * May return an Err to indicate that the connection should be closed.
16402 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
16403 * Thus, however, you should call [`process_events`] after any `read_event` to generate
16404 * [`send_data`] calls to handle responses.
16406 * If `Ok(true)` is returned, further read_events should not be triggered until a
16407 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
16410 * [`send_data`]: SocketDescriptor::send_data
16411 * [`process_events`]: PeerManager::process_events
16413 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);
16416 * Checks for any events generated by our handlers and processes them. Includes sending most
16417 * response messages as well as messages generated by calls to handler functions directly (eg
16418 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
16420 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
16423 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
16424 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
16425 * [`send_data`]: SocketDescriptor::send_data
16427 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
16430 * Indicates that the given socket descriptor's connection is now closed.
16432 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
16435 * Disconnect a peer given its node id.
16437 * Set `no_connection_possible` to true to prevent any further connection with this peer,
16438 * force-closing any channels we have with it.
16440 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
16441 * peer. Thus, be very careful about reentrancy issues.
16443 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
16445 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
16448 * This function should be called roughly once every 30 seconds.
16449 * It will send pings to each peer and disconnect those which did not respond to the last
16452 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
16455 * [`send_data`]: SocketDescriptor::send_data
16457 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
16460 * Build the commitment secret from the seed and the commitment number
16462 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
16465 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
16466 * from the base secret and the per_commitment_point.
16468 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
16469 * generated (ie our own).
16471 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
16474 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
16475 * from the base point and the per_commitment_key. This is the public equivalent of
16476 * derive_private_key - using only public keys to derive a public key instead of private keys.
16478 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
16479 * generated (ie our own).
16481 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
16484 * Derives a per-commitment-transaction revocation key from its constituent parts.
16486 * Only the cheating participant owns a valid witness to propagate a revoked
16487 * commitment transaction, thus per_commitment_secret always come from cheater
16488 * and revocation_base_secret always come from punisher, which is the broadcaster
16489 * of the transaction spending with this key knowledge.
16491 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
16492 * generated (ie our own).
16494 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
16497 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
16498 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
16499 * public key instead of private keys.
16501 * Only the cheating participant owns a valid witness to propagate a revoked
16502 * commitment transaction, thus per_commitment_point always come from cheater
16503 * and revocation_base_point always come from punisher, which is the broadcaster
16504 * of the transaction spending with this key knowledge.
16506 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
16507 * generated (ie our own).
16509 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
16512 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
16514 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
16517 * The broadcaster's per-commitment public key which was used to derive the other keys.
16519 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
16522 * The broadcaster's per-commitment public key which was used to derive the other keys.
16524 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16527 * The revocation key which is used to allow the broadcaster of the commitment
16528 * transaction to provide their counterparty the ability to punish them if they broadcast
16531 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
16534 * The revocation key which is used to allow the broadcaster of the commitment
16535 * transaction to provide their counterparty the ability to punish them if they broadcast
16538 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16541 * Broadcaster's HTLC Key
16543 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
16546 * Broadcaster's HTLC Key
16548 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16551 * Countersignatory's HTLC Key
16553 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
16556 * Countersignatory's HTLC Key
16558 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16561 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
16563 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
16566 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
16568 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16571 * Constructs a new TxCreationKeys given each field
16573 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);
16576 * Creates a copy of the TxCreationKeys
16578 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
16581 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
16583 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
16586 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
16588 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
16591 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
16593 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
16596 * The public key which is used to sign all commitment transactions, as it appears in the
16597 * on-chain channel lock-in 2-of-2 multisig output.
16599 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
16602 * The public key which is used to sign all commitment transactions, as it appears in the
16603 * on-chain channel lock-in 2-of-2 multisig output.
16605 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16608 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
16609 * revocation keys. This is combined with the per-commitment-secret generated by the
16610 * counterparty to create a secret which the counterparty can reveal to revoke previous
16613 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
16616 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
16617 * revocation keys. This is combined with the per-commitment-secret generated by the
16618 * counterparty to create a secret which the counterparty can reveal to revoke previous
16621 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16624 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
16625 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
16626 * static across every commitment transaction.
16628 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
16631 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
16632 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
16633 * static across every commitment transaction.
16635 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16638 * The base point which is used (with derive_public_key) to derive a per-commitment payment
16639 * public key which receives non-HTLC-encumbered funds which are only available for spending
16640 * after some delay (or can be claimed via the revocation path).
16642 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
16645 * The base point which is used (with derive_public_key) to derive a per-commitment payment
16646 * public key which receives non-HTLC-encumbered funds which are only available for spending
16647 * after some delay (or can be claimed via the revocation path).
16649 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16652 * The base point which is used (with derive_public_key) to derive a per-commitment public key
16653 * which is used to encumber HTLC-in-flight outputs.
16655 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
16658 * The base point which is used (with derive_public_key) to derive a per-commitment public key
16659 * which is used to encumber HTLC-in-flight outputs.
16661 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16664 * Constructs a new ChannelPublicKeys given each field
16666 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);
16669 * Creates a copy of the ChannelPublicKeys
16671 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
16674 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
16676 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
16679 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
16681 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
16684 * Create per-state keys from channel base points and the per-commitment point.
16685 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
16687 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);
16690 * Generate per-state keys from channel static keys.
16691 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
16693 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);
16696 * A script either spendable by the revocation
16697 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
16698 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
16700 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
16703 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
16705 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
16708 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
16709 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
16710 * need to compare this value to whether the commitment transaction in question is that of
16711 * the counterparty or our own.
16713 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
16716 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
16717 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
16718 * need to compare this value to whether the commitment transaction in question is that of
16719 * the counterparty or our own.
16721 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
16724 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
16725 * this divided by 1000.
16727 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
16730 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
16731 * this divided by 1000.
16733 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
16736 * The CLTV lock-time at which this HTLC expires.
16738 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
16741 * The CLTV lock-time at which this HTLC expires.
16743 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
16746 * The hash of the preimage which unlocks this HTLC.
16748 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
16751 * The hash of the preimage which unlocks this HTLC.
16753 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16756 * The position within the commitment transactions' outputs. This may be None if the value is
16757 * below the dust limit (in which case no output appears in the commitment transaction and the
16758 * value is spent to additional transaction fees).
16760 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
16763 * The position within the commitment transactions' outputs. This may be None if the value is
16764 * below the dust limit (in which case no output appears in the commitment transaction and the
16765 * value is spent to additional transaction fees).
16767 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
16770 * Constructs a new HTLCOutputInCommitment given each field
16772 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);
16775 * Creates a copy of the HTLCOutputInCommitment
16777 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
16780 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
16782 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
16785 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
16787 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
16790 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
16791 * does not need to have its previous_output_index filled.
16793 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys);
16796 * Gets the redeemscript for a funding output from the two funding public keys.
16797 * Note that the order of funding public keys does not matter.
16799 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
16802 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
16803 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
16804 * transaction which needs signing, and can be used to construct an HTLC transaction which is
16805 * broadcastable given a counterparty HTLC signature.
16807 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
16808 * commitment transaction).
16810 struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
16813 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
16815 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
16818 * Holder public keys
16820 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
16823 * Holder public keys
16825 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
16828 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
16830 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
16833 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
16835 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
16838 * Whether the holder is the initiator of this channel.
16839 * This is an input to the commitment number obscure factor computation.
16841 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
16844 * Whether the holder is the initiator of this channel.
16845 * This is an input to the commitment number obscure factor computation.
16847 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
16850 * The late-bound counterparty channel transaction parameters.
16851 * These parameters are populated at the point in the protocol where the counterparty provides them.
16853 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
16856 * The late-bound counterparty channel transaction parameters.
16857 * These parameters are populated at the point in the protocol where the counterparty provides them.
16859 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
16862 * The late-bound funding outpoint
16864 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
16867 * The late-bound funding outpoint
16869 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
16872 * Constructs a new ChannelTransactionParameters given each field
16874 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);
16877 * Creates a copy of the ChannelTransactionParameters
16879 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
16882 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
16884 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
16887 * Counter-party public keys
16889 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
16892 * Counter-party public keys
16894 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
16897 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
16899 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
16902 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
16904 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
16907 * Constructs a new CounterpartyChannelTransactionParameters given each field
16909 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
16912 * Creates a copy of the CounterpartyChannelTransactionParameters
16914 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
16917 * Whether the late bound parameters are populated.
16919 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
16922 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
16923 * given that the holder is the broadcaster.
16925 * self.is_populated() must be true before calling this function.
16927 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
16930 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
16931 * given that the counterparty is the broadcaster.
16933 * self.is_populated() must be true before calling this function.
16935 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
16938 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
16940 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
16943 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
16945 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
16948 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
16950 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
16953 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
16955 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
16958 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
16960 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
16963 * Get the channel pubkeys for the broadcaster
16965 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16968 * Get the channel pubkeys for the countersignatory
16970 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16973 * Get the contest delay applicable to the transactions.
16974 * Note that the contest delay was selected by the countersignatory.
16976 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16979 * Whether the channel is outbound from the broadcaster.
16981 * The boolean representing the side that initiated the channel is
16982 * an input to the commitment number obscure factor computation.
16984 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16987 * The funding outpoint
16989 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16992 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
16994 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
16997 * Our counterparty's signature for the transaction
16999 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
17002 * Our counterparty's signature for the transaction
17004 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
17007 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
17009 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
17012 * Creates a copy of the HolderCommitmentTransaction
17014 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
17017 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
17019 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
17022 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
17024 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
17027 * Create a new holder transaction with the given counterparty signatures.
17028 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
17030 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);
17033 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
17035 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
17038 * The commitment transaction
17040 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
17043 * The commitment transaction
17045 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
17048 * The txid for the commitment transaction.
17050 * This is provided as a performance optimization, instead of calling transaction.txid()
17053 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
17056 * The txid for the commitment transaction.
17058 * This is provided as a performance optimization, instead of calling transaction.txid()
17061 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
17064 * Constructs a new BuiltCommitmentTransaction given each field
17066 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
17069 * Creates a copy of the BuiltCommitmentTransaction
17071 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
17074 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
17076 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
17079 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
17081 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
17084 * Get the SIGHASH_ALL sighash value of the transaction.
17086 * This can be used to verify a signature.
17088 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);
17091 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
17092 * because we are about to broadcast a holder transaction.
17094 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);
17097 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
17099 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
17102 * Creates a copy of the CommitmentTransaction
17104 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
17107 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
17109 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
17112 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
17114 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
17117 * The backwards-counting commitment number
17119 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
17122 * The value to be sent to the broadcaster
17124 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
17127 * The value to be sent to the counterparty
17129 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
17132 * The feerate paid per 1000-weight-unit in this commitment transaction.
17134 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
17137 * Trust our pre-built transaction and derived transaction creation public keys.
17139 * Applies a wrapper which allows access to these fields.
17141 * This should only be used if you fully trust the builder of this object. It should not
17142 *\tbe used by an external signer - instead use the verify function.
17144 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
17147 * Verify our pre-built transaction and derived transaction creation public keys.
17149 * Applies a wrapper which allows access to these fields.
17151 * An external validating signer must call this method before signing
17152 * or using the built transaction.
17154 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);
17157 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
17159 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
17162 * The transaction ID of the built Bitcoin transaction
17164 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
17167 * The pre-built Bitcoin commitment transaction
17169 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
17172 * The pre-calculated transaction creation public keys.
17174 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
17177 * Get a signature for each HTLC which was included in the commitment transaction (ie for
17178 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
17180 * The returned Vec has one entry for each HTLC, and in the same order.
17182 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);
17185 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
17186 * shared secret first. This prevents on-chain observers from discovering how many commitment
17187 * transactions occurred in a channel before it was closed.
17189 * This function gets the shared secret from relevant channel public keys and can be used to
17190 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
17192 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
17195 * Checks if two InitFeaturess contain equal inner contents.
17196 * This ignores pointers and is_owned flags and looks at the values in fields.
17197 * Two objects with NULL inner values will be considered "equal" here.
17199 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
17202 * Checks if two NodeFeaturess contain equal inner contents.
17203 * This ignores pointers and is_owned flags and looks at the values in fields.
17204 * Two objects with NULL inner values will be considered "equal" here.
17206 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
17209 * Checks if two ChannelFeaturess contain equal inner contents.
17210 * This ignores pointers and is_owned flags and looks at the values in fields.
17211 * Two objects with NULL inner values will be considered "equal" here.
17213 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
17216 * Checks if two InvoiceFeaturess contain equal inner contents.
17217 * This ignores pointers and is_owned flags and looks at the values in fields.
17218 * Two objects with NULL inner values will be considered "equal" here.
17220 bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
17223 * Creates a copy of the InitFeatures
17225 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
17228 * Creates a copy of the NodeFeatures
17230 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
17233 * Creates a copy of the ChannelFeatures
17235 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
17238 * Creates a copy of the InvoiceFeatures
17240 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
17243 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
17245 void InitFeatures_free(struct LDKInitFeatures this_obj);
17248 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
17250 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
17253 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
17255 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
17258 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
17260 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
17263 * Create a blank Features with no features set
17265 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
17268 * Creates a Features with the bits set which are known by the implementation
17270 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
17273 * Create a blank Features with no features set
17275 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
17278 * Creates a Features with the bits set which are known by the implementation
17280 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
17283 * Create a blank Features with no features set
17285 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
17288 * Creates a Features with the bits set which are known by the implementation
17290 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
17293 * Create a blank Features with no features set
17295 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
17298 * Creates a Features with the bits set which are known by the implementation
17300 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
17303 * Returns whether the `payment_secret` feature is supported.
17305 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
17308 * Returns whether the `payment_secret` feature is supported.
17310 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
17313 * Returns whether the `payment_secret` feature is supported.
17315 MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
17318 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
17320 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
17323 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
17325 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
17328 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
17330 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
17333 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
17335 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
17338 * Read a InitFeatures from a byte array, created by InitFeatures_write
17340 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
17343 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
17345 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
17348 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
17350 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
17353 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
17355 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
17358 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
17360 void RouteHop_free(struct LDKRouteHop this_obj);
17363 * The node_id of the node at this hop.
17365 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
17368 * The node_id of the node at this hop.
17370 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17373 * The node_announcement features of the node at this hop. For the last hop, these may be
17374 * amended to match the features present in the invoice this node generated.
17376 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
17379 * The node_announcement features of the node at this hop. For the last hop, these may be
17380 * amended to match the features present in the invoice this node generated.
17382 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
17385 * The channel that should be used from the previous hop to reach this node.
17387 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
17390 * The channel that should be used from the previous hop to reach this node.
17392 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
17395 * The channel_announcement features of the channel that should be used from the previous hop
17396 * to reach this node.
17398 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
17401 * The channel_announcement features of the channel that should be used from the previous hop
17402 * to reach this node.
17404 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
17407 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
17408 * For the last hop, this should be the full value of the payment (might be more than
17409 * requested if we had to match htlc_minimum_msat).
17411 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
17414 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
17415 * For the last hop, this should be the full value of the payment (might be more than
17416 * requested if we had to match htlc_minimum_msat).
17418 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
17421 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
17422 * expected at the destination, in excess of the current block height.
17424 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
17427 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
17428 * expected at the destination, in excess of the current block height.
17430 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
17433 * Constructs a new RouteHop given each field
17435 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);
17438 * Creates a copy of the RouteHop
17440 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
17443 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
17445 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
17448 * Read a RouteHop from a byte array, created by RouteHop_write
17450 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
17453 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
17455 void Route_free(struct LDKRoute this_obj);
17458 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
17459 * last RouteHop in each path must be the same.
17460 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
17461 * destination. Thus, this must always be at least length one. While the maximum length of any
17462 * given path is variable, keeping the length of any path to less than 20 should currently
17463 * ensure it is viable.
17465 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
17468 * Constructs a new Route given each field
17470 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
17473 * Creates a copy of the Route
17475 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
17478 * Serialize the Route object into a byte array which can be read by Route_read
17480 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
17483 * Read a Route from a byte array, created by Route_write
17485 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
17488 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
17490 void RouteHint_free(struct LDKRouteHint this_obj);
17493 * Checks if two RouteHints contain equal inner contents.
17494 * This ignores pointers and is_owned flags and looks at the values in fields.
17495 * Two objects with NULL inner values will be considered "equal" here.
17497 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
17500 * Creates a copy of the RouteHint
17502 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
17505 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
17507 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
17510 * The node_id of the non-target end of the route
17512 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
17515 * The node_id of the non-target end of the route
17517 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17520 * The short_channel_id of this channel
17522 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
17525 * The short_channel_id of this channel
17527 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
17530 * The fees which must be paid to use this channel
17532 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
17535 * The fees which must be paid to use this channel
17537 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
17540 * The difference in CLTV values between this node and the next node.
17542 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
17545 * The difference in CLTV values between this node and the next node.
17547 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
17550 * The minimum value, in msat, which must be relayed to the next hop.
17552 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
17555 * The minimum value, in msat, which must be relayed to the next hop.
17557 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
17560 * The maximum value in msat available for routing with a single HTLC.
17562 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
17565 * The maximum value in msat available for routing with a single HTLC.
17567 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
17570 * Constructs a new RouteHintHop given each field
17572 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);
17575 * Checks if two RouteHintHops contain equal inner contents.
17576 * This ignores pointers and is_owned flags and looks at the values in fields.
17577 * Two objects with NULL inner values will be considered "equal" here.
17579 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
17582 * Creates a copy of the RouteHintHop
17584 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
17587 * Gets a route from us (payer) to the given target node (payee).
17589 * If the payee provided features in their invoice, they should be provided via payee_features.
17590 * Without this, MPP will only be used if the payee's features are available in the network graph.
17592 * Private routing paths between a public node and the target may be included in `last_hops`.
17593 * Currently, only the last hop in each path is considered.
17595 * If some channels aren't announced, it may be useful to fill in a first_hops with the
17596 * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
17597 * view of our local channels (from net_graph_msg_handler) will be ignored, and only those
17598 * in first_hops will be used.
17600 * Panics if first_hops contains channels without short_channel_ids
17601 * (ChannelManager::list_usable_channels will never include such channels).
17603 * The fees on channels from us to next-hops are ignored (as they are assumed to all be
17604 * equal), however the enabled/disabled bit on such channels as well as the
17605 * htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
17607 struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKInvoiceFeatures payee_features, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
17610 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
17612 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
17615 * Creates a copy of the NetworkGraph
17617 struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
17620 * Frees any resources used by the LockedNetworkGraph, if is_owned is set and inner is non-NULL.
17622 void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj);
17625 * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
17627 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
17630 * Creates a new tracker of the actual state of the network of channels and nodes,
17631 * assuming a fresh network graph.
17632 * Chain monitor is used to make sure announced channels exist on-chain,
17633 * channel data is correct, and that the announcement is signed with
17634 * channel owners' keys.
17636 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger);
17639 * Creates a new tracker of the actual state of the network of channels and nodes,
17640 * assuming an existing Network Graph.
17642 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph);
17645 * Adds a provider used to check new announcements. Does not affect
17646 * existing announcements unless they are updated.
17647 * Add, update or remove the provider would replace the current one.
17649 void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKAccess *chain_access);
17652 * Take a read lock on the network_graph and return it in the C-bindings
17653 * newtype helper. This is likely only useful when called via the C
17654 * bindings as you can call `self.network_graph.read().unwrap()` in Rust
17657 MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
17660 * Get a reference to the NetworkGraph which this read-lock contains.
17662 MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg);
17665 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
17666 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
17668 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
17671 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
17672 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
17674 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
17677 * Frees any resources used by the DirectionalChannelInfo, if is_owned is set and inner is non-NULL.
17679 void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj);
17682 * When the last update to the channel direction was issued.
17683 * Value is opaque, as set in the announcement.
17685 uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17688 * When the last update to the channel direction was issued.
17689 * Value is opaque, as set in the announcement.
17691 void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val);
17694 * Whether the channel can be currently used for payments (in this one direction).
17696 bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17699 * Whether the channel can be currently used for payments (in this one direction).
17701 void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val);
17704 * The difference in CLTV values that you must have when routing through this channel.
17706 uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17709 * The difference in CLTV values that you must have when routing through this channel.
17711 void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val);
17714 * The minimum value, which must be relayed to the next hop via the channel
17716 uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17719 * The minimum value, which must be relayed to the next hop via the channel
17721 void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val);
17724 * The maximum value which may be relayed to the next hop via the channel.
17726 struct LDKCOption_u64Z DirectionalChannelInfo_get_htlc_maximum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17729 * The maximum value which may be relayed to the next hop via the channel.
17731 void DirectionalChannelInfo_set_htlc_maximum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
17734 * Fees charged when the channel is used for routing
17736 struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17739 * Fees charged when the channel is used for routing
17741 void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
17744 * Most recent update for the channel received from the network
17745 * Mostly redundant with the data we store in fields explicitly.
17746 * Everything else is useful only for sending out for initial routing sync.
17747 * Not stored if contains excess data to prevent DoS.
17749 struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
17752 * Most recent update for the channel received from the network
17753 * Mostly redundant with the data we store in fields explicitly.
17754 * Everything else is useful only for sending out for initial routing sync.
17755 * Not stored if contains excess data to prevent DoS.
17757 void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
17760 * Constructs a new DirectionalChannelInfo given each field
17762 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);
17765 * Creates a copy of the DirectionalChannelInfo
17767 struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
17770 * Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read
17772 struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj);
17775 * Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write
17777 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser);
17780 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
17782 void ChannelInfo_free(struct LDKChannelInfo this_obj);
17785 * Protocol features of a channel communicated during its announcement
17787 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17790 * Protocol features of a channel communicated during its announcement
17792 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
17795 * Source node of the first direction of a channel
17797 struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17800 * Source node of the first direction of a channel
17802 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17805 * Details about the first direction of a channel
17807 struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17810 * Details about the first direction of a channel
17812 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
17815 * Source node of the second direction of a channel
17817 struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17820 * Source node of the second direction of a channel
17822 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17825 * Details about the second direction of a channel
17827 struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17830 * Details about the second direction of a channel
17832 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
17835 * The channel capacity as seen on-chain, if chain lookup is available.
17837 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17840 * The channel capacity as seen on-chain, if chain lookup is available.
17842 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
17845 * An initial announcement of the channel
17846 * Mostly redundant with the data we store in fields explicitly.
17847 * Everything else is useful only for sending out for initial routing sync.
17848 * Not stored if contains excess data to prevent DoS.
17850 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
17853 * An initial announcement of the channel
17854 * Mostly redundant with the data we store in fields explicitly.
17855 * Everything else is useful only for sending out for initial routing sync.
17856 * Not stored if contains excess data to prevent DoS.
17858 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
17861 * Constructs a new ChannelInfo given each field
17863 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);
17866 * Creates a copy of the ChannelInfo
17868 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
17871 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
17873 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
17876 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
17878 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
17881 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
17883 void RoutingFees_free(struct LDKRoutingFees this_obj);
17886 * Flat routing fee in satoshis
17888 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
17891 * Flat routing fee in satoshis
17893 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
17896 * Liquidity-based routing fee in millionths of a routed amount.
17897 * In other words, 10000 is 1%.
17899 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
17902 * Liquidity-based routing fee in millionths of a routed amount.
17903 * In other words, 10000 is 1%.
17905 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
17908 * Constructs a new RoutingFees given each field
17910 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
17913 * Checks if two RoutingFeess contain equal inner contents.
17914 * This ignores pointers and is_owned flags and looks at the values in fields.
17915 * Two objects with NULL inner values will be considered "equal" here.
17917 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
17920 * Creates a copy of the RoutingFees
17922 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
17925 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
17927 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
17930 * Read a RoutingFees from a byte array, created by RoutingFees_write
17932 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
17935 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
17937 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
17940 * Protocol features the node announced support for
17942 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
17945 * Protocol features the node announced support for
17947 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
17950 * When the last known update to the node state was issued.
17951 * Value is opaque, as set in the announcement.
17953 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
17956 * When the last known update to the node state was issued.
17957 * Value is opaque, as set in the announcement.
17959 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
17962 * Color assigned to the node
17964 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
17967 * Color assigned to the node
17969 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
17972 * Moniker assigned to the node.
17973 * May be invalid or malicious (eg control chars),
17974 * should not be exposed to the user.
17976 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
17979 * Moniker assigned to the node.
17980 * May be invalid or malicious (eg control chars),
17981 * should not be exposed to the user.
17983 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
17986 * Internet-level addresses via which one can connect to the node
17988 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
17991 * An initial announcement of the node
17992 * Mostly redundant with the data we store in fields explicitly.
17993 * Everything else is useful only for sending out for initial routing sync.
17994 * Not stored if contains excess data to prevent DoS.
17996 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
17999 * An initial announcement of the node
18000 * Mostly redundant with the data we store in fields explicitly.
18001 * Everything else is useful only for sending out for initial routing sync.
18002 * Not stored if contains excess data to prevent DoS.
18004 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
18007 * Constructs a new NodeAnnouncementInfo given each field
18009 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);
18012 * Creates a copy of the NodeAnnouncementInfo
18014 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
18017 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
18019 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
18022 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
18024 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
18027 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
18029 void NodeInfo_free(struct LDKNodeInfo this_obj);
18032 * All valid channels a node has announced
18034 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
18037 * Lowest fees enabling routing via any of the enabled, known channels to a node.
18038 * The two fields (flat and proportional fee) are independent,
18039 * meaning they don't have to refer to the same channel.
18041 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
18044 * Lowest fees enabling routing via any of the enabled, known channels to a node.
18045 * The two fields (flat and proportional fee) are independent,
18046 * meaning they don't have to refer to the same channel.
18048 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
18051 * More information about a node from node_announcement.
18052 * Optional because we store a Node entry after learning about it from
18053 * a channel announcement, but before receiving a node announcement.
18055 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
18058 * More information about a node from node_announcement.
18059 * Optional because we store a Node entry after learning about it from
18060 * a channel announcement, but before receiving a node announcement.
18062 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
18065 * Constructs a new NodeInfo given each field
18067 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
18070 * Creates a copy of the NodeInfo
18072 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
18075 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
18077 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
18080 * Read a NodeInfo from a byte array, created by NodeInfo_write
18082 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
18085 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
18087 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
18090 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
18092 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
18095 * Creates a new, empty, network graph.
18097 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
18100 * For an already known node (from channel announcements), update its stored properties from a
18101 * given node announcement.
18103 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
18104 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
18105 * routing messages from a source using a protocol other than the lightning P2P protocol.
18107 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
18110 * For an already known node (from channel announcements), update its stored properties from a
18111 * given node announcement without verifying the associated signatures. Because we aren't
18112 * given the associated signatures here we cannot relay the node announcement to any of our
18115 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
18118 * Store or update channel info from a channel announcement.
18120 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
18121 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
18122 * routing messages from a source using a protocol other than the lightning P2P protocol.
18124 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
18125 * the corresponding UTXO exists on chain and is correctly-formatted.
18127 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);
18130 * Store or update channel info from a channel announcement without verifying the associated
18131 * signatures. Because we aren't given the associated signatures here we cannot relay the
18132 * channel announcement to any of our peers.
18134 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
18135 * the corresponding UTXO exists on chain and is correctly-formatted.
18137 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);
18140 * Close a channel if a corresponding HTLC fail was sent.
18141 * If permanent, removes a channel from the local storage.
18142 * May cause the removal of nodes too, if this was their last channel.
18143 * If not permanent, makes channels unavailable for routing.
18145 void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
18148 * For an already known (from announcement) channel, update info about one of the directions
18151 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
18152 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
18153 * routing messages from a source using a protocol other than the lightning P2P protocol.
18155 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
18158 * For an already known (from announcement) channel, update info about one of the directions
18159 * of the channel without verifying the associated signatures. Because we aren't given the
18160 * associated signatures here we cannot relay the channel update to any of our peers.
18162 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
18165 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
18167 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
18170 * Initialize a new FilesystemPersister and set the path to the individual channels'
18173 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
18176 * Get the directory which was provided when this persister was initialized.
18178 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
18181 * Writes the provided `ChannelManager` to the path provided at `FilesystemPersister`
18182 * initialization, within a file called \"manager\".
18184 MUST_USE_RES struct LDKCResult_NoneErrorZ FilesystemPersister_persist_manager(struct LDKStr data_dir, const struct LDKChannelManager *NONNULL_PTR manager);
18187 * Read `ChannelMonitor`s from disk.
18189 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
18192 * Constructs a new Persist which calls the relevant methods on this_arg.
18193 * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
18195 struct LDKPersist FilesystemPersister_as_Persist(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
18198 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
18200 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
18203 * Calls the free function if one is set
18205 void ChannelManagerPersister_free(struct LDKChannelManagerPersister this_ptr);
18208 * Start a background thread that takes care of responsibilities enumerated in the top-level
18211 * If `persist_manager` returns an error, then this thread will return said error (and
18212 * `start()` will need to be called again to restart the `BackgroundProcessor`). Users should
18213 * wait on [`thread_handle`]'s `join()` method to be able to tell if and when an error is
18214 * returned, or implement `persist_manager` such that an error is never returned to the
18215 * `BackgroundProcessor`
18217 * `persist_manager` is responsible for writing out the [`ChannelManager`] to disk, and/or
18218 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
18219 * [`ChannelManager`]. See [`FilesystemPersister::persist_manager`] for Rust-Lightning's
18220 * provided implementation.
18222 * [`thread_handle`]: BackgroundProcessor::thread_handle
18223 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
18224 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
18225 * [`FilesystemPersister::persist_manager`]: lightning_persister::FilesystemPersister::persist_manager
18227 MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKChannelManagerPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger);
18230 * Stop `BackgroundProcessor`'s thread.
18232 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
18235 * **Call this function on startup to ensure that all assumptions about the platform are valid.**
18237 * Unfortunately we have to make assumptions about the upper bounds of the `SystemTime` type on
18238 * your platform which we can't fully verify at compile time and which isn't part of it's contract.
18239 * To our best knowledge our assumptions hold for all platforms officially supported by rust, but
18240 * since this check is fast we recommend to do it anyway.
18242 * If this function fails this is considered a bug. Please open an issue describing your
18243 * platform and stating your current system time.
18246 * If the check fails this function panics. By calling this function on startup you ensure that
18247 * this wont happen at an arbitrary later point in time.
18249 void check_platform(void);
18252 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
18254 void Invoice_free(struct LDKInvoice this_obj);
18257 * Checks if two Invoices contain equal inner contents.
18258 * This ignores pointers and is_owned flags and looks at the values in fields.
18259 * Two objects with NULL inner values will be considered "equal" here.
18261 bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
18264 * Creates a copy of the Invoice
18266 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
18269 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
18271 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
18274 * Checks if two SignedRawInvoices contain equal inner contents.
18275 * This ignores pointers and is_owned flags and looks at the values in fields.
18276 * Two objects with NULL inner values will be considered "equal" here.
18278 bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
18281 * Creates a copy of the SignedRawInvoice
18283 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
18286 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
18288 void RawInvoice_free(struct LDKRawInvoice this_obj);
18293 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
18298 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
18301 * Checks if two RawInvoices contain equal inner contents.
18302 * This ignores pointers and is_owned flags and looks at the values in fields.
18303 * Two objects with NULL inner values will be considered "equal" here.
18305 bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
18308 * Creates a copy of the RawInvoice
18310 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
18313 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
18315 void RawDataPart_free(struct LDKRawDataPart this_obj);
18318 * generation time of the invoice
18320 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
18323 * generation time of the invoice
18325 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
18328 * Checks if two RawDataParts contain equal inner contents.
18329 * This ignores pointers and is_owned flags and looks at the values in fields.
18330 * Two objects with NULL inner values will be considered "equal" here.
18332 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
18335 * Creates a copy of the RawDataPart
18337 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
18340 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
18342 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
18345 * Checks if two PositiveTimestamps contain equal inner contents.
18346 * This ignores pointers and is_owned flags and looks at the values in fields.
18347 * Two objects with NULL inner values will be considered "equal" here.
18349 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
18352 * Creates a copy of the PositiveTimestamp
18354 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
18357 * Creates a copy of the SiPrefix
18359 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
18362 * Checks if two SiPrefixs contain equal inner contents.
18363 * This ignores pointers and is_owned flags and looks at the values in fields.
18365 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
18368 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
18369 * This is effectively 10^12 * the prefix multiplier
18371 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
18374 * Creates a copy of the Currency
18376 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
18379 * Checks if two Currencys contain equal inner contents.
18380 * This ignores pointers and is_owned flags and looks at the values in fields.
18382 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
18385 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
18387 void Sha256_free(struct LDKSha256 this_obj);
18390 * Checks if two Sha256s contain equal inner contents.
18391 * This ignores pointers and is_owned flags and looks at the values in fields.
18392 * Two objects with NULL inner values will be considered "equal" here.
18394 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
18397 * Creates a copy of the Sha256
18399 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
18402 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
18404 void Description_free(struct LDKDescription this_obj);
18407 * Checks if two Descriptions contain equal inner contents.
18408 * This ignores pointers and is_owned flags and looks at the values in fields.
18409 * Two objects with NULL inner values will be considered "equal" here.
18411 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
18414 * Creates a copy of the Description
18416 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
18419 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
18421 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
18424 * Checks if two PayeePubKeys contain equal inner contents.
18425 * This ignores pointers and is_owned flags and looks at the values in fields.
18426 * Two objects with NULL inner values will be considered "equal" here.
18428 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
18431 * Creates a copy of the PayeePubKey
18433 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
18436 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
18438 void ExpiryTime_free(struct LDKExpiryTime this_obj);
18441 * Checks if two ExpiryTimes contain equal inner contents.
18442 * This ignores pointers and is_owned flags and looks at the values in fields.
18443 * Two objects with NULL inner values will be considered "equal" here.
18445 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
18448 * Creates a copy of the ExpiryTime
18450 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
18453 * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
18455 void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
18458 * Checks if two MinFinalCltvExpirys contain equal inner contents.
18459 * This ignores pointers and is_owned flags and looks at the values in fields.
18460 * Two objects with NULL inner values will be considered "equal" here.
18462 bool MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b);
18465 * Creates a copy of the MinFinalCltvExpiry
18467 struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
18470 * Frees any resources used by the Fallback
18472 void Fallback_free(struct LDKFallback this_ptr);
18475 * Creates a copy of the Fallback
18477 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
18480 * Checks if two Fallbacks contain equal inner contents.
18481 * This ignores pointers and is_owned flags and looks at the values in fields.
18483 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
18486 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
18488 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
18491 * Checks if two InvoiceSignatures contain equal inner contents.
18492 * This ignores pointers and is_owned flags and looks at the values in fields.
18493 * Two objects with NULL inner values will be considered "equal" here.
18495 bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b);
18498 * Creates a copy of the InvoiceSignature
18500 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
18503 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
18505 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
18508 * Checks if two PrivateRoutes contain equal inner contents.
18509 * This ignores pointers and is_owned flags and looks at the values in fields.
18510 * Two objects with NULL inner values will be considered "equal" here.
18512 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
18515 * Creates a copy of the PrivateRoute
18517 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
18520 * Disassembles the `SignedRawInvoice` into its three parts:
18522 * 2. hash of the raw invoice
18525 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
18528 * The `RawInvoice` which was signed.
18530 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
18533 * The hash of the `RawInvoice` that was signed.
18535 MUST_USE_RES const uint8_t (*SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
18538 * InvoiceSignature for the invoice.
18540 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
18543 * Recovers the public key used for signing the invoice from the recoverable signature.
18545 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
18548 * Checks if the signature is valid for the included payee public key or if none exists if it's
18549 * valid for the recovered signature (which should always be true?).
18551 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
18554 * Calculate the hash of the encoded `RawInvoice`
18556 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18558 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18560 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18562 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18564 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18566 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18568 MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18570 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18572 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18574 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawInvoice_private_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18576 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18578 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
18581 * Create a new `PositiveTimestamp` from a unix timestamp in the Range
18582 * `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a
18583 * `CreationError::TimestampOutOfBounds`.
18585 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
18588 * Create a new `PositiveTimestamp` from a `SystemTime` with a corresponding unix timestamp in
18589 * the Range `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a
18590 * `CreationError::TimestampOutOfBounds`.
18592 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
18595 * Returns the UNIX timestamp representing the stored time
18597 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
18600 * Returns a reference to the internal `SystemTime` time representation
18602 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
18605 * Transform the `Invoice` into it's unchecked version
18607 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
18610 * Check that the invoice is signed correctly and that key recovery works
18612 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
18615 * Constructs an `Invoice` from a `SignedRawInvoice` by checking all its invariants.
18617 * use lightning_invoice::*;
18619 * let invoice = \"lnbc1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdp\\
18620 * \tl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq8rkx3yf5tcsyz3d7\\
18621 * \t3gafnh3cax9rn449d9p5uxz9ezhhypd0elx87sjle52x86fux2ypatgddc6k63n7erqz25le42c4u4ec\\
18622 * \tky03ylcqca784w\";
18624 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
18626 * assert!(Invoice::from_signed(signed).is_ok());
18629 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
18632 * Returns the `Invoice`'s timestamp (should equal it's creation time)
18634 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
18637 * Returns the hash to which we will receive the preimage on completion of the payment
18639 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
18642 * Get the payee's public key if one was included in the invoice
18644 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
18647 * Get the payment secret if one was included in the invoice
18649 MUST_USE_RES struct LDKThirtyTwoBytes Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg);
18652 * Get the invoice features if they were included in the invoice
18654 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
18657 * Recover the payee's public key (only to be used if none was included in the invoice)
18659 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
18662 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
18664 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
18667 * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
18668 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
18670 MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
18673 * Returns a list of all routes included in the invoice
18675 MUST_USE_RES struct LDKCVec_PrivateRouteZ Invoice_private_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
18678 * Returns a list of all routes included in the invoice as the underlying hints
18680 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_route_hints(const struct LDKInvoice *NONNULL_PTR this_arg);
18683 * Returns the currency for which the invoice was issued
18685 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
18688 * Returns the amount if specified in the invoice as pico <currency>.
18690 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_pico_btc(const struct LDKInvoice *NONNULL_PTR this_arg);
18693 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
18694 * returns `CreationError::DescriptionTooLong` otherwise
18696 * Please note that single characters may use more than one byte due to UTF8 encoding.
18698 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
18701 * Returns the underlying description `String`
18703 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
18706 * Construct an `ExpiryTime` from seconds. If there exists a `PositiveTimestamp` which would
18707 * overflow on adding the `EpiryTime` to it then this function will return a
18708 * `CreationError::ExpiryTimeOutOfBounds`.
18710 MUST_USE_RES struct LDKCResult_ExpiryTimeCreationErrorZ ExpiryTime_from_seconds(uint64_t seconds);
18713 * Construct an `ExpiryTime` from a `Duration`. If there exists a `PositiveTimestamp` which
18714 * would overflow on adding the `EpiryTime` to it then this function will return a
18715 * `CreationError::ExpiryTimeOutOfBounds`.
18717 MUST_USE_RES struct LDKCResult_ExpiryTimeCreationErrorZ ExpiryTime_from_duration(uint64_t duration);
18720 * Returns the expiry time in seconds
18722 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
18725 * Returns a reference to the underlying `Duration` (=expiry time)
18727 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
18730 * Creates a new (partial) route from a list of hops
18732 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
18735 * Returns the underlying list of hops
18737 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
18740 * Creates a copy of the CreationError
18742 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
18745 * Checks if two CreationErrors contain equal inner contents.
18746 * This ignores pointers and is_owned flags and looks at the values in fields.
18748 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
18751 * Get the string representation of a CreationError object
18753 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
18756 * Creates a copy of the SemanticError
18758 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
18761 * Checks if two SemanticErrors contain equal inner contents.
18762 * This ignores pointers and is_owned flags and looks at the values in fields.
18764 bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
18767 * Get the string representation of a SemanticError object
18769 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
18772 * Frees any resources used by the SignOrCreationError
18774 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
18777 * Creates a copy of the SignOrCreationError
18779 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
18782 * Checks if two SignOrCreationErrors contain equal inner contents.
18783 * This ignores pointers and is_owned flags and looks at the values in fields.
18785 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
18788 * Get the string representation of a SignOrCreationError object
18790 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
18793 * Utility to construct an invoice. Generally, unless you want to do something like a custom
18794 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
18795 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
18796 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
18797 * that the payment secret is valid when the invoice is paid.
18799 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);
18802 * Read a SiPrefix object from a string
18804 struct LDKCResult_SiPrefixNoneZ SiPrefix_from_str(struct LDKStr s);
18807 * Read a Invoice object from a string
18809 struct LDKCResult_InvoiceNoneZ Invoice_from_str(struct LDKStr s);
18812 * Read a SignedRawInvoice object from a string
18814 struct LDKCResult_SignedRawInvoiceNoneZ SignedRawInvoice_from_str(struct LDKStr s);
18817 * Get the string representation of a Invoice object
18819 struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o);
18822 * Get the string representation of a SignedRawInvoice object
18824 struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o);
18827 * Get the string representation of a Currency object
18829 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
18832 * Get the string representation of a SiPrefix object
18834 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
18836 #endif /* LDK_C_BINDINGS_H */
18838 #include <ldk_ver.h>