1 #ifndef LDK_C_BINDINGS_H
2 #define LDK_C_BINDINGS_H
4 /* Generated with cbindgen:0.20.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 enum which can either contain a or not
34 typedef enum LDKCOption_NoneZ {
36 * When we're in this state, this COption_NoneZ contains a
38 LDKCOption_NoneZ_Some,
40 * When we're in this state, this COption_NoneZ contains nothing
42 LDKCOption_NoneZ_None,
44 * Must be last for serialization purposes
46 LDKCOption_NoneZ_Sentinel,
50 * An error enum representing a failure to persist a channel monitor update.
52 typedef enum LDKChannelMonitorUpdateErr {
54 * Used to indicate a temporary failure (eg connection to a watchtower or remote backup of
55 * our state failed, but is expected to succeed at some point in the future).
57 * Such a failure will \"freeze\" a channel, preventing us from revoking old states or
58 * submitting new commitment transactions to the counterparty. Once the update(s) that failed
59 * have been successfully applied, a [`MonitorEvent::UpdateCompleted`] event should be returned
60 * via [`Watch::release_pending_monitor_events`] which will then restore the channel to an
63 * Note that a given ChannelManager will *never* re-generate a given ChannelMonitorUpdate. If
64 * you return a TemporaryFailure you must ensure that it is written to disk safely before
65 * writing out the latest ChannelManager state.
67 * Even when a channel has been \"frozen\" updates to the ChannelMonitor can continue to occur
68 * (eg if an inbound HTLC which we forwarded was claimed upstream resulting in us attempting
69 * to claim it on this channel) and those updates must be applied wherever they can be. At
70 * least one such updated ChannelMonitor must be persisted otherwise PermanentFailure should
71 * be returned to get things on-chain ASAP using only the in-memory copy. Obviously updates to
72 * the channel which would invalidate previous ChannelMonitors are not made when a channel has
75 * Note that even if updates made after TemporaryFailure succeed you must still provide a
76 * [`MonitorEvent::UpdateCompleted`] to ensure you have the latest monitor and re-enable
77 * normal channel operation. Note that this is normally generated through a call to
78 * [`ChainMonitor::channel_monitor_updated`].
80 * Note that the update being processed here will not be replayed for you when you return a
81 * [`MonitorEvent::UpdateCompleted`] event via [`Watch::release_pending_monitor_events`], so
82 * you must store the update itself on your own local disk prior to returning a
83 * TemporaryFailure. You may, of course, employ a journaling approach, storing only the
84 * ChannelMonitorUpdate on disk without updating the monitor itself, replaying the journal at
87 * For deployments where a copy of ChannelMonitors and other local state are backed up in a
88 * remote location (with local copies persisted immediately), it is anticipated that all
89 * updates will return TemporaryFailure until the remote copies could be updated.
91 * [`ChainMonitor::channel_monitor_updated`]: chainmonitor::ChainMonitor::channel_monitor_updated
93 LDKChannelMonitorUpdateErr_TemporaryFailure,
95 * Used to indicate no further channel monitor updates will be allowed (eg we've moved on to a
96 * different watchtower and cannot update with all watchtowers that were previously informed
99 * At reception of this error, ChannelManager will force-close the channel and return at
100 * least a final ChannelMonitorUpdate::ChannelForceClosed which must be delivered to at
101 * least one ChannelMonitor copy. Revocation secret MUST NOT be released and offchain channel
102 * update must be rejected.
104 * This failure may also signal a failure to update the local persisted copy of one of
105 * the channel monitor instance.
107 * Note that even when you fail a holder commitment transaction update, you must store the
108 * update to ensure you can claim from it in case of a duplicate copy of this ChannelMonitor
109 * broadcasts it (e.g distributed channel-monitor deployment)
111 * In case of distributed watchtowers deployment, the new version must be written to disk, as
112 * state may have been stored but rejected due to a block forcing a commitment broadcast. This
113 * storage is used to claim outputs of rejected state confirmed onchain by another watchtower,
114 * lagging behind on block processing.
116 LDKChannelMonitorUpdateErr_PermanentFailure,
118 * Must be last for serialization purposes
120 LDKChannelMonitorUpdateErr_Sentinel,
121 } LDKChannelMonitorUpdateErr;
124 * An enum that represents the speed at which we want a transaction to confirm used for feerate
127 typedef enum LDKConfirmationTarget {
129 * We are happy with this transaction confirming slowly when feerate drops some.
131 LDKConfirmationTarget_Background,
133 * We'd like this transaction to confirm without major delay, but 12-18 blocks is fine.
135 LDKConfirmationTarget_Normal,
137 * We'd like this transaction to confirm in the next few blocks.
139 LDKConfirmationTarget_HighPriority,
141 * Must be last for serialization purposes
143 LDKConfirmationTarget_Sentinel,
144 } LDKConfirmationTarget;
147 * Errors that may occur when constructing a new `RawInvoice` or `Invoice`
149 typedef enum LDKCreationError {
151 * The supplied description string was longer than 639 __bytes__ (see [`Description::new(…)`](./struct.Description.html#method.new))
153 LDKCreationError_DescriptionTooLong,
155 * The specified route has too many hops and can't be encoded
157 LDKCreationError_RouteTooLong,
159 * The Unix timestamp of the supplied date is less than zero or greater than 35-bits
161 LDKCreationError_TimestampOutOfBounds,
163 * The supplied millisatoshi amount was greater than the total bitcoin supply.
165 LDKCreationError_InvalidAmount,
167 * Route hints were required for this invoice and were missing. Applies to
168 * [phantom invoices].
170 * [phantom invoices]: crate::utils::create_phantom_invoice
172 LDKCreationError_MissingRouteHints,
174 * Must be last for serialization purposes
176 LDKCreationError_Sentinel,
180 * Enum representing the crypto currencies (or networks) supported by this library
182 typedef enum LDKCurrency {
190 LDKCurrency_BitcoinTestnet,
204 * Must be last for serialization purposes
206 LDKCurrency_Sentinel,
210 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
212 typedef enum LDKIOError {
214 LDKIOError_PermissionDenied,
215 LDKIOError_ConnectionRefused,
216 LDKIOError_ConnectionReset,
217 LDKIOError_ConnectionAborted,
218 LDKIOError_NotConnected,
219 LDKIOError_AddrInUse,
220 LDKIOError_AddrNotAvailable,
221 LDKIOError_BrokenPipe,
222 LDKIOError_AlreadyExists,
223 LDKIOError_WouldBlock,
224 LDKIOError_InvalidInput,
225 LDKIOError_InvalidData,
227 LDKIOError_WriteZero,
228 LDKIOError_Interrupted,
230 LDKIOError_UnexpectedEof,
232 * Must be last for serialization purposes
238 * An enum representing the available verbosity levels of the logger.
240 typedef enum LDKLevel {
242 * Designates extremely verbose information, including gossip-induced messages
246 * Designates very low priority, often extremely verbose, information
250 * Designates lower priority information
254 * Designates useful information
258 * Designates hazardous situations
262 * Designates very serious errors
266 * Must be last for serialization purposes
272 * An enum representing the possible Bitcoin or test networks which we can run on
274 typedef enum LDKNetwork {
276 * The main Bitcoin blockchain.
280 * The testnet3 blockchain.
284 * A local test blockchain.
288 * A blockchain on which blocks are signed instead of mined.
292 * Must be last for serialization purposes
298 * Specifies the recipient of an invoice, to indicate to [`KeysInterface::sign_invoice`] what node
299 * secret key should be used to sign the invoice.
301 typedef enum LDKRecipient {
303 * The invoice should be signed with the local node secret key.
307 * The invoice should be signed with the phantom node secret key. This secret key must be the
308 * same for all nodes participating in the [phantom node payment].
310 * [phantom node payment]: PhantomKeysManager
312 LDKRecipient_PhantomNode,
314 * Must be last for serialization purposes
316 LDKRecipient_Sentinel,
320 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
322 typedef enum LDKSecp256k1Error {
324 * Signature failed verification
326 LDKSecp256k1Error_IncorrectSignature,
328 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
330 LDKSecp256k1Error_InvalidMessage,
334 LDKSecp256k1Error_InvalidPublicKey,
338 LDKSecp256k1Error_InvalidSignature,
342 LDKSecp256k1Error_InvalidSecretKey,
346 LDKSecp256k1Error_InvalidSharedSecret,
350 LDKSecp256k1Error_InvalidRecoveryId,
352 * Invalid tweak for add_assign or mul_assign
354 LDKSecp256k1Error_InvalidTweak,
356 * Didn't pass enough memory to context creation with preallocated memory
358 LDKSecp256k1Error_NotEnoughMemory,
360 * Bad set of public keys.
362 LDKSecp256k1Error_InvalidPublicKeySum,
364 * The only valid parity values are 0 or 1.
366 LDKSecp256k1Error_InvalidParityValue,
368 * Must be last for serialization purposes
370 LDKSecp256k1Error_Sentinel,
374 * Errors that may occur when converting a `RawInvoice` to an `Invoice`. They relate to the
375 * requirements sections in BOLT #11
377 typedef enum LDKSemanticError {
379 * The invoice is missing the mandatory payment hash
381 LDKSemanticError_NoPaymentHash,
383 * The invoice has multiple payment hashes which isn't allowed
385 LDKSemanticError_MultiplePaymentHashes,
387 * No description or description hash are part of the invoice
389 LDKSemanticError_NoDescription,
391 * The invoice contains multiple descriptions and/or description hashes which isn't allowed
393 LDKSemanticError_MultipleDescriptions,
395 * The invoice is missing the mandatory payment secret, which all modern lightning nodes
398 LDKSemanticError_NoPaymentSecret,
400 * The invoice contains multiple payment secrets
402 LDKSemanticError_MultiplePaymentSecrets,
404 * The invoice's features are invalid
406 LDKSemanticError_InvalidFeatures,
408 * The recovery id doesn't fit the signature/pub key
410 LDKSemanticError_InvalidRecoveryId,
412 * The invoice's signature is invalid
414 LDKSemanticError_InvalidSignature,
416 * The invoice's amount was not a whole number of millisatoshis
418 LDKSemanticError_ImpreciseAmount,
420 * Must be last for serialization purposes
422 LDKSemanticError_Sentinel,
426 * SI prefixes for the human readable part
428 typedef enum LDKSiPrefix {
446 * Must be last for serialization purposes
448 LDKSiPrefix_Sentinel,
452 * A Rust str object, ie a reference to a UTF8-valid string.
453 * This is *not* null-terminated so cannot be used directly as a C string!
455 typedef struct LDKStr {
457 * A pointer to the string's bytes, in UTF8 encoding
459 const uint8_t *chars;
461 * The number of bytes (not characters!) pointed to by `chars`
465 * Whether the data pointed to by `chars` should be freed or not.
471 * Represents an error returned from the bech32 library during validation of some bech32 data
473 typedef enum LDKBech32Error_Tag {
475 * String does not contain the separator character
477 LDKBech32Error_MissingSeparator,
479 * The checksum does not match the rest of the data
481 LDKBech32Error_InvalidChecksum,
483 * The data or human-readable part is too long or too short
485 LDKBech32Error_InvalidLength,
487 * Some part of the string contains an invalid character
489 LDKBech32Error_InvalidChar,
491 * Some part of the data has an invalid value
493 LDKBech32Error_InvalidData,
495 * The bit conversion failed due to a padding issue
497 LDKBech32Error_InvalidPadding,
499 * The whole string must be of one case
501 LDKBech32Error_MixedCase,
503 * Must be last for serialization purposes
505 LDKBech32Error_Sentinel,
506 } LDKBech32Error_Tag;
508 typedef struct LDKBech32Error {
509 LDKBech32Error_Tag tag;
512 uint32_t invalid_char;
515 uint8_t invalid_data;
521 * A serialized transaction, in (pointer, length) form.
523 * This type optionally owns its own memory, and thus the semantics around access change based on
524 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
525 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
526 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
527 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
528 * you would be invalid.
530 * Note that, while it may change in the future, because transactions on the Rust side are stored
531 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
532 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
533 * `data_is_owned` either set or unset at your discretion.
535 typedef struct LDKTransaction {
537 * The serialized transaction data.
539 * This is non-const for your convenience, an object passed to Rust is never written to.
543 * The length of the serialized transaction
547 * Whether the data pointed to by `data` should be freed or not.
553 * A dynamically-allocated array of u8s of arbitrary size.
554 * This corresponds to std::vector in C++
556 typedef struct LDKCVec_u8Z {
558 * The elements in the array.
559 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
563 * The number of elements pointed to by `data`.
569 * A transaction output including a scriptPubKey and value.
570 * This type *does* own its own memory, so must be free'd appropriately.
572 typedef struct LDKTxOut {
574 * The script_pubkey in this output
576 struct LDKCVec_u8Z script_pubkey;
578 * The value, in satoshis, of this output
584 * The contents of CResult_NoneNoneZ
586 typedef union LDKCResult_NoneNoneZPtr {
588 * Note that this value is always NULL, as there are no contents in the OK variant
592 * Note that this value is always NULL, as there are no contents in the Err variant
595 } LDKCResult_NoneNoneZPtr;
598 * A CResult_NoneNoneZ represents the result of a fallible operation,
599 * containing a () on success and a () on failure.
600 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
602 typedef struct LDKCResult_NoneNoneZ {
604 * The contents of this CResult_NoneNoneZ, accessible via either
605 * `err` or `result` depending on the state of `result_ok`.
607 union LDKCResult_NoneNoneZPtr contents;
609 * Whether this CResult_NoneNoneZ represents a success state.
612 } LDKCResult_NoneNoneZ;
617 * Implements the per-commitment secret storage scheme from
618 * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
620 * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
623 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
625 * A pointer to the opaque Rust object.
626 * Nearly everywhere, inner must be non-null, however in places where
627 * the Rust equivalent takes an Option, it may be set to null to indicate None.
629 LDKnativeCounterpartyCommitmentSecrets *inner;
631 * Indicates that this is the only struct which contains the same pointer.
632 * Rust functions which take ownership of an object provided via an argument require
633 * this to be true and invalidate the object pointed to by inner.
636 } LDKCounterpartyCommitmentSecrets;
641 * An error in decoding a message or struct.
643 typedef struct MUST_USE_STRUCT LDKDecodeError {
645 * A pointer to the opaque Rust object.
646 * Nearly everywhere, inner must be non-null, however in places where
647 * the Rust equivalent takes an Option, it may be set to null to indicate None.
649 LDKnativeDecodeError *inner;
651 * Indicates that this is the only struct which contains the same pointer.
652 * Rust functions which take ownership of an object provided via an argument require
653 * this to be true and invalidate the object pointed to by inner.
659 * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
661 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
663 * A pointer to the contents in the success state.
664 * Reading from this pointer when `result_ok` is not set is undefined.
666 struct LDKCounterpartyCommitmentSecrets *result;
668 * A pointer to the contents in the error state.
669 * Reading from this pointer when `result_ok` is set is undefined.
671 struct LDKDecodeError *err;
672 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
675 * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
676 * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
677 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
679 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
681 * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
682 * `err` or `result` depending on the state of `result_ok`.
684 union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
686 * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
689 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
692 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
694 typedef struct LDKSecretKey {
696 * The bytes of the secret key
702 * The contents of CResult_SecretKeyErrorZ
704 typedef union LDKCResult_SecretKeyErrorZPtr {
706 * A pointer to the contents in the success state.
707 * Reading from this pointer when `result_ok` is not set is undefined.
709 struct LDKSecretKey *result;
711 * A pointer to the contents in the error state.
712 * Reading from this pointer when `result_ok` is set is undefined.
714 enum LDKSecp256k1Error *err;
715 } LDKCResult_SecretKeyErrorZPtr;
718 * A CResult_SecretKeyErrorZ represents the result of a fallible operation,
719 * containing a crate::c_types::SecretKey on success and a crate::c_types::Secp256k1Error on failure.
720 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
722 typedef struct LDKCResult_SecretKeyErrorZ {
724 * The contents of this CResult_SecretKeyErrorZ, accessible via either
725 * `err` or `result` depending on the state of `result_ok`.
727 union LDKCResult_SecretKeyErrorZPtr contents;
729 * Whether this CResult_SecretKeyErrorZ represents a success state.
732 } LDKCResult_SecretKeyErrorZ;
735 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
737 typedef struct LDKPublicKey {
739 * The bytes of the public key
741 uint8_t compressed_form[33];
745 * The contents of CResult_PublicKeyErrorZ
747 typedef union LDKCResult_PublicKeyErrorZPtr {
749 * A pointer to the contents in the success state.
750 * Reading from this pointer when `result_ok` is not set is undefined.
752 struct LDKPublicKey *result;
754 * A pointer to the contents in the error state.
755 * Reading from this pointer when `result_ok` is set is undefined.
757 enum LDKSecp256k1Error *err;
758 } LDKCResult_PublicKeyErrorZPtr;
761 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
762 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
763 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
765 typedef struct LDKCResult_PublicKeyErrorZ {
767 * The contents of this CResult_PublicKeyErrorZ, accessible via either
768 * `err` or `result` depending on the state of `result_ok`.
770 union LDKCResult_PublicKeyErrorZPtr contents;
772 * Whether this CResult_PublicKeyErrorZ represents a success state.
775 } LDKCResult_PublicKeyErrorZ;
780 * The set of public keys which are used in the creation of one commitment transaction.
781 * These are derived from the channel base keys and per-commitment data.
783 * A broadcaster key is provided from potential broadcaster of the computed transaction.
784 * A countersignatory key is coming from a protocol participant unable to broadcast the
787 * These keys are assumed to be good, either because the code derived them from
788 * channel basepoints via the new function, or they were obtained via
789 * CommitmentTransaction.trust().keys() because we trusted the source of the
790 * pre-calculated keys.
792 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
794 * A pointer to the opaque Rust object.
795 * Nearly everywhere, inner must be non-null, however in places where
796 * the Rust equivalent takes an Option, it may be set to null to indicate None.
798 LDKnativeTxCreationKeys *inner;
800 * Indicates that this is the only struct which contains the same pointer.
801 * Rust functions which take ownership of an object provided via an argument require
802 * this to be true and invalidate the object pointed to by inner.
808 * The contents of CResult_TxCreationKeysDecodeErrorZ
810 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
812 * A pointer to the contents in the success state.
813 * Reading from this pointer when `result_ok` is not set is undefined.
815 struct LDKTxCreationKeys *result;
817 * A pointer to the contents in the error state.
818 * Reading from this pointer when `result_ok` is set is undefined.
820 struct LDKDecodeError *err;
821 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
824 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
825 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
826 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
828 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
830 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
831 * `err` or `result` depending on the state of `result_ok`.
833 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
835 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
838 } LDKCResult_TxCreationKeysDecodeErrorZ;
843 * One counterparty's public keys which do not change over the life of a channel.
845 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
847 * A pointer to the opaque Rust object.
848 * Nearly everywhere, inner must be non-null, however in places where
849 * the Rust equivalent takes an Option, it may be set to null to indicate None.
851 LDKnativeChannelPublicKeys *inner;
853 * Indicates that this is the only struct which contains the same pointer.
854 * Rust functions which take ownership of an object provided via an argument require
855 * this to be true and invalidate the object pointed to by inner.
858 } LDKChannelPublicKeys;
861 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
863 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
865 * A pointer to the contents in the success state.
866 * Reading from this pointer when `result_ok` is not set is undefined.
868 struct LDKChannelPublicKeys *result;
870 * A pointer to the contents in the error state.
871 * Reading from this pointer when `result_ok` is set is undefined.
873 struct LDKDecodeError *err;
874 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
877 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
878 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
879 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
881 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
883 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
884 * `err` or `result` depending on the state of `result_ok`.
886 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
888 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
891 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
894 * The contents of CResult_TxCreationKeysErrorZ
896 typedef union LDKCResult_TxCreationKeysErrorZPtr {
898 * A pointer to the contents in the success state.
899 * Reading from this pointer when `result_ok` is not set is undefined.
901 struct LDKTxCreationKeys *result;
903 * A pointer to the contents in the error state.
904 * Reading from this pointer when `result_ok` is set is undefined.
906 enum LDKSecp256k1Error *err;
907 } LDKCResult_TxCreationKeysErrorZPtr;
910 * A CResult_TxCreationKeysErrorZ represents the result of a fallible operation,
911 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::c_types::Secp256k1Error on failure.
912 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
914 typedef struct LDKCResult_TxCreationKeysErrorZ {
916 * The contents of this CResult_TxCreationKeysErrorZ, accessible via either
917 * `err` or `result` depending on the state of `result_ok`.
919 union LDKCResult_TxCreationKeysErrorZPtr contents;
921 * Whether this CResult_TxCreationKeysErrorZ represents a success state.
924 } LDKCResult_TxCreationKeysErrorZ;
927 * An enum which can either contain a u32 or not
929 typedef enum LDKCOption_u32Z_Tag {
931 * When we're in this state, this COption_u32Z contains a u32
933 LDKCOption_u32Z_Some,
935 * When we're in this state, this COption_u32Z contains nothing
937 LDKCOption_u32Z_None,
939 * Must be last for serialization purposes
941 LDKCOption_u32Z_Sentinel,
942 } LDKCOption_u32Z_Tag;
944 typedef struct LDKCOption_u32Z {
945 LDKCOption_u32Z_Tag tag;
956 * Information about an HTLC as it appears in a commitment transaction
958 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
960 * A pointer to the opaque Rust object.
961 * Nearly everywhere, inner must be non-null, however in places where
962 * the Rust equivalent takes an Option, it may be set to null to indicate None.
964 LDKnativeHTLCOutputInCommitment *inner;
966 * Indicates that this is the only struct which contains the same pointer.
967 * Rust functions which take ownership of an object provided via an argument require
968 * this to be true and invalidate the object pointed to by inner.
971 } LDKHTLCOutputInCommitment;
974 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
976 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
978 * A pointer to the contents in the success state.
979 * Reading from this pointer when `result_ok` is not set is undefined.
981 struct LDKHTLCOutputInCommitment *result;
983 * A pointer to the contents in the error state.
984 * Reading from this pointer when `result_ok` is set is undefined.
986 struct LDKDecodeError *err;
987 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
990 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
991 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
992 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
994 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
996 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
997 * `err` or `result` depending on the state of `result_ok`.
999 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
1001 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
1004 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
1009 * Late-bound per-channel counterparty data used to build transactions.
1011 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
1013 * A pointer to the opaque Rust object.
1014 * Nearly everywhere, inner must be non-null, however in places where
1015 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1017 LDKnativeCounterpartyChannelTransactionParameters *inner;
1019 * Indicates that this is the only struct which contains the same pointer.
1020 * Rust functions which take ownership of an object provided via an argument require
1021 * this to be true and invalidate the object pointed to by inner.
1024 } LDKCounterpartyChannelTransactionParameters;
1027 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
1029 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
1031 * A pointer to the contents in the success state.
1032 * Reading from this pointer when `result_ok` is not set is undefined.
1034 struct LDKCounterpartyChannelTransactionParameters *result;
1036 * A pointer to the contents in the error state.
1037 * Reading from this pointer when `result_ok` is set is undefined.
1039 struct LDKDecodeError *err;
1040 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
1043 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
1044 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1045 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1047 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
1049 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
1050 * `err` or `result` depending on the state of `result_ok`.
1052 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
1054 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
1057 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
1062 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
1063 * The fields are organized by holder/counterparty.
1065 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
1066 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
1068 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
1070 * A pointer to the opaque Rust object.
1071 * Nearly everywhere, inner must be non-null, however in places where
1072 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1074 LDKnativeChannelTransactionParameters *inner;
1076 * Indicates that this is the only struct which contains the same pointer.
1077 * Rust functions which take ownership of an object provided via an argument require
1078 * this to be true and invalidate the object pointed to by inner.
1081 } LDKChannelTransactionParameters;
1084 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
1086 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
1088 * A pointer to the contents in the success state.
1089 * Reading from this pointer when `result_ok` is not set is undefined.
1091 struct LDKChannelTransactionParameters *result;
1093 * A pointer to the contents in the error state.
1094 * Reading from this pointer when `result_ok` is set is undefined.
1096 struct LDKDecodeError *err;
1097 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
1100 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
1101 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1102 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1104 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
1106 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
1107 * `err` or `result` depending on the state of `result_ok`.
1109 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
1111 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
1114 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
1117 * Represents a secp256k1 signature serialized as two 32-byte numbers
1119 typedef struct LDKSignature {
1121 * The bytes of the signature in "compact" form
1123 uint8_t compact_form[64];
1127 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
1128 * This corresponds to std::vector in C++
1130 typedef struct LDKCVec_SignatureZ {
1132 * The elements in the array.
1133 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1135 struct LDKSignature *data;
1137 * The number of elements pointed to by `data`.
1140 } LDKCVec_SignatureZ;
1145 * Information needed to build and sign a holder's commitment transaction.
1147 * The transaction is only signed once we are ready to broadcast.
1149 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
1151 * A pointer to the opaque Rust object.
1152 * Nearly everywhere, inner must be non-null, however in places where
1153 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1155 LDKnativeHolderCommitmentTransaction *inner;
1157 * Indicates that this is the only struct which contains the same pointer.
1158 * Rust functions which take ownership of an object provided via an argument require
1159 * this to be true and invalidate the object pointed to by inner.
1162 } LDKHolderCommitmentTransaction;
1165 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
1167 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
1169 * A pointer to the contents in the success state.
1170 * Reading from this pointer when `result_ok` is not set is undefined.
1172 struct LDKHolderCommitmentTransaction *result;
1174 * A pointer to the contents in the error state.
1175 * Reading from this pointer when `result_ok` is set is undefined.
1177 struct LDKDecodeError *err;
1178 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
1181 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1182 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1183 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1185 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
1187 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
1188 * `err` or `result` depending on the state of `result_ok`.
1190 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
1192 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
1195 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
1200 * A pre-built Bitcoin commitment transaction and its txid.
1202 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
1204 * A pointer to the opaque Rust object.
1205 * Nearly everywhere, inner must be non-null, however in places where
1206 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1208 LDKnativeBuiltCommitmentTransaction *inner;
1210 * Indicates that this is the only struct which contains the same pointer.
1211 * Rust functions which take ownership of an object provided via an argument require
1212 * this to be true and invalidate the object pointed to by inner.
1215 } LDKBuiltCommitmentTransaction;
1218 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
1220 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
1222 * A pointer to the contents in the success state.
1223 * Reading from this pointer when `result_ok` is not set is undefined.
1225 struct LDKBuiltCommitmentTransaction *result;
1227 * A pointer to the contents in the error state.
1228 * Reading from this pointer when `result_ok` is set is undefined.
1230 struct LDKDecodeError *err;
1231 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
1234 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1235 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1236 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1238 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
1240 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
1241 * `err` or `result` depending on the state of `result_ok`.
1243 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
1245 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
1248 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
1253 * A wrapper on ClosingTransaction indicating that the built bitcoin
1254 * transaction is trusted.
1256 * See trust() and verify() functions on CommitmentTransaction.
1258 * This structure implements Deref.
1260 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
1262 * A pointer to the opaque Rust object.
1263 * Nearly everywhere, inner must be non-null, however in places where
1264 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1266 LDKnativeTrustedClosingTransaction *inner;
1268 * Indicates that this is the only struct which contains the same pointer.
1269 * Rust functions which take ownership of an object provided via an argument require
1270 * this to be true and invalidate the object pointed to by inner.
1273 } LDKTrustedClosingTransaction;
1276 * The contents of CResult_TrustedClosingTransactionNoneZ
1278 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
1280 * A pointer to the contents in the success state.
1281 * Reading from this pointer when `result_ok` is not set is undefined.
1283 struct LDKTrustedClosingTransaction *result;
1285 * Note that this value is always NULL, as there are no contents in the Err variant
1288 } LDKCResult_TrustedClosingTransactionNoneZPtr;
1291 * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
1292 * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
1293 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1295 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
1297 * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
1298 * `err` or `result` depending on the state of `result_ok`.
1300 union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
1302 * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
1305 } LDKCResult_TrustedClosingTransactionNoneZ;
1310 * This class tracks the per-transaction information needed to build a commitment transaction and will
1311 * actually build it and sign. It is used for holder transactions that we sign only when needed
1312 * and for transactions we sign for the counterparty.
1314 * This class can be used inside a signer implementation to generate a signature given the relevant
1317 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
1319 * A pointer to the opaque Rust object.
1320 * Nearly everywhere, inner must be non-null, however in places where
1321 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1323 LDKnativeCommitmentTransaction *inner;
1325 * Indicates that this is the only struct which contains the same pointer.
1326 * Rust functions which take ownership of an object provided via an argument require
1327 * this to be true and invalidate the object pointed to by inner.
1330 } LDKCommitmentTransaction;
1333 * The contents of CResult_CommitmentTransactionDecodeErrorZ
1335 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
1337 * A pointer to the contents in the success state.
1338 * Reading from this pointer when `result_ok` is not set is undefined.
1340 struct LDKCommitmentTransaction *result;
1342 * A pointer to the contents in the error state.
1343 * Reading from this pointer when `result_ok` is set is undefined.
1345 struct LDKDecodeError *err;
1346 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
1349 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1350 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1351 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1353 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
1355 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
1356 * `err` or `result` depending on the state of `result_ok`.
1358 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
1360 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
1363 } LDKCResult_CommitmentTransactionDecodeErrorZ;
1368 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
1369 * transaction and the transaction creation keys) are trusted.
1371 * See trust() and verify() functions on CommitmentTransaction.
1373 * This structure implements Deref.
1375 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
1377 * A pointer to the opaque Rust object.
1378 * Nearly everywhere, inner must be non-null, however in places where
1379 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1381 LDKnativeTrustedCommitmentTransaction *inner;
1383 * Indicates that this is the only struct which contains the same pointer.
1384 * Rust functions which take ownership of an object provided via an argument require
1385 * this to be true and invalidate the object pointed to by inner.
1388 } LDKTrustedCommitmentTransaction;
1391 * The contents of CResult_TrustedCommitmentTransactionNoneZ
1393 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
1395 * A pointer to the contents in the success state.
1396 * Reading from this pointer when `result_ok` is not set is undefined.
1398 struct LDKTrustedCommitmentTransaction *result;
1400 * Note that this value is always NULL, as there are no contents in the Err variant
1403 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
1406 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
1407 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
1408 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1410 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
1412 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
1413 * `err` or `result` depending on the state of `result_ok`.
1415 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
1417 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
1420 } LDKCResult_TrustedCommitmentTransactionNoneZ;
1423 * The contents of CResult_CVec_SignatureZNoneZ
1425 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
1427 * A pointer to the contents in the success state.
1428 * Reading from this pointer when `result_ok` is not set is undefined.
1430 struct LDKCVec_SignatureZ *result;
1432 * Note that this value is always NULL, as there are no contents in the Err variant
1435 } LDKCResult_CVec_SignatureZNoneZPtr;
1438 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1439 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1440 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1442 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1444 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1445 * `err` or `result` depending on the state of `result_ok`.
1447 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1449 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1452 } LDKCResult_CVec_SignatureZNoneZ;
1457 * A script pubkey for shutting down a channel as defined by [BOLT #2].
1459 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
1461 typedef struct MUST_USE_STRUCT LDKShutdownScript {
1463 * A pointer to the opaque Rust object.
1464 * Nearly everywhere, inner must be non-null, however in places where
1465 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1467 LDKnativeShutdownScript *inner;
1469 * Indicates that this is the only struct which contains the same pointer.
1470 * Rust functions which take ownership of an object provided via an argument require
1471 * this to be true and invalidate the object pointed to by inner.
1474 } LDKShutdownScript;
1477 * The contents of CResult_ShutdownScriptDecodeErrorZ
1479 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
1481 * A pointer to the contents in the success state.
1482 * Reading from this pointer when `result_ok` is not set is undefined.
1484 struct LDKShutdownScript *result;
1486 * A pointer to the contents in the error state.
1487 * Reading from this pointer when `result_ok` is set is undefined.
1489 struct LDKDecodeError *err;
1490 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
1493 * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
1494 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
1495 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1497 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
1499 * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
1500 * `err` or `result` depending on the state of `result_ok`.
1502 union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
1504 * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
1507 } LDKCResult_ShutdownScriptDecodeErrorZ;
1512 * An error occurring when converting from [`Script`] to [`ShutdownScript`].
1514 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
1516 * A pointer to the opaque Rust object.
1517 * Nearly everywhere, inner must be non-null, however in places where
1518 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1520 LDKnativeInvalidShutdownScript *inner;
1522 * Indicates that this is the only struct which contains the same pointer.
1523 * Rust functions which take ownership of an object provided via an argument require
1524 * this to be true and invalidate the object pointed to by inner.
1527 } LDKInvalidShutdownScript;
1530 * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
1532 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
1534 * A pointer to the contents in the success state.
1535 * Reading from this pointer when `result_ok` is not set is undefined.
1537 struct LDKShutdownScript *result;
1539 * A pointer to the contents in the error state.
1540 * Reading from this pointer when `result_ok` is set is undefined.
1542 struct LDKInvalidShutdownScript *err;
1543 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
1546 * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
1547 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
1548 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1550 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
1552 * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
1553 * `err` or `result` depending on the state of `result_ok`.
1555 union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
1557 * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
1560 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
1563 * The contents of CResult_NoneErrorZ
1565 typedef union LDKCResult_NoneErrorZPtr {
1567 * Note that this value is always NULL, as there are no contents in the OK variant
1571 * A pointer to the contents in the error state.
1572 * Reading from this pointer when `result_ok` is set is undefined.
1574 enum LDKIOError *err;
1575 } LDKCResult_NoneErrorZPtr;
1578 * A CResult_NoneErrorZ represents the result of a fallible operation,
1579 * containing a () on success and a crate::c_types::IOError on failure.
1580 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1582 typedef struct LDKCResult_NoneErrorZ {
1584 * The contents of this CResult_NoneErrorZ, accessible via either
1585 * `err` or `result` depending on the state of `result_ok`.
1587 union LDKCResult_NoneErrorZPtr contents;
1589 * Whether this CResult_NoneErrorZ represents a success state.
1592 } LDKCResult_NoneErrorZ;
1599 typedef struct MUST_USE_STRUCT LDKRouteHop {
1601 * A pointer to the opaque Rust object.
1602 * Nearly everywhere, inner must be non-null, however in places where
1603 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1605 LDKnativeRouteHop *inner;
1607 * Indicates that this is the only struct which contains the same pointer.
1608 * Rust functions which take ownership of an object provided via an argument require
1609 * this to be true and invalidate the object pointed to by inner.
1615 * The contents of CResult_RouteHopDecodeErrorZ
1617 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
1619 * A pointer to the contents in the success state.
1620 * Reading from this pointer when `result_ok` is not set is undefined.
1622 struct LDKRouteHop *result;
1624 * A pointer to the contents in the error state.
1625 * Reading from this pointer when `result_ok` is set is undefined.
1627 struct LDKDecodeError *err;
1628 } LDKCResult_RouteHopDecodeErrorZPtr;
1631 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
1632 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
1633 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1635 typedef struct LDKCResult_RouteHopDecodeErrorZ {
1637 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
1638 * `err` or `result` depending on the state of `result_ok`.
1640 union LDKCResult_RouteHopDecodeErrorZPtr contents;
1642 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
1645 } LDKCResult_RouteHopDecodeErrorZ;
1648 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
1649 * This corresponds to std::vector in C++
1651 typedef struct LDKCVec_RouteHopZ {
1653 * The elements in the array.
1654 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1656 struct LDKRouteHop *data;
1658 * The number of elements pointed to by `data`.
1661 } LDKCVec_RouteHopZ;
1664 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
1665 * This corresponds to std::vector in C++
1667 typedef struct LDKCVec_CVec_RouteHopZZ {
1669 * The elements in the array.
1670 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1672 struct LDKCVec_RouteHopZ *data;
1674 * The number of elements pointed to by `data`.
1677 } LDKCVec_CVec_RouteHopZZ;
1682 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
1683 * it can take multiple paths. Each path is composed of one or more hops through the network.
1685 typedef struct MUST_USE_STRUCT LDKRoute {
1687 * A pointer to the opaque Rust object.
1688 * Nearly everywhere, inner must be non-null, however in places where
1689 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1691 LDKnativeRoute *inner;
1693 * Indicates that this is the only struct which contains the same pointer.
1694 * Rust functions which take ownership of an object provided via an argument require
1695 * this to be true and invalidate the object pointed to by inner.
1701 * The contents of CResult_RouteDecodeErrorZ
1703 typedef union LDKCResult_RouteDecodeErrorZPtr {
1705 * A pointer to the contents in the success state.
1706 * Reading from this pointer when `result_ok` is not set is undefined.
1708 struct LDKRoute *result;
1710 * A pointer to the contents in the error state.
1711 * Reading from this pointer when `result_ok` is set is undefined.
1713 struct LDKDecodeError *err;
1714 } LDKCResult_RouteDecodeErrorZPtr;
1717 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
1718 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
1719 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1721 typedef struct LDKCResult_RouteDecodeErrorZ {
1723 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
1724 * `err` or `result` depending on the state of `result_ok`.
1726 union LDKCResult_RouteDecodeErrorZPtr contents;
1728 * Whether this CResult_RouteDecodeErrorZ represents a success state.
1731 } LDKCResult_RouteDecodeErrorZ;
1736 * Parameters needed to find a [`Route`].
1738 * Passed to [`find_route`] and [`build_route_from_hops`], but also provided in
1739 * [`Event::PaymentPathFailed`] for retrying a failed payment path.
1741 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
1743 typedef struct MUST_USE_STRUCT LDKRouteParameters {
1745 * A pointer to the opaque Rust object.
1746 * Nearly everywhere, inner must be non-null, however in places where
1747 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1749 LDKnativeRouteParameters *inner;
1751 * Indicates that this is the only struct which contains the same pointer.
1752 * Rust functions which take ownership of an object provided via an argument require
1753 * this to be true and invalidate the object pointed to by inner.
1756 } LDKRouteParameters;
1759 * The contents of CResult_RouteParametersDecodeErrorZ
1761 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
1763 * A pointer to the contents in the success state.
1764 * Reading from this pointer when `result_ok` is not set is undefined.
1766 struct LDKRouteParameters *result;
1768 * A pointer to the contents in the error state.
1769 * Reading from this pointer when `result_ok` is set is undefined.
1771 struct LDKDecodeError *err;
1772 } LDKCResult_RouteParametersDecodeErrorZPtr;
1775 * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
1776 * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1777 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1779 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
1781 * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
1782 * `err` or `result` depending on the state of `result_ok`.
1784 union LDKCResult_RouteParametersDecodeErrorZPtr contents;
1786 * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
1789 } LDKCResult_RouteParametersDecodeErrorZ;
1794 * A list of hops along a payment path terminating with a channel to the recipient.
1796 typedef struct MUST_USE_STRUCT LDKRouteHint {
1798 * A pointer to the opaque Rust object.
1799 * Nearly everywhere, inner must be non-null, however in places where
1800 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1802 LDKnativeRouteHint *inner;
1804 * Indicates that this is the only struct which contains the same pointer.
1805 * Rust functions which take ownership of an object provided via an argument require
1806 * this to be true and invalidate the object pointed to by inner.
1812 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
1813 * This corresponds to std::vector in C++
1815 typedef struct LDKCVec_RouteHintZ {
1817 * The elements in the array.
1818 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1820 struct LDKRouteHint *data;
1822 * The number of elements pointed to by `data`.
1825 } LDKCVec_RouteHintZ;
1828 * An enum which can either contain a u64 or not
1830 typedef enum LDKCOption_u64Z_Tag {
1832 * When we're in this state, this COption_u64Z contains a u64
1834 LDKCOption_u64Z_Some,
1836 * When we're in this state, this COption_u64Z contains nothing
1838 LDKCOption_u64Z_None,
1840 * Must be last for serialization purposes
1842 LDKCOption_u64Z_Sentinel,
1843 } LDKCOption_u64Z_Tag;
1845 typedef struct LDKCOption_u64Z {
1846 LDKCOption_u64Z_Tag tag;
1857 * The recipient of a payment.
1859 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
1861 * A pointer to the opaque Rust object.
1862 * Nearly everywhere, inner must be non-null, however in places where
1863 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1865 LDKnativePaymentParameters *inner;
1867 * Indicates that this is the only struct which contains the same pointer.
1868 * Rust functions which take ownership of an object provided via an argument require
1869 * this to be true and invalidate the object pointed to by inner.
1872 } LDKPaymentParameters;
1875 * The contents of CResult_PaymentParametersDecodeErrorZ
1877 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
1879 * A pointer to the contents in the success state.
1880 * Reading from this pointer when `result_ok` is not set is undefined.
1882 struct LDKPaymentParameters *result;
1884 * A pointer to the contents in the error state.
1885 * Reading from this pointer when `result_ok` is set is undefined.
1887 struct LDKDecodeError *err;
1888 } LDKCResult_PaymentParametersDecodeErrorZPtr;
1891 * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
1892 * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1893 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1895 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
1897 * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
1898 * `err` or `result` depending on the state of `result_ok`.
1900 union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
1902 * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
1905 } LDKCResult_PaymentParametersDecodeErrorZ;
1910 * A channel descriptor for a hop along a payment path.
1912 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
1914 * A pointer to the opaque Rust object.
1915 * Nearly everywhere, inner must be non-null, however in places where
1916 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1918 LDKnativeRouteHintHop *inner;
1920 * Indicates that this is the only struct which contains the same pointer.
1921 * Rust functions which take ownership of an object provided via an argument require
1922 * this to be true and invalidate the object pointed to by inner.
1928 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
1929 * This corresponds to std::vector in C++
1931 typedef struct LDKCVec_RouteHintHopZ {
1933 * The elements in the array.
1934 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1936 struct LDKRouteHintHop *data;
1938 * The number of elements pointed to by `data`.
1941 } LDKCVec_RouteHintHopZ;
1944 * The contents of CResult_RouteHintDecodeErrorZ
1946 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
1948 * A pointer to the contents in the success state.
1949 * Reading from this pointer when `result_ok` is not set is undefined.
1951 struct LDKRouteHint *result;
1953 * A pointer to the contents in the error state.
1954 * Reading from this pointer when `result_ok` is set is undefined.
1956 struct LDKDecodeError *err;
1957 } LDKCResult_RouteHintDecodeErrorZPtr;
1960 * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
1961 * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
1962 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1964 typedef struct LDKCResult_RouteHintDecodeErrorZ {
1966 * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
1967 * `err` or `result` depending on the state of `result_ok`.
1969 union LDKCResult_RouteHintDecodeErrorZPtr contents;
1971 * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
1974 } LDKCResult_RouteHintDecodeErrorZ;
1977 * The contents of CResult_RouteHintHopDecodeErrorZ
1979 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
1981 * A pointer to the contents in the success state.
1982 * Reading from this pointer when `result_ok` is not set is undefined.
1984 struct LDKRouteHintHop *result;
1986 * A pointer to the contents in the error state.
1987 * Reading from this pointer when `result_ok` is set is undefined.
1989 struct LDKDecodeError *err;
1990 } LDKCResult_RouteHintHopDecodeErrorZPtr;
1993 * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
1994 * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
1995 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1997 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
1999 * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
2000 * `err` or `result` depending on the state of `result_ok`.
2002 union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
2004 * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
2007 } LDKCResult_RouteHintHopDecodeErrorZ;
2012 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
2014 typedef struct MUST_USE_STRUCT LDKChannelDetails {
2016 * A pointer to the opaque Rust object.
2017 * Nearly everywhere, inner must be non-null, however in places where
2018 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2020 LDKnativeChannelDetails *inner;
2022 * Indicates that this is the only struct which contains the same pointer.
2023 * Rust functions which take ownership of an object provided via an argument require
2024 * this to be true and invalidate the object pointed to by inner.
2027 } LDKChannelDetails;
2030 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
2031 * This corresponds to std::vector in C++
2033 typedef struct LDKCVec_ChannelDetailsZ {
2035 * The elements in the array.
2036 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2038 struct LDKChannelDetails *data;
2040 * The number of elements pointed to by `data`.
2043 } LDKCVec_ChannelDetailsZ;
2048 * An Err type for failure to process messages.
2050 typedef struct MUST_USE_STRUCT LDKLightningError {
2052 * A pointer to the opaque Rust object.
2053 * Nearly everywhere, inner must be non-null, however in places where
2054 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2056 LDKnativeLightningError *inner;
2058 * Indicates that this is the only struct which contains the same pointer.
2059 * Rust functions which take ownership of an object provided via an argument require
2060 * this to be true and invalidate the object pointed to by inner.
2063 } LDKLightningError;
2066 * The contents of CResult_RouteLightningErrorZ
2068 typedef union LDKCResult_RouteLightningErrorZPtr {
2070 * A pointer to the contents in the success state.
2071 * Reading from this pointer when `result_ok` is not set is undefined.
2073 struct LDKRoute *result;
2075 * A pointer to the contents in the error state.
2076 * Reading from this pointer when `result_ok` is set is undefined.
2078 struct LDKLightningError *err;
2079 } LDKCResult_RouteLightningErrorZPtr;
2082 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
2083 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
2084 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2086 typedef struct LDKCResult_RouteLightningErrorZ {
2088 * The contents of this CResult_RouteLightningErrorZ, accessible via either
2089 * `err` or `result` depending on the state of `result_ok`.
2091 union LDKCResult_RouteLightningErrorZPtr contents;
2093 * Whether this CResult_RouteLightningErrorZ represents a success state.
2096 } LDKCResult_RouteLightningErrorZ;
2099 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
2100 * This corresponds to std::vector in C++
2102 typedef struct LDKCVec_PublicKeyZ {
2104 * The elements in the array.
2105 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2107 struct LDKPublicKey *data;
2109 * The number of elements pointed to by `data`.
2112 } LDKCVec_PublicKeyZ;
2115 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
2116 * look up the corresponding function in rust-lightning's docs.
2118 typedef struct LDKThirtyTwoBytes {
2120 * The thirty-two bytes
2123 } LDKThirtyTwoBytes;
2126 * Some information provided on receipt of payment depends on whether the payment received is a
2127 * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
2129 typedef enum LDKPaymentPurpose_Tag {
2131 * Information for receiving a payment that we generated an invoice for.
2133 LDKPaymentPurpose_InvoicePayment,
2135 * Because this is a spontaneous payment, the payer generated their own preimage rather than us
2136 * (the payee) providing a preimage.
2138 LDKPaymentPurpose_SpontaneousPayment,
2140 * Must be last for serialization purposes
2142 LDKPaymentPurpose_Sentinel,
2143 } LDKPaymentPurpose_Tag;
2145 typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
2147 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
2148 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
2149 * [`ChannelManager::claim_funds`].
2151 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2152 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2154 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2156 struct LDKThirtyTwoBytes payment_preimage;
2158 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
2159 * number of deanonymization attacks during the routing process.
2160 * It is provided here for your reference, however its accuracy is enforced directly by
2161 * [`ChannelManager`] using the values you previously provided to
2162 * [`ChannelManager::create_inbound_payment`] or
2163 * [`ChannelManager::create_inbound_payment_for_hash`].
2165 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2166 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2167 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
2169 struct LDKThirtyTwoBytes payment_secret;
2170 } LDKPaymentPurpose_LDKInvoicePayment_Body;
2172 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
2173 LDKPaymentPurpose_Tag tag;
2175 LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
2177 struct LDKThirtyTwoBytes spontaneous_payment;
2180 } LDKPaymentPurpose;
2183 * The contents of CResult_PaymentPurposeDecodeErrorZ
2185 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
2187 * A pointer to the contents in the success state.
2188 * Reading from this pointer when `result_ok` is not set is undefined.
2190 struct LDKPaymentPurpose *result;
2192 * A pointer to the contents in the error state.
2193 * Reading from this pointer when `result_ok` is set is undefined.
2195 struct LDKDecodeError *err;
2196 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
2199 * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
2200 * containing a crate::lightning::util::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
2201 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2203 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
2205 * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
2206 * `err` or `result` depending on the state of `result_ok`.
2208 union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
2210 * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
2213 } LDKCResult_PaymentPurposeDecodeErrorZ;
2216 * The reason the channel was closed. See individual variants more details.
2218 typedef enum LDKClosureReason_Tag {
2220 * Closure generated from receiving a peer error message.
2222 * Our counterparty may have broadcasted their latest commitment state, and we have
2225 LDKClosureReason_CounterpartyForceClosed,
2227 * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
2229 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
2231 LDKClosureReason_HolderForceClosed,
2233 * The channel was closed after negotiating a cooperative close and we've now broadcasted
2234 * the cooperative close transaction. Note the shutdown may have been initiated by us.
2236 LDKClosureReason_CooperativeClosure,
2238 * A commitment transaction was confirmed on chain, closing the channel. Most likely this
2239 * commitment transaction came from our counterparty, but it may also have come from
2240 * a copy of our own `ChannelMonitor`.
2242 LDKClosureReason_CommitmentTxConfirmed,
2244 * The funding transaction failed to confirm in a timely manner on an inbound channel.
2246 LDKClosureReason_FundingTimedOut,
2248 * Closure generated from processing an event, likely a HTLC forward/relay/reception.
2250 LDKClosureReason_ProcessingError,
2252 * The peer disconnected prior to funding completing. In this case the spec mandates that we
2253 * forget the channel entirely - we can attempt again if the peer reconnects.
2255 * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
2256 * peer because of mutual incompatibility between us and our channel counterparty.
2258 LDKClosureReason_DisconnectedPeer,
2260 * Closure generated from `ChannelManager::read` if the ChannelMonitor is newer than
2261 * the ChannelManager deserialized.
2263 LDKClosureReason_OutdatedChannelManager,
2265 * Must be last for serialization purposes
2267 LDKClosureReason_Sentinel,
2268 } LDKClosureReason_Tag;
2270 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
2272 * The error which the peer sent us.
2274 * The string should be sanitized before it is used (e.g emitted to logs
2275 * or printed to stdout). Otherwise, a well crafted error message may exploit
2276 * a security vulnerability in the terminal emulator or the logging subsystem.
2278 struct LDKStr peer_msg;
2279 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
2281 typedef struct LDKClosureReason_LDKProcessingError_Body {
2283 * A developer-readable error message which we generated.
2286 } LDKClosureReason_LDKProcessingError_Body;
2288 typedef struct MUST_USE_STRUCT LDKClosureReason {
2289 LDKClosureReason_Tag tag;
2291 LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
2292 LDKClosureReason_LDKProcessingError_Body processing_error;
2297 * An enum which can either contain a crate::lightning::util::events::ClosureReason or not
2299 typedef enum LDKCOption_ClosureReasonZ_Tag {
2301 * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::util::events::ClosureReason
2303 LDKCOption_ClosureReasonZ_Some,
2305 * When we're in this state, this COption_ClosureReasonZ contains nothing
2307 LDKCOption_ClosureReasonZ_None,
2309 * Must be last for serialization purposes
2311 LDKCOption_ClosureReasonZ_Sentinel,
2312 } LDKCOption_ClosureReasonZ_Tag;
2314 typedef struct LDKCOption_ClosureReasonZ {
2315 LDKCOption_ClosureReasonZ_Tag tag;
2318 struct LDKClosureReason some;
2321 } LDKCOption_ClosureReasonZ;
2324 * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
2326 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
2328 * A pointer to the contents in the success state.
2329 * Reading from this pointer when `result_ok` is not set is undefined.
2331 struct LDKCOption_ClosureReasonZ *result;
2333 * A pointer to the contents in the error state.
2334 * Reading from this pointer when `result_ok` is set is undefined.
2336 struct LDKDecodeError *err;
2337 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
2340 * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
2341 * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
2342 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2344 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
2346 * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
2347 * `err` or `result` depending on the state of `result_ok`.
2349 union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
2351 * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
2354 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
2359 * A channel_update message to be sent or received from a peer
2361 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
2363 * A pointer to the opaque Rust object.
2364 * Nearly everywhere, inner must be non-null, however in places where
2365 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2367 LDKnativeChannelUpdate *inner;
2369 * Indicates that this is the only struct which contains the same pointer.
2370 * Rust functions which take ownership of an object provided via an argument require
2371 * this to be true and invalidate the object pointed to by inner.
2377 * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
2378 * return packet by a node along the route. See [BOLT #4] for details.
2380 * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
2382 typedef enum LDKNetworkUpdate_Tag {
2384 * An error indicating a `channel_update` messages should be applied via
2385 * [`NetworkGraph::update_channel`].
2387 LDKNetworkUpdate_ChannelUpdateMessage,
2389 * An error indicating that a channel failed to route a payment, which should be applied via
2390 * [`NetworkGraph::channel_failed`].
2392 LDKNetworkUpdate_ChannelFailure,
2394 * An error indicating that a node failed to route a payment, which should be applied via
2395 * [`NetworkGraph::node_failed`].
2397 LDKNetworkUpdate_NodeFailure,
2399 * Must be last for serialization purposes
2401 LDKNetworkUpdate_Sentinel,
2402 } LDKNetworkUpdate_Tag;
2404 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
2406 * The update to apply via [`NetworkGraph::update_channel`].
2408 struct LDKChannelUpdate msg;
2409 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
2411 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
2413 * The short channel id of the closed channel.
2415 uint64_t short_channel_id;
2417 * Whether the channel should be permanently removed or temporarily disabled until a new
2418 * `channel_update` message is received.
2421 } LDKNetworkUpdate_LDKChannelFailure_Body;
2423 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
2425 * The node id of the failed node.
2427 struct LDKPublicKey node_id;
2429 * Whether the node should be permanently removed from consideration or can be restored
2430 * when a new `channel_update` message is received.
2433 } LDKNetworkUpdate_LDKNodeFailure_Body;
2435 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
2436 LDKNetworkUpdate_Tag tag;
2438 LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
2439 LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
2440 LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
2445 * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
2447 typedef enum LDKCOption_NetworkUpdateZ_Tag {
2449 * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
2451 LDKCOption_NetworkUpdateZ_Some,
2453 * When we're in this state, this COption_NetworkUpdateZ contains nothing
2455 LDKCOption_NetworkUpdateZ_None,
2457 * Must be last for serialization purposes
2459 LDKCOption_NetworkUpdateZ_Sentinel,
2460 } LDKCOption_NetworkUpdateZ_Tag;
2462 typedef struct LDKCOption_NetworkUpdateZ {
2463 LDKCOption_NetworkUpdateZ_Tag tag;
2466 struct LDKNetworkUpdate some;
2469 } LDKCOption_NetworkUpdateZ;
2474 * A reference to a transaction output.
2476 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
2477 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
2479 typedef struct MUST_USE_STRUCT LDKOutPoint {
2481 * A pointer to the opaque Rust object.
2482 * Nearly everywhere, inner must be non-null, however in places where
2483 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2485 LDKnativeOutPoint *inner;
2487 * Indicates that this is the only struct which contains the same pointer.
2488 * Rust functions which take ownership of an object provided via an argument require
2489 * this to be true and invalidate the object pointed to by inner.
2497 * Information about a spendable output to a P2WSH script. See
2498 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
2500 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
2502 * A pointer to the opaque Rust object.
2503 * Nearly everywhere, inner must be non-null, however in places where
2504 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2506 LDKnativeDelayedPaymentOutputDescriptor *inner;
2508 * Indicates that this is the only struct which contains the same pointer.
2509 * Rust functions which take ownership of an object provided via an argument require
2510 * this to be true and invalidate the object pointed to by inner.
2513 } LDKDelayedPaymentOutputDescriptor;
2518 * Information about a spendable output to our \"payment key\". See
2519 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
2521 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
2523 * A pointer to the opaque Rust object.
2524 * Nearly everywhere, inner must be non-null, however in places where
2525 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2527 LDKnativeStaticPaymentOutputDescriptor *inner;
2529 * Indicates that this is the only struct which contains the same pointer.
2530 * Rust functions which take ownership of an object provided via an argument require
2531 * this to be true and invalidate the object pointed to by inner.
2534 } LDKStaticPaymentOutputDescriptor;
2537 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
2538 * claim at any point in the future) an event is generated which you must track and be able to
2539 * spend on-chain. The information needed to do this is provided in this enum, including the
2540 * outpoint describing which txid and output index is available, the full output which exists at
2541 * that txid/index, and any keys or other information required to sign.
2543 typedef enum LDKSpendableOutputDescriptor_Tag {
2545 * An output to a script which was provided via KeysInterface directly, either from
2546 * `get_destination_script()` or `get_shutdown_scriptpubkey()`, thus you should already know
2547 * how to spend it. No secret keys are provided as rust-lightning was never given any key.
2548 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
2549 * on-chain using the payment preimage or after it has timed out.
2551 LDKSpendableOutputDescriptor_StaticOutput,
2553 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
2555 * The witness in the spending input should be:
2556 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
2558 * Note that the nSequence field in the spending input must be set to to_self_delay
2559 * (which means the transaction is not broadcastable until at least to_self_delay
2560 * blocks after the outpoint confirms).
2562 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
2563 * it is an output from an old state which we broadcast (which should never happen).
2565 * To derive the delayed_payment key which is used to sign for this input, you must pass the
2566 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
2567 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
2568 * chan_utils::derive_private_key. The public key can be generated without the secret key
2569 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
2572 * To derive the revocation_pubkey provided here (which is used in the witness
2573 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
2574 * call to Sign::ready_channel) and the provided per_commitment point
2575 * to chan_utils::derive_public_revocation_key.
2577 * The witness script which is hashed and included in the output script_pubkey may be
2578 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
2579 * (derived as above), and the to_self_delay contained here to
2580 * chan_utils::get_revokeable_redeemscript.
2582 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
2584 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
2585 * corresponds to the public key in Sign::pubkeys().payment_point).
2586 * The witness in the spending input, is, thus, simply:
2587 * <BIP 143 signature> <payment key>
2589 * These are generally the result of our counterparty having broadcast the current state,
2590 * allowing us to claim the non-HTLC-encumbered outputs immediately.
2592 LDKSpendableOutputDescriptor_StaticPaymentOutput,
2594 * Must be last for serialization purposes
2596 LDKSpendableOutputDescriptor_Sentinel,
2597 } LDKSpendableOutputDescriptor_Tag;
2599 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
2601 * The outpoint which is spendable
2603 struct LDKOutPoint outpoint;
2605 * The output which is referenced by the given outpoint.
2607 struct LDKTxOut output;
2608 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
2610 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
2611 LDKSpendableOutputDescriptor_Tag tag;
2613 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
2615 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
2618 struct LDKStaticPaymentOutputDescriptor static_payment_output;
2621 } LDKSpendableOutputDescriptor;
2624 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
2625 * This corresponds to std::vector in C++
2627 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2629 * The elements in the array.
2630 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2632 struct LDKSpendableOutputDescriptor *data;
2634 * The number of elements pointed to by `data`.
2637 } LDKCVec_SpendableOutputDescriptorZ;
2642 * Features used within the channel_type field in an OpenChannel message.
2644 * A channel is always of some known \"type\", describing the transaction formats used and the exact
2645 * semantics of our interaction with our peer.
2647 * Note that because a channel is a specific type which is proposed by the opener and accepted by
2648 * the counterparty, only required features are allowed here.
2650 * This is serialized differently from other feature types - it is not prefixed by a length, and
2651 * thus must only appear inside a TLV where its length is known in advance.
2653 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
2655 * A pointer to the opaque Rust object.
2656 * Nearly everywhere, inner must be non-null, however in places where
2657 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2659 LDKnativeChannelTypeFeatures *inner;
2661 * Indicates that this is the only struct which contains the same pointer.
2662 * Rust functions which take ownership of an object provided via an argument require
2663 * this to be true and invalidate the object pointed to by inner.
2666 } LDKChannelTypeFeatures;
2669 * An Event which you should probably take some action in response to.
2671 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
2672 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
2673 * written as it makes no sense to respond to it after reconnecting to peers).
2675 typedef enum LDKEvent_Tag {
2677 * Used to indicate that the client should generate a funding transaction with the given
2678 * parameters and then call [`ChannelManager::funding_transaction_generated`].
2679 * Generated in [`ChannelManager`] message handling.
2680 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
2681 * counterparty can steal your funds!
2683 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2684 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
2686 LDKEvent_FundingGenerationReady,
2688 * Indicates we've received (an offer of) money! Just gotta dig out that payment preimage and
2689 * feed it to [`ChannelManager::claim_funds`] to get it....
2691 * Note that if the preimage is not known, you should call
2692 * [`ChannelManager::fail_htlc_backwards`] to free up resources for this HTLC and avoid
2693 * network congestion.
2694 * If you fail to call either [`ChannelManager::claim_funds`] or
2695 * [`ChannelManager::fail_htlc_backwards`] within the HTLC's timeout, the HTLC will be
2696 * automatically failed.
2699 * LDK will not stop an inbound payment from being paid multiple times, so multiple
2700 * `PaymentReceived` events may be generated for the same payment.
2702 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2703 * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
2705 LDKEvent_PaymentReceived,
2707 * Indicates a payment has been claimed and we've received money!
2709 * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
2710 * to an [`Event::PaymentReceived`]. However, if we previously crashed during a
2711 * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
2712 * [`Event::PaymentReceived`] event.
2715 * LDK will not stop an inbound payment from being paid multiple times, so multiple
2716 * `PaymentReceived` events may be generated for the same payment. If you then call
2717 * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentReceived`] you may get
2718 * multiple `PaymentClaimed` events.
2720 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2722 LDKEvent_PaymentClaimed,
2724 * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
2725 * and we got back the payment preimage for it).
2727 * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
2728 * event. In this situation, you SHOULD treat this payment as having succeeded.
2730 LDKEvent_PaymentSent,
2732 * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
2733 * provide failure information for each MPP part in the payment.
2735 * This event is provided once there are no further pending HTLCs for the payment and the
2736 * payment is no longer retryable, either due to a several-block timeout or because
2737 * [`ChannelManager::abandon_payment`] was previously called for the corresponding payment.
2739 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
2741 LDKEvent_PaymentFailed,
2743 * Indicates that a path for an outbound payment was successful.
2745 * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
2746 * [`Event::PaymentSent`] for obtaining the payment preimage.
2748 LDKEvent_PaymentPathSuccessful,
2750 * Indicates an outbound HTLC we sent failed. Probably some intermediary node dropped
2751 * something. You may wish to retry with a different route.
2753 * Note that this does *not* indicate that all paths for an MPP payment have failed, see
2754 * [`Event::PaymentFailed`] and [`all_paths_failed`].
2756 * [`all_paths_failed`]: Self::PaymentPathFailed::all_paths_failed
2758 LDKEvent_PaymentPathFailed,
2760 * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
2761 * a time in the future.
2763 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
2765 LDKEvent_PendingHTLCsForwardable,
2767 * Used to indicate that an output which you should know how to spend was confirmed on chain
2768 * and is now spendable.
2769 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
2770 * counterparty spending them due to some kind of timeout. Thus, you need to store them
2771 * somewhere and spend them when you create on-chain transactions.
2773 LDKEvent_SpendableOutputs,
2775 * This event is generated when a payment has been successfully forwarded through us and a
2776 * forwarding fee earned.
2778 LDKEvent_PaymentForwarded,
2780 * Used to indicate that a previously opened channel with the given `channel_id` is in the
2781 * process of closure.
2783 LDKEvent_ChannelClosed,
2785 * Used to indicate to the user that they can abandon the funding transaction and recycle the
2786 * inputs for another purpose.
2788 LDKEvent_DiscardFunding,
2790 * Indicates a request to open a new channel by a peer.
2792 * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the
2793 * request, call [`ChannelManager::force_close_channel`].
2795 * The event is only triggered when a new open channel request is received and the
2796 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
2798 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
2799 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel
2800 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
2802 LDKEvent_OpenChannelRequest,
2804 * Must be last for serialization purposes
2809 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
2811 * The random channel_id we picked which you'll need to pass into
2812 * [`ChannelManager::funding_transaction_generated`].
2814 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
2816 struct LDKThirtyTwoBytes temporary_channel_id;
2818 * The counterparty's node_id, which you'll need to pass back into
2819 * [`ChannelManager::funding_transaction_generated`].
2821 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
2823 struct LDKPublicKey counterparty_node_id;
2825 * The value, in satoshis, that the output should have.
2827 uint64_t channel_value_satoshis;
2829 * The script which should be used in the transaction output.
2831 struct LDKCVec_u8Z output_script;
2833 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or 0 for
2834 * an inbound channel.
2836 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
2838 uint64_t user_channel_id;
2839 } LDKEvent_LDKFundingGenerationReady_Body;
2841 typedef struct LDKEvent_LDKPaymentReceived_Body {
2843 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
2844 * not stop you from registering duplicate payment hashes for inbound payments.
2846 struct LDKThirtyTwoBytes payment_hash;
2848 * The value, in thousandths of a satoshi, that this payment is for.
2850 uint64_t amount_msat;
2852 * Information for claiming this received payment, based on whether the purpose of the
2853 * payment is to pay an invoice or to send a spontaneous payment.
2855 struct LDKPaymentPurpose purpose;
2856 } LDKEvent_LDKPaymentReceived_Body;
2858 typedef struct LDKEvent_LDKPaymentClaimed_Body {
2860 * The payment hash of the claimed payment. Note that LDK will not stop you from
2861 * registering duplicate payment hashes for inbound payments.
2863 struct LDKThirtyTwoBytes payment_hash;
2865 * The value, in thousandths of a satoshi, that this payment is for.
2867 uint64_t amount_msat;
2869 * The purpose of this claimed payment, i.e. whether the payment was for an invoice or a
2870 * spontaneous payment.
2872 struct LDKPaymentPurpose purpose;
2873 } LDKEvent_LDKPaymentClaimed_Body;
2875 typedef struct LDKEvent_LDKPaymentSent_Body {
2877 * The id returned by [`ChannelManager::send_payment`] and used with
2878 * [`ChannelManager::retry_payment`].
2880 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
2881 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
2883 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2885 struct LDKThirtyTwoBytes payment_id;
2887 * The preimage to the hash given to ChannelManager::send_payment.
2888 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
2891 struct LDKThirtyTwoBytes payment_preimage;
2893 * The hash that was given to [`ChannelManager::send_payment`].
2895 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
2897 struct LDKThirtyTwoBytes payment_hash;
2899 * The total fee which was spent at intermediate hops in this payment, across all paths.
2901 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
2902 * overpayment to the recipient node.
2904 * If the recipient or an intermediate node misbehaves and gives us free money, this may
2905 * overstate the amount paid, though this is unlikely.
2907 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
2909 struct LDKCOption_u64Z fee_paid_msat;
2910 } LDKEvent_LDKPaymentSent_Body;
2912 typedef struct LDKEvent_LDKPaymentFailed_Body {
2914 * The id returned by [`ChannelManager::send_payment`] and used with
2915 * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
2917 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
2918 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
2919 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
2921 struct LDKThirtyTwoBytes payment_id;
2923 * The hash that was given to [`ChannelManager::send_payment`].
2925 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
2927 struct LDKThirtyTwoBytes payment_hash;
2928 } LDKEvent_LDKPaymentFailed_Body;
2930 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
2932 * The id returned by [`ChannelManager::send_payment`] and used with
2933 * [`ChannelManager::retry_payment`].
2935 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
2936 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
2938 struct LDKThirtyTwoBytes payment_id;
2940 * The hash that was given to [`ChannelManager::send_payment`].
2942 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
2944 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2946 struct LDKThirtyTwoBytes payment_hash;
2948 * The payment path that was successful.
2950 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
2952 struct LDKCVec_RouteHopZ path;
2953 } LDKEvent_LDKPaymentPathSuccessful_Body;
2955 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
2957 * The id returned by [`ChannelManager::send_payment`] and used with
2958 * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
2960 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
2961 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
2962 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
2964 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2966 struct LDKThirtyTwoBytes payment_id;
2968 * The hash that was given to [`ChannelManager::send_payment`].
2970 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
2972 struct LDKThirtyTwoBytes payment_hash;
2974 * Indicates the payment was rejected for some reason by the recipient. This implies that
2975 * the payment has failed, not just the route in question. If this is not set, you may
2976 * retry the payment via a different route.
2978 bool rejected_by_dest;
2980 * Any failure information conveyed via the Onion return packet by a node along the failed
2983 * Should be applied to the [`NetworkGraph`] so that routing decisions can take into
2984 * account the update.
2986 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
2988 struct LDKCOption_NetworkUpdateZ network_update;
2990 * For both single-path and multi-path payments, this is set if all paths of the payment have
2991 * failed. This will be set to false if (1) this is an MPP payment and (2) other parts of the
2992 * larger MPP payment were still in flight when this event was generated.
2994 * Note that if you are retrying individual MPP parts, using this value to determine if a
2995 * payment has fully failed is race-y. Because multiple failures can happen prior to events
2996 * being processed, you may retry in response to a first failure, with a second failure
2997 * (with `all_paths_failed` set) still pending. Then, when the second failure is processed
2998 * you will see `all_paths_failed` set even though the retry of the first failure still
2999 * has an associated in-flight HTLC. See (1) for an example of such a failure.
3001 * If you wish to retry individual MPP parts and learn when a payment has failed, you must
3002 * call [`ChannelManager::abandon_payment`] and wait for a [`Event::PaymentFailed`] event.
3004 * (1) <https://github.com/lightningdevkit/rust-lightning/issues/1164>
3006 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3008 bool all_paths_failed;
3010 * The payment path that failed.
3012 struct LDKCVec_RouteHopZ path;
3014 * The channel responsible for the failed payment path.
3016 * Note that for route hints or for the first hop in a path this may be an SCID alias and
3017 * may not refer to a channel in the public network graph. These aliases may also collide
3018 * with channels in the public network graph.
3020 * If this is `Some`, then the corresponding channel should be avoided when the payment is
3021 * retried. May be `None` for older [`Event`] serializations.
3023 struct LDKCOption_u64Z short_channel_id;
3025 * Parameters needed to compute a new [`Route`] when retrying the failed payment path.
3027 * See [`find_route`] for details.
3029 * [`Route`]: crate::routing::router::Route
3030 * [`find_route`]: crate::routing::router::find_route
3032 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3034 struct LDKRouteParameters retry;
3035 } LDKEvent_LDKPaymentPathFailed_Body;
3037 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
3039 * The minimum amount of time that should be waited prior to calling
3040 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
3041 * you should wait a random amount of time in roughly the range (now + time_forwardable,
3042 * now + 5*time_forwardable).
3044 uint64_t time_forwardable;
3045 } LDKEvent_LDKPendingHTLCsForwardable_Body;
3047 typedef struct LDKEvent_LDKSpendableOutputs_Body {
3049 * The outputs which you should store as spendable by you.
3051 struct LDKCVec_SpendableOutputDescriptorZ outputs;
3052 } LDKEvent_LDKSpendableOutputs_Body;
3054 typedef struct LDKEvent_LDKPaymentForwarded_Body {
3056 * The incoming channel between the previous node and us. This is only `None` for events
3057 * generated or serialized by versions prior to 0.0.107.
3059 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3061 struct LDKThirtyTwoBytes prev_channel_id;
3063 * The outgoing channel between the next node and us. This is only `None` for events
3064 * generated or serialized by versions prior to 0.0.107.
3066 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3068 struct LDKThirtyTwoBytes next_channel_id;
3070 * The fee, in milli-satoshis, which was earned as a result of the payment.
3072 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
3073 * was pending, the amount the next hop claimed will have been rounded down to the nearest
3074 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
3075 * claimed the full value in millisatoshis from the source. In this case,
3076 * `claim_from_onchain_tx` will be set.
3078 * If the channel which sent us the payment has been force-closed, we will claim the funds
3079 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
3080 * fees which we will spend and will instead set this to `None`. It is possible duplicate
3081 * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
3084 struct LDKCOption_u64Z fee_earned_msat;
3086 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
3089 bool claim_from_onchain_tx;
3090 } LDKEvent_LDKPaymentForwarded_Body;
3092 typedef struct LDKEvent_LDKChannelClosed_Body {
3094 * The channel_id of the channel which has been closed. Note that on-chain transactions
3095 * resolving the channel are likely still awaiting confirmation.
3097 struct LDKThirtyTwoBytes channel_id;
3099 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
3100 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
3101 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
3102 * `user_channel_id` will be 0 for an inbound channel.
3103 * This will always be zero for objects serialized with LDK versions prior to 0.0.102.
3105 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
3106 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3107 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
3109 uint64_t user_channel_id;
3111 * The reason the channel was closed.
3113 struct LDKClosureReason reason;
3114 } LDKEvent_LDKChannelClosed_Body;
3116 typedef struct LDKEvent_LDKDiscardFunding_Body {
3118 * The channel_id of the channel which has been closed.
3120 struct LDKThirtyTwoBytes channel_id;
3122 * The full transaction received from the user
3124 struct LDKTransaction transaction;
3125 } LDKEvent_LDKDiscardFunding_Body;
3127 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
3129 * The temporary channel ID of the channel requested to be opened.
3131 * When responding to the request, the `temporary_channel_id` should be passed
3132 * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
3133 * or through [`ChannelManager::force_close_channel`] to reject.
3135 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3136 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel
3138 struct LDKThirtyTwoBytes temporary_channel_id;
3140 * The node_id of the counterparty requesting to open the channel.
3142 * When responding to the request, the `counterparty_node_id` should be passed
3143 * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
3144 * accept the request, or through [`ChannelManager::force_close_channel`] to reject the
3147 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3148 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel
3150 struct LDKPublicKey counterparty_node_id;
3152 * The channel value of the requested channel.
3154 uint64_t funding_satoshis;
3156 * Our starting balance in the channel if the request is accepted, in milli-satoshi.
3160 * The features that this channel will operate with. If you reject the channel, a
3161 * well-behaved counterparty may automatically re-attempt the channel with a new set of
3164 * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
3165 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
3168 * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
3169 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
3170 * 0.0.107. Channels setting this type also need to get manually accepted via
3171 * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
3172 * or will be rejected otherwise.
3174 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3176 struct LDKChannelTypeFeatures channel_type;
3177 } LDKEvent_LDKOpenChannelRequest_Body;
3179 typedef struct MUST_USE_STRUCT LDKEvent {
3182 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
3183 LDKEvent_LDKPaymentReceived_Body payment_received;
3184 LDKEvent_LDKPaymentClaimed_Body payment_claimed;
3185 LDKEvent_LDKPaymentSent_Body payment_sent;
3186 LDKEvent_LDKPaymentFailed_Body payment_failed;
3187 LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
3188 LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
3189 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
3190 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
3191 LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
3192 LDKEvent_LDKChannelClosed_Body channel_closed;
3193 LDKEvent_LDKDiscardFunding_Body discard_funding;
3194 LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
3199 * An enum which can either contain a crate::lightning::util::events::Event or not
3201 typedef enum LDKCOption_EventZ_Tag {
3203 * When we're in this state, this COption_EventZ contains a crate::lightning::util::events::Event
3205 LDKCOption_EventZ_Some,
3207 * When we're in this state, this COption_EventZ contains nothing
3209 LDKCOption_EventZ_None,
3211 * Must be last for serialization purposes
3213 LDKCOption_EventZ_Sentinel,
3214 } LDKCOption_EventZ_Tag;
3216 typedef struct LDKCOption_EventZ {
3217 LDKCOption_EventZ_Tag tag;
3220 struct LDKEvent some;
3223 } LDKCOption_EventZ;
3226 * The contents of CResult_COption_EventZDecodeErrorZ
3228 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
3230 * A pointer to the contents in the success state.
3231 * Reading from this pointer when `result_ok` is not set is undefined.
3233 struct LDKCOption_EventZ *result;
3235 * A pointer to the contents in the error state.
3236 * Reading from this pointer when `result_ok` is set is undefined.
3238 struct LDKDecodeError *err;
3239 } LDKCResult_COption_EventZDecodeErrorZPtr;
3242 * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
3243 * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
3244 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3246 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
3248 * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
3249 * `err` or `result` depending on the state of `result_ok`.
3251 union LDKCResult_COption_EventZDecodeErrorZPtr contents;
3253 * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
3256 } LDKCResult_COption_EventZDecodeErrorZ;
3261 * An accept_channel message to be sent or received from a peer
3263 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
3265 * A pointer to the opaque Rust object.
3266 * Nearly everywhere, inner must be non-null, however in places where
3267 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3269 LDKnativeAcceptChannel *inner;
3271 * Indicates that this is the only struct which contains the same pointer.
3272 * Rust functions which take ownership of an object provided via an argument require
3273 * this to be true and invalidate the object pointed to by inner.
3281 * An open_channel message to be sent or received from a peer
3283 typedef struct MUST_USE_STRUCT LDKOpenChannel {
3285 * A pointer to the opaque Rust object.
3286 * Nearly everywhere, inner must be non-null, however in places where
3287 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3289 LDKnativeOpenChannel *inner;
3291 * Indicates that this is the only struct which contains the same pointer.
3292 * Rust functions which take ownership of an object provided via an argument require
3293 * this to be true and invalidate the object pointed to by inner.
3301 * A funding_created message to be sent or received from a peer
3303 typedef struct MUST_USE_STRUCT LDKFundingCreated {
3305 * A pointer to the opaque Rust object.
3306 * Nearly everywhere, inner must be non-null, however in places where
3307 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3309 LDKnativeFundingCreated *inner;
3311 * Indicates that this is the only struct which contains the same pointer.
3312 * Rust functions which take ownership of an object provided via an argument require
3313 * this to be true and invalidate the object pointed to by inner.
3316 } LDKFundingCreated;
3321 * A funding_signed message to be sent or received from a peer
3323 typedef struct MUST_USE_STRUCT LDKFundingSigned {
3325 * A pointer to the opaque Rust object.
3326 * Nearly everywhere, inner must be non-null, however in places where
3327 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3329 LDKnativeFundingSigned *inner;
3331 * Indicates that this is the only struct which contains the same pointer.
3332 * Rust functions which take ownership of an object provided via an argument require
3333 * this to be true and invalidate the object pointed to by inner.
3341 * A channel_ready message to be sent or received from a peer
3343 typedef struct MUST_USE_STRUCT LDKChannelReady {
3345 * A pointer to the opaque Rust object.
3346 * Nearly everywhere, inner must be non-null, however in places where
3347 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3349 LDKnativeChannelReady *inner;
3351 * Indicates that this is the only struct which contains the same pointer.
3352 * Rust functions which take ownership of an object provided via an argument require
3353 * this to be true and invalidate the object pointed to by inner.
3361 * An announcement_signatures message to be sent or received from a peer
3363 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
3365 * A pointer to the opaque Rust object.
3366 * Nearly everywhere, inner must be non-null, however in places where
3367 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3369 LDKnativeAnnouncementSignatures *inner;
3371 * Indicates that this is the only struct which contains the same pointer.
3372 * Rust functions which take ownership of an object provided via an argument require
3373 * this to be true and invalidate the object pointed to by inner.
3376 } LDKAnnouncementSignatures;
3381 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
3382 * transaction updates if they were pending.
3384 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
3386 * A pointer to the opaque Rust object.
3387 * Nearly everywhere, inner must be non-null, however in places where
3388 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3390 LDKnativeCommitmentUpdate *inner;
3392 * Indicates that this is the only struct which contains the same pointer.
3393 * Rust functions which take ownership of an object provided via an argument require
3394 * this to be true and invalidate the object pointed to by inner.
3397 } LDKCommitmentUpdate;
3402 * A revoke_and_ack message to be sent or received from a peer
3404 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
3406 * A pointer to the opaque Rust object.
3407 * Nearly everywhere, inner must be non-null, however in places where
3408 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3410 LDKnativeRevokeAndACK *inner;
3412 * Indicates that this is the only struct which contains the same pointer.
3413 * Rust functions which take ownership of an object provided via an argument require
3414 * this to be true and invalidate the object pointed to by inner.
3422 * A closing_signed message to be sent or received from a peer
3424 typedef struct MUST_USE_STRUCT LDKClosingSigned {
3426 * A pointer to the opaque Rust object.
3427 * Nearly everywhere, inner must be non-null, however in places where
3428 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3430 LDKnativeClosingSigned *inner;
3432 * Indicates that this is the only struct which contains the same pointer.
3433 * Rust functions which take ownership of an object provided via an argument require
3434 * this to be true and invalidate the object pointed to by inner.
3442 * A shutdown message to be sent or received from a peer
3444 typedef struct MUST_USE_STRUCT LDKShutdown {
3446 * A pointer to the opaque Rust object.
3447 * Nearly everywhere, inner must be non-null, however in places where
3448 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3450 LDKnativeShutdown *inner;
3452 * Indicates that this is the only struct which contains the same pointer.
3453 * Rust functions which take ownership of an object provided via an argument require
3454 * this to be true and invalidate the object pointed to by inner.
3462 * A channel_reestablish message to be sent or received from a peer
3464 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
3466 * A pointer to the opaque Rust object.
3467 * Nearly everywhere, inner must be non-null, however in places where
3468 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3470 LDKnativeChannelReestablish *inner;
3472 * Indicates that this is the only struct which contains the same pointer.
3473 * Rust functions which take ownership of an object provided via an argument require
3474 * this to be true and invalidate the object pointed to by inner.
3477 } LDKChannelReestablish;
3482 * A channel_announcement message to be sent or received from a peer
3484 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
3486 * A pointer to the opaque Rust object.
3487 * Nearly everywhere, inner must be non-null, however in places where
3488 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3490 LDKnativeChannelAnnouncement *inner;
3492 * Indicates that this is the only struct which contains the same pointer.
3493 * Rust functions which take ownership of an object provided via an argument require
3494 * this to be true and invalidate the object pointed to by inner.
3497 } LDKChannelAnnouncement;
3502 * A node_announcement message to be sent or received from a peer
3504 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
3506 * A pointer to the opaque Rust object.
3507 * Nearly everywhere, inner must be non-null, however in places where
3508 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3510 LDKnativeNodeAnnouncement *inner;
3512 * Indicates that this is the only struct which contains the same pointer.
3513 * Rust functions which take ownership of an object provided via an argument require
3514 * this to be true and invalidate the object pointed to by inner.
3517 } LDKNodeAnnouncement;
3522 * An error message to be sent or received from a peer
3524 typedef struct MUST_USE_STRUCT LDKErrorMessage {
3526 * A pointer to the opaque Rust object.
3527 * Nearly everywhere, inner must be non-null, however in places where
3528 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3530 LDKnativeErrorMessage *inner;
3532 * Indicates that this is the only struct which contains the same pointer.
3533 * Rust functions which take ownership of an object provided via an argument require
3534 * this to be true and invalidate the object pointed to by inner.
3542 * A warning message to be sent or received from a peer
3544 typedef struct MUST_USE_STRUCT LDKWarningMessage {
3546 * A pointer to the opaque Rust object.
3547 * Nearly everywhere, inner must be non-null, however in places where
3548 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3550 LDKnativeWarningMessage *inner;
3552 * Indicates that this is the only struct which contains the same pointer.
3553 * Rust functions which take ownership of an object provided via an argument require
3554 * this to be true and invalidate the object pointed to by inner.
3557 } LDKWarningMessage;
3560 * Used to put an error message in a LightningError
3562 typedef enum LDKErrorAction_Tag {
3564 * The peer took some action which made us think they were useless. Disconnect them.
3566 LDKErrorAction_DisconnectPeer,
3568 * The peer did something harmless that we weren't able to process, just log and ignore
3570 LDKErrorAction_IgnoreError,
3572 * The peer did something harmless that we weren't able to meaningfully process.
3573 * If the error is logged, log it at the given level.
3575 LDKErrorAction_IgnoreAndLog,
3577 * The peer provided us with a gossip message which we'd already seen. In most cases this
3578 * should be ignored, but it may result in the message being forwarded if it is a duplicate of
3579 * our own channel announcements.
3581 LDKErrorAction_IgnoreDuplicateGossip,
3583 * The peer did something incorrect. Tell them.
3585 LDKErrorAction_SendErrorMessage,
3587 * The peer did something incorrect. Tell them without closing any channels.
3589 LDKErrorAction_SendWarningMessage,
3591 * Must be last for serialization purposes
3593 LDKErrorAction_Sentinel,
3594 } LDKErrorAction_Tag;
3596 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
3598 * An error message which we should make an effort to send before we disconnect.
3600 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3602 struct LDKErrorMessage msg;
3603 } LDKErrorAction_LDKDisconnectPeer_Body;
3605 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
3607 * The message to send.
3609 struct LDKErrorMessage msg;
3610 } LDKErrorAction_LDKSendErrorMessage_Body;
3612 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
3614 * The message to send.
3616 struct LDKWarningMessage msg;
3618 * The peer may have done something harmless that we weren't able to meaningfully process,
3619 * though we should still tell them about it.
3620 * If this event is logged, log it at the given level.
3622 enum LDKLevel log_level;
3623 } LDKErrorAction_LDKSendWarningMessage_Body;
3625 typedef struct MUST_USE_STRUCT LDKErrorAction {
3626 LDKErrorAction_Tag tag;
3628 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
3630 enum LDKLevel ignore_and_log;
3632 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
3633 LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
3640 * A query_channel_range message is used to query a peer for channel
3641 * UTXOs in a range of blocks. The recipient of a query makes a best
3642 * effort to reply to the query using one or more reply_channel_range
3645 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
3647 * A pointer to the opaque Rust object.
3648 * Nearly everywhere, inner must be non-null, however in places where
3649 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3651 LDKnativeQueryChannelRange *inner;
3653 * Indicates that this is the only struct which contains the same pointer.
3654 * Rust functions which take ownership of an object provided via an argument require
3655 * this to be true and invalidate the object pointed to by inner.
3658 } LDKQueryChannelRange;
3663 * A query_short_channel_ids message is used to query a peer for
3664 * routing gossip messages related to one or more short_channel_ids.
3665 * The query recipient will reply with the latest, if available,
3666 * channel_announcement, channel_update and node_announcement messages
3667 * it maintains for the requested short_channel_ids followed by a
3668 * reply_short_channel_ids_end message. The short_channel_ids sent in
3669 * this query are encoded. We only support encoding_type=0 uncompressed
3670 * serialization and do not support encoding_type=1 zlib serialization.
3672 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
3674 * A pointer to the opaque Rust object.
3675 * Nearly everywhere, inner must be non-null, however in places where
3676 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3678 LDKnativeQueryShortChannelIds *inner;
3680 * Indicates that this is the only struct which contains the same pointer.
3681 * Rust functions which take ownership of an object provided via an argument require
3682 * this to be true and invalidate the object pointed to by inner.
3685 } LDKQueryShortChannelIds;
3690 * A reply_channel_range message is a reply to a query_channel_range
3691 * message. Multiple reply_channel_range messages can be sent in reply
3692 * to a single query_channel_range message. The query recipient makes a
3693 * best effort to respond based on their local network view which may
3694 * not be a perfect view of the network. The short_channel_ids in the
3695 * reply are encoded. We only support encoding_type=0 uncompressed
3696 * serialization and do not support encoding_type=1 zlib serialization.
3698 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
3700 * A pointer to the opaque Rust object.
3701 * Nearly everywhere, inner must be non-null, however in places where
3702 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3704 LDKnativeReplyChannelRange *inner;
3706 * Indicates that this is the only struct which contains the same pointer.
3707 * Rust functions which take ownership of an object provided via an argument require
3708 * this to be true and invalidate the object pointed to by inner.
3711 } LDKReplyChannelRange;
3716 * A gossip_timestamp_filter message is used by a node to request
3717 * gossip relay for messages in the requested time range when the
3718 * gossip_queries feature has been negotiated.
3720 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
3722 * A pointer to the opaque Rust object.
3723 * Nearly everywhere, inner must be non-null, however in places where
3724 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3726 LDKnativeGossipTimestampFilter *inner;
3728 * Indicates that this is the only struct which contains the same pointer.
3729 * Rust functions which take ownership of an object provided via an argument require
3730 * this to be true and invalidate the object pointed to by inner.
3733 } LDKGossipTimestampFilter;
3736 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
3737 * broadcast to most peers).
3738 * These events are handled by PeerManager::process_events if you are using a PeerManager.
3740 typedef enum LDKMessageSendEvent_Tag {
3742 * Used to indicate that we've accepted a channel open and should send the accept_channel
3743 * message provided to the given peer.
3745 LDKMessageSendEvent_SendAcceptChannel,
3747 * Used to indicate that we've initiated a channel open and should send the open_channel
3748 * message provided to the given peer.
3750 LDKMessageSendEvent_SendOpenChannel,
3752 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
3754 LDKMessageSendEvent_SendFundingCreated,
3756 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
3758 LDKMessageSendEvent_SendFundingSigned,
3760 * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
3762 LDKMessageSendEvent_SendChannelReady,
3764 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
3766 LDKMessageSendEvent_SendAnnouncementSignatures,
3768 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
3769 * message should be sent to the peer with the given node_id.
3771 LDKMessageSendEvent_UpdateHTLCs,
3773 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
3775 LDKMessageSendEvent_SendRevokeAndACK,
3777 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
3779 LDKMessageSendEvent_SendClosingSigned,
3781 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
3783 LDKMessageSendEvent_SendShutdown,
3785 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
3787 LDKMessageSendEvent_SendChannelReestablish,
3789 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
3790 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
3792 * Note that after doing so, you very likely (unless you did so very recently) want to call
3793 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
3794 * This ensures that any nodes which see our channel_announcement also have a relevant
3795 * node_announcement, including relevant feature flags which may be important for routing
3798 LDKMessageSendEvent_BroadcastChannelAnnouncement,
3800 * Used to indicate that a node_announcement should be broadcast to all peers.
3802 LDKMessageSendEvent_BroadcastNodeAnnouncement,
3804 * Used to indicate that a channel_update should be broadcast to all peers.
3806 LDKMessageSendEvent_BroadcastChannelUpdate,
3808 * Used to indicate that a channel_update should be sent to a single peer.
3809 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
3810 * private channel and we shouldn't be informing all of our peers of channel parameters.
3812 LDKMessageSendEvent_SendChannelUpdate,
3814 * Broadcast an error downstream to be handled
3816 LDKMessageSendEvent_HandleError,
3818 * Query a peer for channels with funding transaction UTXOs in a block range.
3820 LDKMessageSendEvent_SendChannelRangeQuery,
3822 * Request routing gossip messages from a peer for a list of channels identified by
3823 * their short_channel_ids.
3825 LDKMessageSendEvent_SendShortIdsQuery,
3827 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
3828 * emitted during processing of the query.
3830 LDKMessageSendEvent_SendReplyChannelRange,
3832 * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
3833 * enable receiving gossip messages from the peer.
3835 LDKMessageSendEvent_SendGossipTimestampFilter,
3837 * Must be last for serialization purposes
3839 LDKMessageSendEvent_Sentinel,
3840 } LDKMessageSendEvent_Tag;
3842 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
3844 * The node_id of the node which should receive this message
3846 struct LDKPublicKey node_id;
3848 * The message which should be sent.
3850 struct LDKAcceptChannel msg;
3851 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
3853 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
3855 * The node_id of the node which should receive this message
3857 struct LDKPublicKey node_id;
3859 * The message which should be sent.
3861 struct LDKOpenChannel msg;
3862 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
3864 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
3866 * The node_id of the node which should receive this message
3868 struct LDKPublicKey node_id;
3870 * The message which should be sent.
3872 struct LDKFundingCreated msg;
3873 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
3875 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
3877 * The node_id of the node which should receive this message
3879 struct LDKPublicKey node_id;
3881 * The message which should be sent.
3883 struct LDKFundingSigned msg;
3884 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
3886 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
3888 * The node_id of the node which should receive these message(s)
3890 struct LDKPublicKey node_id;
3892 * The channel_ready message which should be sent.
3894 struct LDKChannelReady msg;
3895 } LDKMessageSendEvent_LDKSendChannelReady_Body;
3897 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
3899 * The node_id of the node which should receive these message(s)
3901 struct LDKPublicKey node_id;
3903 * The announcement_signatures message which should be sent.
3905 struct LDKAnnouncementSignatures msg;
3906 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
3908 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
3910 * The node_id of the node which should receive these message(s)
3912 struct LDKPublicKey node_id;
3914 * The update messages which should be sent. ALL messages in the struct should be sent!
3916 struct LDKCommitmentUpdate updates;
3917 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
3919 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
3921 * The node_id of the node which should receive this message
3923 struct LDKPublicKey node_id;
3925 * The message which should be sent.
3927 struct LDKRevokeAndACK msg;
3928 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
3930 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
3932 * The node_id of the node which should receive this message
3934 struct LDKPublicKey node_id;
3936 * The message which should be sent.
3938 struct LDKClosingSigned msg;
3939 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
3941 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
3943 * The node_id of the node which should receive this message
3945 struct LDKPublicKey node_id;
3947 * The message which should be sent.
3949 struct LDKShutdown msg;
3950 } LDKMessageSendEvent_LDKSendShutdown_Body;
3952 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
3954 * The node_id of the node which should receive this message
3956 struct LDKPublicKey node_id;
3958 * The message which should be sent.
3960 struct LDKChannelReestablish msg;
3961 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
3963 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
3965 * The channel_announcement which should be sent.
3967 struct LDKChannelAnnouncement msg;
3969 * The followup channel_update which should be sent.
3971 struct LDKChannelUpdate update_msg;
3972 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
3974 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
3976 * The node_announcement which should be sent.
3978 struct LDKNodeAnnouncement msg;
3979 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
3981 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
3983 * The channel_update which should be sent.
3985 struct LDKChannelUpdate msg;
3986 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
3988 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
3990 * The node_id of the node which should receive this message
3992 struct LDKPublicKey node_id;
3994 * The channel_update which should be sent.
3996 struct LDKChannelUpdate msg;
3997 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
3999 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
4001 * The node_id of the node which should receive this message
4003 struct LDKPublicKey node_id;
4005 * The action which should be taken.
4007 struct LDKErrorAction action;
4008 } LDKMessageSendEvent_LDKHandleError_Body;
4010 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
4012 * The node_id of this message recipient
4014 struct LDKPublicKey node_id;
4016 * The query_channel_range which should be sent.
4018 struct LDKQueryChannelRange msg;
4019 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
4021 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
4023 * The node_id of this message recipient
4025 struct LDKPublicKey node_id;
4027 * The query_short_channel_ids which should be sent.
4029 struct LDKQueryShortChannelIds msg;
4030 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
4032 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
4034 * The node_id of this message recipient
4036 struct LDKPublicKey node_id;
4038 * The reply_channel_range which should be sent.
4040 struct LDKReplyChannelRange msg;
4041 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
4043 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
4045 * The node_id of this message recipient
4047 struct LDKPublicKey node_id;
4049 * The gossip_timestamp_filter which should be sent.
4051 struct LDKGossipTimestampFilter msg;
4052 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
4054 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
4055 LDKMessageSendEvent_Tag tag;
4057 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
4058 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
4059 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
4060 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
4061 LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
4062 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
4063 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
4064 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
4065 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
4066 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
4067 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
4068 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
4069 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
4070 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
4071 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
4072 LDKMessageSendEvent_LDKHandleError_Body handle_error;
4073 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
4074 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
4075 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
4076 LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
4078 } LDKMessageSendEvent;
4081 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
4082 * This corresponds to std::vector in C++
4084 typedef struct LDKCVec_MessageSendEventZ {
4086 * The elements in the array.
4087 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4089 struct LDKMessageSendEvent *data;
4091 * The number of elements pointed to by `data`.
4094 } LDKCVec_MessageSendEventZ;
4097 * The contents of CResult_TxOutAccessErrorZ
4099 typedef union LDKCResult_TxOutAccessErrorZPtr {
4101 * A pointer to the contents in the success state.
4102 * Reading from this pointer when `result_ok` is not set is undefined.
4104 struct LDKTxOut *result;
4106 * A pointer to the contents in the error state.
4107 * Reading from this pointer when `result_ok` is set is undefined.
4109 enum LDKAccessError *err;
4110 } LDKCResult_TxOutAccessErrorZPtr;
4113 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
4114 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
4115 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4117 typedef struct LDKCResult_TxOutAccessErrorZ {
4119 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
4120 * `err` or `result` depending on the state of `result_ok`.
4122 union LDKCResult_TxOutAccessErrorZPtr contents;
4124 * Whether this CResult_TxOutAccessErrorZ represents a success state.
4127 } LDKCResult_TxOutAccessErrorZ;
4130 * A tuple of 2 elements. See the individual fields for the types contained.
4132 typedef struct LDKC2Tuple_usizeTransactionZ {
4134 * The element at position 0
4138 * The element at position 1
4140 struct LDKTransaction b;
4141 } LDKC2Tuple_usizeTransactionZ;
4144 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
4145 * This corresponds to std::vector in C++
4147 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
4149 * The elements in the array.
4150 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4152 struct LDKC2Tuple_usizeTransactionZ *data;
4154 * The number of elements pointed to by `data`.
4157 } LDKCVec_C2Tuple_usizeTransactionZZ;
4160 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
4161 * This corresponds to std::vector in C++
4163 typedef struct LDKCVec_TxidZ {
4165 * The elements in the array.
4166 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4168 struct LDKThirtyTwoBytes *data;
4170 * The number of elements pointed to by `data`.
4176 * The contents of CResult_NoneChannelMonitorUpdateErrZ
4178 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
4180 * Note that this value is always NULL, as there are no contents in the OK variant
4184 * A pointer to the contents in the error state.
4185 * Reading from this pointer when `result_ok` is set is undefined.
4187 enum LDKChannelMonitorUpdateErr *err;
4188 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
4191 * A CResult_NoneChannelMonitorUpdateErrZ represents the result of a fallible operation,
4192 * containing a () on success and a crate::lightning::chain::ChannelMonitorUpdateErr on failure.
4193 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4195 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
4197 * The contents of this CResult_NoneChannelMonitorUpdateErrZ, accessible via either
4198 * `err` or `result` depending on the state of `result_ok`.
4200 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
4202 * Whether this CResult_NoneChannelMonitorUpdateErrZ represents a success state.
4205 } LDKCResult_NoneChannelMonitorUpdateErrZ;
4210 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
4211 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
4212 * preimage claim backward will lead to loss of funds.
4214 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
4216 * A pointer to the opaque Rust object.
4217 * Nearly everywhere, inner must be non-null, however in places where
4218 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4220 LDKnativeHTLCUpdate *inner;
4222 * Indicates that this is the only struct which contains the same pointer.
4223 * Rust functions which take ownership of an object provided via an argument require
4224 * this to be true and invalidate the object pointed to by inner.
4230 * An event to be processed by the ChannelManager.
4232 typedef enum LDKMonitorEvent_Tag {
4234 * A monitor event containing an HTLCUpdate.
4236 LDKMonitorEvent_HTLCEvent,
4238 * A monitor event that the Channel's commitment transaction was confirmed.
4240 LDKMonitorEvent_CommitmentTxConfirmed,
4242 * Indicates a [`ChannelMonitor`] update has completed. See
4243 * [`ChannelMonitorUpdateErr::TemporaryFailure`] for more information on how this is used.
4245 * [`ChannelMonitorUpdateErr::TemporaryFailure`]: super::ChannelMonitorUpdateErr::TemporaryFailure
4247 LDKMonitorEvent_UpdateCompleted,
4249 * Indicates a [`ChannelMonitor`] update has failed. See
4250 * [`ChannelMonitorUpdateErr::PermanentFailure`] for more information on how this is used.
4252 * [`ChannelMonitorUpdateErr::PermanentFailure`]: super::ChannelMonitorUpdateErr::PermanentFailure
4254 LDKMonitorEvent_UpdateFailed,
4256 * Must be last for serialization purposes
4258 LDKMonitorEvent_Sentinel,
4259 } LDKMonitorEvent_Tag;
4261 typedef struct LDKMonitorEvent_LDKUpdateCompleted_Body {
4263 * The funding outpoint of the [`ChannelMonitor`] that was updated
4265 struct LDKOutPoint funding_txo;
4267 * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
4268 * [`ChannelMonitor::get_latest_update_id`].
4270 * Note that this should only be set to a given update's ID if all previous updates for the
4271 * same [`ChannelMonitor`] have been applied and persisted.
4273 uint64_t monitor_update_id;
4274 } LDKMonitorEvent_LDKUpdateCompleted_Body;
4276 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
4277 LDKMonitorEvent_Tag tag;
4280 struct LDKHTLCUpdate htlc_event;
4283 struct LDKOutPoint commitment_tx_confirmed;
4285 LDKMonitorEvent_LDKUpdateCompleted_Body update_completed;
4287 struct LDKOutPoint update_failed;
4293 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
4294 * This corresponds to std::vector in C++
4296 typedef struct LDKCVec_MonitorEventZ {
4298 * The elements in the array.
4299 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4301 struct LDKMonitorEvent *data;
4303 * The number of elements pointed to by `data`.
4306 } LDKCVec_MonitorEventZ;
4309 * A tuple of 2 elements. See the individual fields for the types contained.
4311 typedef struct LDKC2Tuple_OutPointCVec_MonitorEventZZ {
4313 * The element at position 0
4315 struct LDKOutPoint a;
4317 * The element at position 1
4319 struct LDKCVec_MonitorEventZ b;
4320 } LDKC2Tuple_OutPointCVec_MonitorEventZZ;
4323 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointCVec_MonitorEventZZs of arbitrary size.
4324 * This corresponds to std::vector in C++
4326 typedef struct LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ {
4328 * The elements in the array.
4329 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4331 struct LDKC2Tuple_OutPointCVec_MonitorEventZZ *data;
4333 * The number of elements pointed to by `data`.
4336 } LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ;
4339 * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not
4341 typedef enum LDKCOption_C2Tuple_usizeTransactionZZ_Tag {
4343 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ
4345 LDKCOption_C2Tuple_usizeTransactionZZ_Some,
4347 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing
4349 LDKCOption_C2Tuple_usizeTransactionZZ_None,
4351 * Must be last for serialization purposes
4353 LDKCOption_C2Tuple_usizeTransactionZZ_Sentinel,
4354 } LDKCOption_C2Tuple_usizeTransactionZZ_Tag;
4356 typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
4357 LDKCOption_C2Tuple_usizeTransactionZZ_Tag tag;
4360 struct LDKC2Tuple_usizeTransactionZ some;
4363 } LDKCOption_C2Tuple_usizeTransactionZZ;
4368 * [`Score`] implementation that uses a fixed penalty.
4370 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
4372 * A pointer to the opaque Rust object.
4373 * Nearly everywhere, inner must be non-null, however in places where
4374 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4376 LDKnativeFixedPenaltyScorer *inner;
4378 * Indicates that this is the only struct which contains the same pointer.
4379 * Rust functions which take ownership of an object provided via an argument require
4380 * this to be true and invalidate the object pointed to by inner.
4383 } LDKFixedPenaltyScorer;
4386 * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
4388 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
4390 * A pointer to the contents in the success state.
4391 * Reading from this pointer when `result_ok` is not set is undefined.
4393 struct LDKFixedPenaltyScorer *result;
4395 * A pointer to the contents in the error state.
4396 * Reading from this pointer when `result_ok` is set is undefined.
4398 struct LDKDecodeError *err;
4399 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
4402 * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
4403 * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4404 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4406 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
4408 * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
4409 * `err` or `result` depending on the state of `result_ok`.
4411 union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
4413 * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
4416 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
4421 * A Record, unit of logging output with Metadata to enable filtering
4422 * Module_path, file, line to inform on log's source
4424 typedef struct MUST_USE_STRUCT LDKRecord {
4426 * A pointer to the opaque Rust object.
4427 * Nearly everywhere, inner must be non-null, however in places where
4428 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4430 LDKnativeRecord *inner;
4432 * Indicates that this is the only struct which contains the same pointer.
4433 * Rust functions which take ownership of an object provided via an argument require
4434 * this to be true and invalidate the object pointed to by inner.
4440 * A trait encapsulating the operations required of a logger
4442 typedef struct LDKLogger {
4444 * An opaque pointer which is passed to your function implementations as an argument.
4445 * This has no meaning in the LDK, and can be NULL or any other value.
4451 void (*log)(const void *this_arg, const struct LDKRecord *NONNULL_PTR record);
4453 * Frees any resources associated with this object given its this_arg pointer.
4454 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4456 void (*free)(void *this_arg);
4462 * Represents the network as nodes and channels between them
4464 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4466 * A pointer to the opaque Rust object.
4467 * Nearly everywhere, inner must be non-null, however in places where
4468 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4470 LDKnativeNetworkGraph *inner;
4472 * Indicates that this is the only struct which contains the same pointer.
4473 * Rust functions which take ownership of an object provided via an argument require
4474 * this to be true and invalidate the object pointed to by inner.
4482 * [`Score`] implementation using channel success probability distributions.
4484 * Based on *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
4485 * and Stefan Richter [[1]]. Given the uncertainty of channel liquidity balances, probability
4486 * distributions are defined based on knowledge learned from successful and unsuccessful attempts.
4487 * Then the negative `log10` of the success probability is used to determine the cost of routing a
4488 * specific HTLC amount through a channel.
4490 * Knowledge about channel liquidity balances takes the form of upper and lower bounds on the
4491 * possible liquidity. Certainty of the bounds is decreased over time using a decay function. See
4492 * [`ProbabilisticScoringParameters`] for details.
4494 * Since the scorer aims to learn the current channel liquidity balances, it works best for nodes
4495 * with high payment volume or that actively probe the [`NetworkGraph`]. Nodes with low payment
4496 * volume are more likely to experience failed payment paths, which would need to be retried.
4500 * Mixing the `no-std` feature between serialization and deserialization results in undefined
4503 * [1]: https://arxiv.org/abs/2107.05322
4505 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
4507 * A pointer to the opaque Rust object.
4508 * Nearly everywhere, inner must be non-null, however in places where
4509 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4511 LDKnativeProbabilisticScorer *inner;
4513 * Indicates that this is the only struct which contains the same pointer.
4514 * Rust functions which take ownership of an object provided via an argument require
4515 * this to be true and invalidate the object pointed to by inner.
4518 } LDKProbabilisticScorer;
4521 * The contents of CResult_ProbabilisticScorerDecodeErrorZ
4523 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
4525 * A pointer to the contents in the success state.
4526 * Reading from this pointer when `result_ok` is not set is undefined.
4528 struct LDKProbabilisticScorer *result;
4530 * A pointer to the contents in the error state.
4531 * Reading from this pointer when `result_ok` is set is undefined.
4533 struct LDKDecodeError *err;
4534 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
4537 * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
4538 * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4539 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4541 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
4543 * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
4544 * `err` or `result` depending on the state of `result_ok`.
4546 union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
4548 * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
4551 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
4556 * Features used within an `init` message.
4558 typedef struct MUST_USE_STRUCT LDKInitFeatures {
4560 * A pointer to the opaque Rust object.
4561 * Nearly everywhere, inner must be non-null, however in places where
4562 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4564 LDKnativeInitFeatures *inner;
4566 * Indicates that this is the only struct which contains the same pointer.
4567 * Rust functions which take ownership of an object provided via an argument require
4568 * this to be true and invalidate the object pointed to by inner.
4574 * The contents of CResult_InitFeaturesDecodeErrorZ
4576 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
4578 * A pointer to the contents in the success state.
4579 * Reading from this pointer when `result_ok` is not set is undefined.
4581 struct LDKInitFeatures *result;
4583 * A pointer to the contents in the error state.
4584 * Reading from this pointer when `result_ok` is set is undefined.
4586 struct LDKDecodeError *err;
4587 } LDKCResult_InitFeaturesDecodeErrorZPtr;
4590 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
4591 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4592 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4594 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
4596 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
4597 * `err` or `result` depending on the state of `result_ok`.
4599 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
4601 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
4604 } LDKCResult_InitFeaturesDecodeErrorZ;
4609 * Features used within a `channel_announcement` message.
4611 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
4613 * A pointer to the opaque Rust object.
4614 * Nearly everywhere, inner must be non-null, however in places where
4615 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4617 LDKnativeChannelFeatures *inner;
4619 * Indicates that this is the only struct which contains the same pointer.
4620 * Rust functions which take ownership of an object provided via an argument require
4621 * this to be true and invalidate the object pointed to by inner.
4624 } LDKChannelFeatures;
4627 * The contents of CResult_ChannelFeaturesDecodeErrorZ
4629 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
4631 * A pointer to the contents in the success state.
4632 * Reading from this pointer when `result_ok` is not set is undefined.
4634 struct LDKChannelFeatures *result;
4636 * A pointer to the contents in the error state.
4637 * Reading from this pointer when `result_ok` is set is undefined.
4639 struct LDKDecodeError *err;
4640 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
4643 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
4644 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4645 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4647 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
4649 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
4650 * `err` or `result` depending on the state of `result_ok`.
4652 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
4654 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
4657 } LDKCResult_ChannelFeaturesDecodeErrorZ;
4662 * Features used within a `node_announcement` message.
4664 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
4666 * A pointer to the opaque Rust object.
4667 * Nearly everywhere, inner must be non-null, however in places where
4668 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4670 LDKnativeNodeFeatures *inner;
4672 * Indicates that this is the only struct which contains the same pointer.
4673 * Rust functions which take ownership of an object provided via an argument require
4674 * this to be true and invalidate the object pointed to by inner.
4680 * The contents of CResult_NodeFeaturesDecodeErrorZ
4682 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
4684 * A pointer to the contents in the success state.
4685 * Reading from this pointer when `result_ok` is not set is undefined.
4687 struct LDKNodeFeatures *result;
4689 * A pointer to the contents in the error state.
4690 * Reading from this pointer when `result_ok` is set is undefined.
4692 struct LDKDecodeError *err;
4693 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
4696 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
4697 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4698 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4700 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
4702 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
4703 * `err` or `result` depending on the state of `result_ok`.
4705 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
4707 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
4710 } LDKCResult_NodeFeaturesDecodeErrorZ;
4715 * Features used within an invoice.
4717 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
4719 * A pointer to the opaque Rust object.
4720 * Nearly everywhere, inner must be non-null, however in places where
4721 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4723 LDKnativeInvoiceFeatures *inner;
4725 * Indicates that this is the only struct which contains the same pointer.
4726 * Rust functions which take ownership of an object provided via an argument require
4727 * this to be true and invalidate the object pointed to by inner.
4730 } LDKInvoiceFeatures;
4733 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
4735 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
4737 * A pointer to the contents in the success state.
4738 * Reading from this pointer when `result_ok` is not set is undefined.
4740 struct LDKInvoiceFeatures *result;
4742 * A pointer to the contents in the error state.
4743 * Reading from this pointer when `result_ok` is set is undefined.
4745 struct LDKDecodeError *err;
4746 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
4749 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
4750 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4751 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4753 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
4755 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
4756 * `err` or `result` depending on the state of `result_ok`.
4758 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
4760 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
4763 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
4766 * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
4768 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
4770 * A pointer to the contents in the success state.
4771 * Reading from this pointer when `result_ok` is not set is undefined.
4773 struct LDKChannelTypeFeatures *result;
4775 * A pointer to the contents in the error state.
4776 * Reading from this pointer when `result_ok` is set is undefined.
4778 struct LDKDecodeError *err;
4779 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
4782 * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
4783 * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4784 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4786 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
4788 * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
4789 * `err` or `result` depending on the state of `result_ok`.
4791 union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
4793 * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
4796 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
4801 * Represents the compressed public key of a node
4803 typedef struct MUST_USE_STRUCT LDKNodeId {
4805 * A pointer to the opaque Rust object.
4806 * Nearly everywhere, inner must be non-null, however in places where
4807 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4809 LDKnativeNodeId *inner;
4811 * Indicates that this is the only struct which contains the same pointer.
4812 * Rust functions which take ownership of an object provided via an argument require
4813 * this to be true and invalidate the object pointed to by inner.
4819 * The contents of CResult_NodeIdDecodeErrorZ
4821 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
4823 * A pointer to the contents in the success state.
4824 * Reading from this pointer when `result_ok` is not set is undefined.
4826 struct LDKNodeId *result;
4828 * A pointer to the contents in the error state.
4829 * Reading from this pointer when `result_ok` is set is undefined.
4831 struct LDKDecodeError *err;
4832 } LDKCResult_NodeIdDecodeErrorZPtr;
4835 * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
4836 * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
4837 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4839 typedef struct LDKCResult_NodeIdDecodeErrorZ {
4841 * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
4842 * `err` or `result` depending on the state of `result_ok`.
4844 union LDKCResult_NodeIdDecodeErrorZPtr contents;
4846 * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
4849 } LDKCResult_NodeIdDecodeErrorZ;
4852 * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
4854 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
4856 * A pointer to the contents in the success state.
4857 * Reading from this pointer when `result_ok` is not set is undefined.
4859 struct LDKCOption_NetworkUpdateZ *result;
4861 * A pointer to the contents in the error state.
4862 * Reading from this pointer when `result_ok` is set is undefined.
4864 struct LDKDecodeError *err;
4865 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
4868 * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
4869 * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
4870 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4872 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
4874 * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
4875 * `err` or `result` depending on the state of `result_ok`.
4877 union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
4879 * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
4882 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
4885 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
4888 typedef struct LDKAccess {
4890 * An opaque pointer which is passed to your function implementations as an argument.
4891 * This has no meaning in the LDK, and can be NULL or any other value.
4895 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
4896 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
4899 * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
4901 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
4903 * Frees any resources associated with this object given its this_arg pointer.
4904 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4906 void (*free)(void *this_arg);
4910 * An enum which can either contain a crate::lightning::chain::Access or not
4912 typedef enum LDKCOption_AccessZ_Tag {
4914 * When we're in this state, this COption_AccessZ contains a crate::lightning::chain::Access
4916 LDKCOption_AccessZ_Some,
4918 * When we're in this state, this COption_AccessZ contains nothing
4920 LDKCOption_AccessZ_None,
4922 * Must be last for serialization purposes
4924 LDKCOption_AccessZ_Sentinel,
4925 } LDKCOption_AccessZ_Tag;
4927 typedef struct LDKCOption_AccessZ {
4928 LDKCOption_AccessZ_Tag tag;
4931 struct LDKAccess some;
4934 } LDKCOption_AccessZ;
4937 * The contents of CResult_boolLightningErrorZ
4939 typedef union LDKCResult_boolLightningErrorZPtr {
4941 * A pointer to the contents in the success state.
4942 * Reading from this pointer when `result_ok` is not set is undefined.
4946 * A pointer to the contents in the error state.
4947 * Reading from this pointer when `result_ok` is set is undefined.
4949 struct LDKLightningError *err;
4950 } LDKCResult_boolLightningErrorZPtr;
4953 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
4954 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
4955 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4957 typedef struct LDKCResult_boolLightningErrorZ {
4959 * The contents of this CResult_boolLightningErrorZ, accessible via either
4960 * `err` or `result` depending on the state of `result_ok`.
4962 union LDKCResult_boolLightningErrorZPtr contents;
4964 * Whether this CResult_boolLightningErrorZ represents a success state.
4967 } LDKCResult_boolLightningErrorZ;
4970 * A tuple of 3 elements. See the individual fields for the types contained.
4972 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
4974 * The element at position 0
4976 struct LDKChannelAnnouncement a;
4978 * The element at position 1
4980 struct LDKChannelUpdate b;
4982 * The element at position 2
4984 struct LDKChannelUpdate c;
4985 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
4988 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
4989 * This corresponds to std::vector in C++
4991 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
4993 * The elements in the array.
4994 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4996 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
4998 * The number of elements pointed to by `data`.
5001 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
5004 * A dynamically-allocated array of crate::lightning::ln::msgs::NodeAnnouncements of arbitrary size.
5005 * This corresponds to std::vector in C++
5007 typedef struct LDKCVec_NodeAnnouncementZ {
5009 * The elements in the array.
5010 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5012 struct LDKNodeAnnouncement *data;
5014 * The number of elements pointed to by `data`.
5017 } LDKCVec_NodeAnnouncementZ;
5020 * The contents of CResult_NoneLightningErrorZ
5022 typedef union LDKCResult_NoneLightningErrorZPtr {
5024 * Note that this value is always NULL, as there are no contents in the OK variant
5028 * A pointer to the contents in the error state.
5029 * Reading from this pointer when `result_ok` is set is undefined.
5031 struct LDKLightningError *err;
5032 } LDKCResult_NoneLightningErrorZPtr;
5035 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
5036 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
5037 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5039 typedef struct LDKCResult_NoneLightningErrorZ {
5041 * The contents of this CResult_NoneLightningErrorZ, accessible via either
5042 * `err` or `result` depending on the state of `result_ok`.
5044 union LDKCResult_NoneLightningErrorZPtr contents;
5046 * Whether this CResult_NoneLightningErrorZ represents a success state.
5049 } LDKCResult_NoneLightningErrorZ;
5054 * Details about one direction of a channel as received within a [`ChannelUpdate`].
5056 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
5058 * A pointer to the opaque Rust object.
5059 * Nearly everywhere, inner must be non-null, however in places where
5060 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5062 LDKnativeChannelUpdateInfo *inner;
5064 * Indicates that this is the only struct which contains the same pointer.
5065 * Rust functions which take ownership of an object provided via an argument require
5066 * this to be true and invalidate the object pointed to by inner.
5069 } LDKChannelUpdateInfo;
5072 * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
5074 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
5076 * A pointer to the contents in the success state.
5077 * Reading from this pointer when `result_ok` is not set is undefined.
5079 struct LDKChannelUpdateInfo *result;
5081 * A pointer to the contents in the error state.
5082 * Reading from this pointer when `result_ok` is set is undefined.
5084 struct LDKDecodeError *err;
5085 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
5088 * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
5089 * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5090 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5092 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
5094 * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
5095 * `err` or `result` depending on the state of `result_ok`.
5097 union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
5099 * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
5102 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
5107 * Details about a channel (both directions).
5108 * Received within a channel announcement.
5110 typedef struct MUST_USE_STRUCT LDKChannelInfo {
5112 * A pointer to the opaque Rust object.
5113 * Nearly everywhere, inner must be non-null, however in places where
5114 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5116 LDKnativeChannelInfo *inner;
5118 * Indicates that this is the only struct which contains the same pointer.
5119 * Rust functions which take ownership of an object provided via an argument require
5120 * this to be true and invalidate the object pointed to by inner.
5126 * The contents of CResult_ChannelInfoDecodeErrorZ
5128 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
5130 * A pointer to the contents in the success state.
5131 * Reading from this pointer when `result_ok` is not set is undefined.
5133 struct LDKChannelInfo *result;
5135 * A pointer to the contents in the error state.
5136 * Reading from this pointer when `result_ok` is set is undefined.
5138 struct LDKDecodeError *err;
5139 } LDKCResult_ChannelInfoDecodeErrorZPtr;
5142 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
5143 * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5144 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5146 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
5148 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
5149 * `err` or `result` depending on the state of `result_ok`.
5151 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
5153 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
5156 } LDKCResult_ChannelInfoDecodeErrorZ;
5161 * Fees for routing via a given channel or a node
5163 typedef struct MUST_USE_STRUCT LDKRoutingFees {
5165 * A pointer to the opaque Rust object.
5166 * Nearly everywhere, inner must be non-null, however in places where
5167 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5169 LDKnativeRoutingFees *inner;
5171 * Indicates that this is the only struct which contains the same pointer.
5172 * Rust functions which take ownership of an object provided via an argument require
5173 * this to be true and invalidate the object pointed to by inner.
5179 * The contents of CResult_RoutingFeesDecodeErrorZ
5181 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
5183 * A pointer to the contents in the success state.
5184 * Reading from this pointer when `result_ok` is not set is undefined.
5186 struct LDKRoutingFees *result;
5188 * A pointer to the contents in the error state.
5189 * Reading from this pointer when `result_ok` is set is undefined.
5191 struct LDKDecodeError *err;
5192 } LDKCResult_RoutingFeesDecodeErrorZPtr;
5195 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
5196 * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
5197 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5199 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
5201 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
5202 * `err` or `result` depending on the state of `result_ok`.
5204 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
5206 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
5209 } LDKCResult_RoutingFeesDecodeErrorZ;
5212 * A 4-byte byte array.
5214 typedef struct LDKFourBytes {
5222 * A 16-byte byte array.
5224 typedef struct LDKSixteenBytes {
5232 * A 12-byte byte array.
5234 typedef struct LDKTwelveBytes {
5242 * An address which can be used to connect to a remote peer
5244 typedef enum LDKNetAddress_Tag {
5246 * An IPv4 address/port on which the peer is listening.
5250 * An IPv6 address/port on which the peer is listening.
5254 * An old-style Tor onion address/port on which the peer is listening.
5256 * This field is deprecated and the Tor network generally no longer supports V2 Onion
5257 * addresses. Thus, the details are not parsed here.
5259 LDKNetAddress_OnionV2,
5261 * A new-style Tor onion address/port on which the peer is listening.
5262 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
5263 * wrap as base32 and append \".onion\".
5265 LDKNetAddress_OnionV3,
5267 * Must be last for serialization purposes
5269 LDKNetAddress_Sentinel,
5270 } LDKNetAddress_Tag;
5272 typedef struct LDKNetAddress_LDKIPv4_Body {
5274 * The 4-byte IPv4 address
5276 struct LDKFourBytes addr;
5278 * The port on which the node is listening
5281 } LDKNetAddress_LDKIPv4_Body;
5283 typedef struct LDKNetAddress_LDKIPv6_Body {
5285 * The 16-byte IPv6 address
5287 struct LDKSixteenBytes addr;
5289 * The port on which the node is listening
5292 } LDKNetAddress_LDKIPv6_Body;
5294 typedef struct LDKNetAddress_LDKOnionV3_Body {
5296 * The ed25519 long-term public key of the peer
5298 struct LDKThirtyTwoBytes ed25519_pubkey;
5300 * The checksum of the pubkey and version, as included in the onion address
5304 * The version byte, as defined by the Tor Onion v3 spec.
5308 * The port on which the node is listening
5311 } LDKNetAddress_LDKOnionV3_Body;
5313 typedef struct MUST_USE_STRUCT LDKNetAddress {
5314 LDKNetAddress_Tag tag;
5316 LDKNetAddress_LDKIPv4_Body i_pv4;
5317 LDKNetAddress_LDKIPv6_Body i_pv6;
5319 struct LDKTwelveBytes onion_v2;
5321 LDKNetAddress_LDKOnionV3_Body onion_v3;
5326 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
5327 * This corresponds to std::vector in C++
5329 typedef struct LDKCVec_NetAddressZ {
5331 * The elements in the array.
5332 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5334 struct LDKNetAddress *data;
5336 * The number of elements pointed to by `data`.
5339 } LDKCVec_NetAddressZ;
5344 * Information received in the latest node_announcement from this node.
5346 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
5348 * A pointer to the opaque Rust object.
5349 * Nearly everywhere, inner must be non-null, however in places where
5350 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5352 LDKnativeNodeAnnouncementInfo *inner;
5354 * Indicates that this is the only struct which contains the same pointer.
5355 * Rust functions which take ownership of an object provided via an argument require
5356 * this to be true and invalidate the object pointed to by inner.
5359 } LDKNodeAnnouncementInfo;
5362 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
5364 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
5366 * A pointer to the contents in the success state.
5367 * Reading from this pointer when `result_ok` is not set is undefined.
5369 struct LDKNodeAnnouncementInfo *result;
5371 * A pointer to the contents in the error state.
5372 * Reading from this pointer when `result_ok` is set is undefined.
5374 struct LDKDecodeError *err;
5375 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
5378 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
5379 * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5380 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5382 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
5384 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
5385 * `err` or `result` depending on the state of `result_ok`.
5387 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
5389 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
5392 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
5395 * A dynamically-allocated array of u64s of arbitrary size.
5396 * This corresponds to std::vector in C++
5398 typedef struct LDKCVec_u64Z {
5400 * The elements in the array.
5401 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5405 * The number of elements pointed to by `data`.
5413 * Details about a node in the network, known from the network announcement.
5415 typedef struct MUST_USE_STRUCT LDKNodeInfo {
5417 * A pointer to the opaque Rust object.
5418 * Nearly everywhere, inner must be non-null, however in places where
5419 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5421 LDKnativeNodeInfo *inner;
5423 * Indicates that this is the only struct which contains the same pointer.
5424 * Rust functions which take ownership of an object provided via an argument require
5425 * this to be true and invalidate the object pointed to by inner.
5431 * The contents of CResult_NodeInfoDecodeErrorZ
5433 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
5435 * A pointer to the contents in the success state.
5436 * Reading from this pointer when `result_ok` is not set is undefined.
5438 struct LDKNodeInfo *result;
5440 * A pointer to the contents in the error state.
5441 * Reading from this pointer when `result_ok` is set is undefined.
5443 struct LDKDecodeError *err;
5444 } LDKCResult_NodeInfoDecodeErrorZPtr;
5447 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
5448 * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5449 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5451 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
5453 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
5454 * `err` or `result` depending on the state of `result_ok`.
5456 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
5458 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
5461 } LDKCResult_NodeInfoDecodeErrorZ;
5464 * The contents of CResult_NetworkGraphDecodeErrorZ
5466 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
5468 * A pointer to the contents in the success state.
5469 * Reading from this pointer when `result_ok` is not set is undefined.
5471 struct LDKNetworkGraph *result;
5473 * A pointer to the contents in the error state.
5474 * Reading from this pointer when `result_ok` is set is undefined.
5476 struct LDKDecodeError *err;
5477 } LDKCResult_NetworkGraphDecodeErrorZPtr;
5480 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
5481 * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
5482 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5484 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
5486 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
5487 * `err` or `result` depending on the state of `result_ok`.
5489 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
5491 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
5494 } LDKCResult_NetworkGraphDecodeErrorZ;
5497 * An enum which can either contain a crate::c_types::derived::CVec_NetAddressZ or not
5499 typedef enum LDKCOption_CVec_NetAddressZZ_Tag {
5501 * When we're in this state, this COption_CVec_NetAddressZZ contains a crate::c_types::derived::CVec_NetAddressZ
5503 LDKCOption_CVec_NetAddressZZ_Some,
5505 * When we're in this state, this COption_CVec_NetAddressZZ contains nothing
5507 LDKCOption_CVec_NetAddressZZ_None,
5509 * Must be last for serialization purposes
5511 LDKCOption_CVec_NetAddressZZ_Sentinel,
5512 } LDKCOption_CVec_NetAddressZZ_Tag;
5514 typedef struct LDKCOption_CVec_NetAddressZZ {
5515 LDKCOption_CVec_NetAddressZZ_Tag tag;
5518 struct LDKCVec_NetAddressZ some;
5521 } LDKCOption_CVec_NetAddressZZ;
5524 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
5526 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
5528 * A pointer to the contents in the success state.
5529 * Reading from this pointer when `result_ok` is not set is undefined.
5531 struct LDKDelayedPaymentOutputDescriptor *result;
5533 * A pointer to the contents in the error state.
5534 * Reading from this pointer when `result_ok` is set is undefined.
5536 struct LDKDecodeError *err;
5537 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
5540 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
5541 * containing a crate::lightning::chain::keysinterface::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
5542 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5544 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
5546 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
5547 * `err` or `result` depending on the state of `result_ok`.
5549 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
5551 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
5554 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
5557 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
5559 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
5561 * A pointer to the contents in the success state.
5562 * Reading from this pointer when `result_ok` is not set is undefined.
5564 struct LDKStaticPaymentOutputDescriptor *result;
5566 * A pointer to the contents in the error state.
5567 * Reading from this pointer when `result_ok` is set is undefined.
5569 struct LDKDecodeError *err;
5570 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
5573 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
5574 * containing a crate::lightning::chain::keysinterface::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
5575 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5577 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
5579 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
5580 * `err` or `result` depending on the state of `result_ok`.
5582 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
5584 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
5587 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
5590 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
5592 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
5594 * A pointer to the contents in the success state.
5595 * Reading from this pointer when `result_ok` is not set is undefined.
5597 struct LDKSpendableOutputDescriptor *result;
5599 * A pointer to the contents in the error state.
5600 * Reading from this pointer when `result_ok` is set is undefined.
5602 struct LDKDecodeError *err;
5603 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
5606 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
5607 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
5608 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5610 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
5612 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
5613 * `err` or `result` depending on the state of `result_ok`.
5615 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
5617 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
5620 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
5623 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
5624 * This corresponds to std::vector in C++
5626 typedef struct LDKCVec_PaymentPreimageZ {
5628 * The elements in the array.
5629 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5631 struct LDKThirtyTwoBytes *data;
5633 * The number of elements pointed to by `data`.
5636 } LDKCVec_PaymentPreimageZ;
5639 * A tuple of 2 elements. See the individual fields for the types contained.
5641 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
5643 * The element at position 0
5645 struct LDKSignature a;
5647 * The element at position 1
5649 struct LDKCVec_SignatureZ b;
5650 } LDKC2Tuple_SignatureCVec_SignatureZZ;
5653 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
5655 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
5657 * A pointer to the contents in the success state.
5658 * Reading from this pointer when `result_ok` is not set is undefined.
5660 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
5662 * Note that this value is always NULL, as there are no contents in the Err variant
5665 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
5668 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
5669 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
5670 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5672 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
5674 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
5675 * `err` or `result` depending on the state of `result_ok`.
5677 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
5679 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
5682 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
5685 * The contents of CResult_SignatureNoneZ
5687 typedef union LDKCResult_SignatureNoneZPtr {
5689 * A pointer to the contents in the success state.
5690 * Reading from this pointer when `result_ok` is not set is undefined.
5692 struct LDKSignature *result;
5694 * Note that this value is always NULL, as there are no contents in the Err variant
5697 } LDKCResult_SignatureNoneZPtr;
5700 * A CResult_SignatureNoneZ represents the result of a fallible operation,
5701 * containing a crate::c_types::Signature on success and a () on failure.
5702 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5704 typedef struct LDKCResult_SignatureNoneZ {
5706 * The contents of this CResult_SignatureNoneZ, accessible via either
5707 * `err` or `result` depending on the state of `result_ok`.
5709 union LDKCResult_SignatureNoneZPtr contents;
5711 * Whether this CResult_SignatureNoneZ represents a success state.
5714 } LDKCResult_SignatureNoneZ;
5717 * A tuple of 2 elements. See the individual fields for the types contained.
5719 typedef struct LDKC2Tuple_SignatureSignatureZ {
5721 * The element at position 0
5723 struct LDKSignature a;
5725 * The element at position 1
5727 struct LDKSignature b;
5728 } LDKC2Tuple_SignatureSignatureZ;
5731 * The contents of CResult_C2Tuple_SignatureSignatureZNoneZ
5733 typedef union LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr {
5735 * A pointer to the contents in the success state.
5736 * Reading from this pointer when `result_ok` is not set is undefined.
5738 struct LDKC2Tuple_SignatureSignatureZ *result;
5740 * Note that this value is always NULL, as there are no contents in the Err variant
5743 } LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr;
5746 * A CResult_C2Tuple_SignatureSignatureZNoneZ represents the result of a fallible operation,
5747 * containing a crate::c_types::derived::C2Tuple_SignatureSignatureZ on success and a () on failure.
5748 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5750 typedef struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ {
5752 * The contents of this CResult_C2Tuple_SignatureSignatureZNoneZ, accessible via either
5753 * `err` or `result` depending on the state of `result_ok`.
5755 union LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr contents;
5757 * Whether this CResult_C2Tuple_SignatureSignatureZNoneZ represents a success state.
5760 } LDKCResult_C2Tuple_SignatureSignatureZNoneZ;
5763 * The contents of CResult_SecretKeyNoneZ
5765 typedef union LDKCResult_SecretKeyNoneZPtr {
5767 * A pointer to the contents in the success state.
5768 * Reading from this pointer when `result_ok` is not set is undefined.
5770 struct LDKSecretKey *result;
5772 * Note that this value is always NULL, as there are no contents in the Err variant
5775 } LDKCResult_SecretKeyNoneZPtr;
5778 * A CResult_SecretKeyNoneZ represents the result of a fallible operation,
5779 * containing a crate::c_types::SecretKey on success and a () on failure.
5780 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5782 typedef struct LDKCResult_SecretKeyNoneZ {
5784 * The contents of this CResult_SecretKeyNoneZ, accessible via either
5785 * `err` or `result` depending on the state of `result_ok`.
5787 union LDKCResult_SecretKeyNoneZPtr contents;
5789 * Whether this CResult_SecretKeyNoneZ represents a success state.
5792 } LDKCResult_SecretKeyNoneZ;
5797 * This class tracks the per-transaction information needed to build a closing transaction and will
5798 * actually build it and sign.
5800 * This class can be used inside a signer implementation to generate a signature given the relevant
5803 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
5805 * A pointer to the opaque Rust object.
5806 * Nearly everywhere, inner must be non-null, however in places where
5807 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5809 LDKnativeClosingTransaction *inner;
5811 * Indicates that this is the only struct which contains the same pointer.
5812 * Rust functions which take ownership of an object provided via an argument require
5813 * this to be true and invalidate the object pointed to by inner.
5816 } LDKClosingTransaction;
5821 * The unsigned part of a channel_announcement
5823 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
5825 * A pointer to the opaque Rust object.
5826 * Nearly everywhere, inner must be non-null, however in places where
5827 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5829 LDKnativeUnsignedChannelAnnouncement *inner;
5831 * Indicates that this is the only struct which contains the same pointer.
5832 * Rust functions which take ownership of an object provided via an argument require
5833 * this to be true and invalidate the object pointed to by inner.
5836 } LDKUnsignedChannelAnnouncement;
5839 * A trait to sign lightning channel transactions as described in BOLT 3.
5841 * Signing services could be implemented on a hardware wallet. In this case,
5842 * the current Sign would be a front-end on top of a communication
5843 * channel connected to your secure device and lightning key material wouldn't
5844 * reside on a hot server. Nevertheless, a this deployment would still need
5845 * to trust the ChannelManager to avoid loss of funds as this latest component
5846 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
5848 * A more secure iteration would be to use hashlock (or payment points) to pair
5849 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
5850 * at the price of more state and computation on the hardware wallet side. In the future,
5851 * we are looking forward to design such interface.
5853 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
5854 * to act, as liveness and breach reply correctness are always going to be hard requirements
5855 * of LN security model, orthogonal of key management issues.
5857 typedef struct LDKBaseSign {
5859 * An opaque pointer which is passed to your function implementations as an argument.
5860 * This has no meaning in the LDK, and can be NULL or any other value.
5864 * Gets the per-commitment point for a specific commitment number
5866 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
5868 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
5870 * Gets the commitment secret for a specific commitment number as part of the revocation process
5872 * An external signer implementation should error here if the commitment was already signed
5873 * and should refuse to sign it in the future.
5875 * May be called more than once for the same index.
5877 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
5879 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
5881 * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
5883 * This is required in order for the signer to make sure that releasing a commitment
5884 * secret won't leave us without a broadcastable holder transaction.
5885 * Policy checks should be implemented in this function, including checking the amount
5886 * sent to us and checking the HTLCs.
5888 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
5889 * A validating signer should ensure that an HTLC output is removed only when the matching
5890 * preimage is provided, or when the value to holder is restored.
5892 * NOTE: all the relevant preimages will be provided, but there may also be additional
5893 * irrelevant or duplicate preimages.
5895 struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_PaymentPreimageZ preimages);
5897 * Gets the holder's channel public keys and basepoints
5899 struct LDKChannelPublicKeys pubkeys;
5901 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
5902 * Note that this takes a pointer to this object, not the this_ptr like other methods do
5903 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
5905 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
5907 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
5908 * some SpendableOutputDescriptor types. This should be sufficient to identify this
5909 * Sign object uniquely and lookup or re-derive its keys.
5911 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
5913 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
5915 * Note that if signing fails or is rejected, the channel will be force-closed.
5917 * Policy checks should be implemented in this function, including checking the amount
5918 * sent to us and checking the HTLCs.
5920 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
5921 * A validating signer should ensure that an HTLC output is removed only when the matching
5922 * preimage is provided, or when the value to holder is restored.
5924 * NOTE: all the relevant preimages will be provided, but there may also be additional
5925 * irrelevant or duplicate preimages.
5927 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_PaymentPreimageZ preimages);
5929 * Validate the counterparty's revocation.
5931 * This is required in order for the signer to make sure that the state has moved
5932 * forward and it is safe to sign the next counterparty commitment.
5934 struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
5936 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
5937 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
5938 * latest commitment_tx when we initiate a force-close.
5939 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
5940 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
5942 * This may be called multiple times for the same transaction.
5944 * An external signer implementation should check that the commitment has not been revoked.
5946 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
5948 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
5950 * Create a signature for the given input in a transaction spending an HTLC transaction output
5951 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
5953 * A justice transaction may claim multiple outputs at the same time if timelocks are
5954 * similar, but only a signature for the input at index `input` should be signed for here.
5955 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
5956 * to an upcoming timelock expiration.
5958 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
5960 * per_commitment_key is revocation secret which was provided by our counterparty when they
5961 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
5962 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
5965 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]);
5967 * Create a signature for the given input in a transaction spending a commitment transaction
5968 * HTLC output when our counterparty broadcasts an old state.
5970 * A justice transaction may claim multiple outputs at the same time if timelocks are
5971 * similar, but only a signature for the input at index `input` should be signed for here.
5972 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
5973 * to an upcoming timelock expiration.
5975 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
5977 * per_commitment_key is revocation secret which was provided by our counterparty when they
5978 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
5979 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
5982 * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script
5983 * (which is committed to in the BIP 143 signatures).
5985 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);
5987 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
5988 * transaction, either offered or received.
5990 * Such a transaction may claim multiples offered outputs at same time if we know the
5991 * preimage for each when we create it, but only the input at index `input` should be
5992 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
5993 * needed with regards to an upcoming timelock expiration.
5995 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
5998 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
6000 * Per_commitment_point is the dynamic point corresponding to the channel state
6001 * detected onchain. It has been generated by our counterparty and is used to derive
6002 * channel state keys, which are then included in the witness script and committed to in the
6003 * BIP 143 signature.
6005 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);
6007 * Create a signature for a (proposed) closing transaction.
6009 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
6010 * chosen to forgo their output as dust.
6012 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
6014 * Signs a channel announcement message with our funding key and our node secret key (aka
6015 * node_id or network_key), proving it comes from one of the channel participants.
6017 * The first returned signature should be from our node secret key, the second from our
6020 * Note that if this fails or is rejected, the channel will not be publicly announced and
6021 * our counterparty may (though likely will not) close the channel on us for violating the
6024 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
6026 * Set the counterparty static channel data, including basepoints,
6027 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
6028 * This is done as soon as the funding outpoint is known. Since these are static channel data,
6029 * they MUST NOT be allowed to change to different values once set.
6031 * channel_parameters.is_populated() MUST be true.
6033 * We bind holder_selected_contest_delay late here for API convenience.
6035 * Will be called before any signatures are applied.
6037 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
6039 * Frees any resources associated with this object given its this_arg pointer.
6040 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6042 void (*free)(void *this_arg);
6046 * A cloneable signer.
6048 * Although we require signers to be cloneable, it may be useful for developers to be able to use
6049 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
6050 * which implies Sized, into this derived trait.
6052 typedef struct LDKSign {
6054 * An opaque pointer which is passed to your function implementations as an argument.
6055 * This has no meaning in the LDK, and can be NULL or any other value.
6059 * Implementation of BaseSign for this object.
6061 struct LDKBaseSign BaseSign;
6063 * Serialize the object into a byte array
6065 struct LDKCVec_u8Z (*write)(const void *this_arg);
6067 * Called, if set, after this Sign has been cloned into a duplicate object.
6068 * The new Sign is provided, and should be mutated as needed to perform a
6069 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
6071 void (*cloned)(struct LDKSign *NONNULL_PTR new_Sign);
6073 * Frees any resources associated with this object given its this_arg pointer.
6074 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6076 void (*free)(void *this_arg);
6080 * The contents of CResult_SignDecodeErrorZ
6082 typedef union LDKCResult_SignDecodeErrorZPtr {
6084 * A pointer to the contents in the success state.
6085 * Reading from this pointer when `result_ok` is not set is undefined.
6087 struct LDKSign *result;
6089 * A pointer to the contents in the error state.
6090 * Reading from this pointer when `result_ok` is set is undefined.
6092 struct LDKDecodeError *err;
6093 } LDKCResult_SignDecodeErrorZPtr;
6096 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
6097 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
6098 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6100 typedef struct LDKCResult_SignDecodeErrorZ {
6102 * The contents of this CResult_SignDecodeErrorZ, accessible via either
6103 * `err` or `result` depending on the state of `result_ok`.
6105 union LDKCResult_SignDecodeErrorZPtr contents;
6107 * Whether this CResult_SignDecodeErrorZ represents a success state.
6110 } LDKCResult_SignDecodeErrorZ;
6113 * Integer in the range `0..32`
6115 typedef struct LDKu5 {
6120 * A dynamically-allocated array of crate::c_types::u5s of arbitrary size.
6121 * This corresponds to std::vector in C++
6123 typedef struct LDKCVec_u5Z {
6125 * The elements in the array.
6126 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6130 * The number of elements pointed to by `data`.
6136 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
6137 * allows recovering the exact public key which created the signature given the message.
6139 typedef struct LDKRecoverableSignature {
6141 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
6144 uint8_t serialized_form[68];
6145 } LDKRecoverableSignature;
6148 * The contents of CResult_RecoverableSignatureNoneZ
6150 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
6152 * A pointer to the contents in the success state.
6153 * Reading from this pointer when `result_ok` is not set is undefined.
6155 struct LDKRecoverableSignature *result;
6157 * Note that this value is always NULL, as there are no contents in the Err variant
6160 } LDKCResult_RecoverableSignatureNoneZPtr;
6163 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
6164 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
6165 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6167 typedef struct LDKCResult_RecoverableSignatureNoneZ {
6169 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
6170 * `err` or `result` depending on the state of `result_ok`.
6172 union LDKCResult_RecoverableSignatureNoneZPtr contents;
6174 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
6177 } LDKCResult_RecoverableSignatureNoneZ;
6180 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
6181 * This corresponds to std::vector in C++
6183 typedef struct LDKCVec_CVec_u8ZZ {
6185 * The elements in the array.
6186 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6188 struct LDKCVec_u8Z *data;
6190 * The number of elements pointed to by `data`.
6193 } LDKCVec_CVec_u8ZZ;
6196 * The contents of CResult_CVec_CVec_u8ZZNoneZ
6198 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
6200 * A pointer to the contents in the success state.
6201 * Reading from this pointer when `result_ok` is not set is undefined.
6203 struct LDKCVec_CVec_u8ZZ *result;
6205 * Note that this value is always NULL, as there are no contents in the Err variant
6208 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
6211 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
6212 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
6213 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6215 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
6217 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
6218 * `err` or `result` depending on the state of `result_ok`.
6220 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
6222 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
6225 } LDKCResult_CVec_CVec_u8ZZNoneZ;
6230 * A simple implementation of Sign that just keeps the private keys in memory.
6232 * This implementation performs no policy checks and is insufficient by itself as
6233 * a secure external signer.
6235 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
6237 * A pointer to the opaque Rust object.
6238 * Nearly everywhere, inner must be non-null, however in places where
6239 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6241 LDKnativeInMemorySigner *inner;
6243 * Indicates that this is the only struct which contains the same pointer.
6244 * Rust functions which take ownership of an object provided via an argument require
6245 * this to be true and invalidate the object pointed to by inner.
6248 } LDKInMemorySigner;
6251 * The contents of CResult_InMemorySignerDecodeErrorZ
6253 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
6255 * A pointer to the contents in the success state.
6256 * Reading from this pointer when `result_ok` is not set is undefined.
6258 struct LDKInMemorySigner *result;
6260 * A pointer to the contents in the error state.
6261 * Reading from this pointer when `result_ok` is set is undefined.
6263 struct LDKDecodeError *err;
6264 } LDKCResult_InMemorySignerDecodeErrorZPtr;
6267 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
6268 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
6269 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6271 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
6273 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
6274 * `err` or `result` depending on the state of `result_ok`.
6276 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
6278 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
6281 } LDKCResult_InMemorySignerDecodeErrorZ;
6284 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
6285 * This corresponds to std::vector in C++
6287 typedef struct LDKCVec_TxOutZ {
6289 * The elements in the array.
6290 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6292 struct LDKTxOut *data;
6294 * The number of elements pointed to by `data`.
6300 * The contents of CResult_TransactionNoneZ
6302 typedef union LDKCResult_TransactionNoneZPtr {
6304 * A pointer to the contents in the success state.
6305 * Reading from this pointer when `result_ok` is not set is undefined.
6307 struct LDKTransaction *result;
6309 * Note that this value is always NULL, as there are no contents in the Err variant
6312 } LDKCResult_TransactionNoneZPtr;
6315 * A CResult_TransactionNoneZ represents the result of a fallible operation,
6316 * containing a crate::c_types::Transaction on success and a () on failure.
6317 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6319 typedef struct LDKCResult_TransactionNoneZ {
6321 * The contents of this CResult_TransactionNoneZ, accessible via either
6322 * `err` or `result` depending on the state of `result_ok`.
6324 union LDKCResult_TransactionNoneZPtr contents;
6326 * Whether this CResult_TransactionNoneZ represents a success state.
6329 } LDKCResult_TransactionNoneZ;
6334 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
6335 * on-chain transactions to ensure no loss of funds occurs.
6337 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
6338 * information and are actively monitoring the chain.
6340 * Pending Events or updated HTLCs which have not yet been read out by
6341 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
6342 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
6343 * gotten are fully handled before re-serializing the new state.
6345 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
6346 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
6347 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
6348 * returned block hash and the the current chain and then reconnecting blocks to get to the
6349 * best chain) upon deserializing the object!
6351 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
6353 * A pointer to the opaque Rust object.
6354 * Nearly everywhere, inner must be non-null, however in places where
6355 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6357 LDKnativeChannelMonitor *inner;
6359 * Indicates that this is the only struct which contains the same pointer.
6360 * Rust functions which take ownership of an object provided via an argument require
6361 * this to be true and invalidate the object pointed to by inner.
6364 } LDKChannelMonitor;
6367 * A tuple of 2 elements. See the individual fields for the types contained.
6369 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
6371 * The element at position 0
6373 struct LDKThirtyTwoBytes a;
6375 * The element at position 1
6377 struct LDKChannelMonitor b;
6378 } LDKC2Tuple_BlockHashChannelMonitorZ;
6381 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
6382 * This corresponds to std::vector in C++
6384 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
6386 * The elements in the array.
6387 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6389 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
6391 * The number of elements pointed to by `data`.
6394 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
6397 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
6399 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
6401 * A pointer to the contents in the success state.
6402 * Reading from this pointer when `result_ok` is not set is undefined.
6404 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
6406 * A pointer to the contents in the error state.
6407 * Reading from this pointer when `result_ok` is set is undefined.
6409 enum LDKIOError *err;
6410 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
6413 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
6414 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
6415 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6417 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
6419 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
6420 * `err` or `result` depending on the state of `result_ok`.
6422 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
6424 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
6427 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
6430 * An enum which can either contain a u16 or not
6432 typedef enum LDKCOption_u16Z_Tag {
6434 * When we're in this state, this COption_u16Z contains a u16
6436 LDKCOption_u16Z_Some,
6438 * When we're in this state, this COption_u16Z contains nothing
6440 LDKCOption_u16Z_None,
6442 * Must be last for serialization purposes
6444 LDKCOption_u16Z_Sentinel,
6445 } LDKCOption_u16Z_Tag;
6447 typedef struct LDKCOption_u16Z {
6448 LDKCOption_u16Z_Tag tag;
6457 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
6460 typedef enum LDKAPIError_Tag {
6462 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
6463 * are documented, but generally indicates some precondition of a function was violated.
6465 LDKAPIError_APIMisuseError,
6467 * Due to a high feerate, we were unable to complete the request.
6468 * For example, this may be returned if the feerate implies we cannot open a channel at the
6469 * requested value, but opening a larger channel would succeed.
6471 LDKAPIError_FeeRateTooHigh,
6473 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
6474 * too-many-hops, etc).
6476 LDKAPIError_RouteError,
6478 * We were unable to complete the request as the Channel required to do so is unable to
6479 * complete the request (or was not found). This can take many forms, including disconnected
6480 * peer, channel at capacity, channel shutting down, etc.
6482 LDKAPIError_ChannelUnavailable,
6484 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
6485 * attempted action to fail.
6487 LDKAPIError_MonitorUpdateFailed,
6489 * [`KeysInterface::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
6490 * with the channel counterparty as negotiated in [`InitFeatures`].
6492 * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
6493 * a channel or cooperatively close one with this peer (and will have to force-close instead).
6495 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
6496 * [`InitFeatures`]: crate::ln::features::InitFeatures
6498 LDKAPIError_IncompatibleShutdownScript,
6500 * Must be last for serialization purposes
6502 LDKAPIError_Sentinel,
6505 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
6507 * A human-readable error message
6510 } LDKAPIError_LDKAPIMisuseError_Body;
6512 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
6514 * A human-readable error message
6518 * The feerate which was too high.
6521 } LDKAPIError_LDKFeeRateTooHigh_Body;
6523 typedef struct LDKAPIError_LDKRouteError_Body {
6525 * A human-readable error message
6528 } LDKAPIError_LDKRouteError_Body;
6530 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
6532 * A human-readable error message
6535 } LDKAPIError_LDKChannelUnavailable_Body;
6537 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
6539 * The incompatible shutdown script.
6541 struct LDKShutdownScript script;
6542 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
6544 typedef struct MUST_USE_STRUCT LDKAPIError {
6545 LDKAPIError_Tag tag;
6547 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
6548 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
6549 LDKAPIError_LDKRouteError_Body route_error;
6550 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
6551 LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
6556 * The contents of CResult_NoneAPIErrorZ
6558 typedef union LDKCResult_NoneAPIErrorZPtr {
6560 * Note that this value is always NULL, as there are no contents in the OK variant
6564 * A pointer to the contents in the error state.
6565 * Reading from this pointer when `result_ok` is set is undefined.
6567 struct LDKAPIError *err;
6568 } LDKCResult_NoneAPIErrorZPtr;
6571 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
6572 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
6573 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6575 typedef struct LDKCResult_NoneAPIErrorZ {
6577 * The contents of this CResult_NoneAPIErrorZ, accessible via either
6578 * `err` or `result` depending on the state of `result_ok`.
6580 union LDKCResult_NoneAPIErrorZPtr contents;
6582 * Whether this CResult_NoneAPIErrorZ represents a success state.
6585 } LDKCResult_NoneAPIErrorZ;
6588 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
6589 * This corresponds to std::vector in C++
6591 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
6593 * The elements in the array.
6594 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6596 struct LDKCResult_NoneAPIErrorZ *data;
6598 * The number of elements pointed to by `data`.
6601 } LDKCVec_CResult_NoneAPIErrorZZ;
6604 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
6605 * This corresponds to std::vector in C++
6607 typedef struct LDKCVec_APIErrorZ {
6609 * The elements in the array.
6610 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6612 struct LDKAPIError *data;
6614 * The number of elements pointed to by `data`.
6617 } LDKCVec_APIErrorZ;
6620 * The contents of CResult__u832APIErrorZ
6622 typedef union LDKCResult__u832APIErrorZPtr {
6624 * A pointer to the contents in the success state.
6625 * Reading from this pointer when `result_ok` is not set is undefined.
6627 struct LDKThirtyTwoBytes *result;
6629 * A pointer to the contents in the error state.
6630 * Reading from this pointer when `result_ok` is set is undefined.
6632 struct LDKAPIError *err;
6633 } LDKCResult__u832APIErrorZPtr;
6636 * A CResult__u832APIErrorZ represents the result of a fallible operation,
6637 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
6638 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6640 typedef struct LDKCResult__u832APIErrorZ {
6642 * The contents of this CResult__u832APIErrorZ, accessible via either
6643 * `err` or `result` depending on the state of `result_ok`.
6645 union LDKCResult__u832APIErrorZPtr contents;
6647 * Whether this CResult__u832APIErrorZ represents a success state.
6650 } LDKCResult__u832APIErrorZ;
6653 * If a payment fails to send, it can be in one of several states. This enum is returned as the
6654 * Err() type describing which state the payment is in, see the description of individual enum
6657 typedef enum LDKPaymentSendFailure_Tag {
6659 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
6660 * send the payment at all. No channel state has been changed or messages sent to peers, and
6661 * once you've changed the parameter at error, you can freely retry the payment in full.
6663 LDKPaymentSendFailure_ParameterError,
6665 * A parameter in a single path which was passed to send_payment was invalid, preventing us
6666 * from attempting to send the payment at all. No channel state has been changed or messages
6667 * sent to peers, and once you've changed the parameter at error, you can freely retry the
6670 * The results here are ordered the same as the paths in the route object which was passed to
6673 LDKPaymentSendFailure_PathParameterError,
6675 * All paths which were attempted failed to send, with no channel state change taking place.
6676 * You can freely retry the payment in full (though you probably want to do so over different
6677 * paths than the ones selected).
6679 LDKPaymentSendFailure_AllFailedRetrySafe,
6681 * Some paths which were attempted failed to send, though possibly not all. At least some
6682 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
6683 * in over-/re-payment.
6685 * The results here are ordered the same as the paths in the route object which was passed to
6686 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
6687 * retried (though there is currently no API with which to do so).
6689 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
6690 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
6691 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
6692 * with the latest update_id.
6694 LDKPaymentSendFailure_PartialFailure,
6696 * Must be last for serialization purposes
6698 LDKPaymentSendFailure_Sentinel,
6699 } LDKPaymentSendFailure_Tag;
6701 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
6703 * The errors themselves, in the same order as the route hops.
6705 struct LDKCVec_CResult_NoneAPIErrorZZ results;
6707 * If some paths failed without irrevocably committing to the new HTLC(s), this will
6708 * contain a [`RouteParameters`] object which can be used to calculate a new route that
6709 * will pay all remaining unpaid balance.
6711 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
6713 struct LDKRouteParameters failed_paths_retry;
6715 * The payment id for the payment, which is now at least partially pending.
6717 struct LDKThirtyTwoBytes payment_id;
6718 } LDKPaymentSendFailure_LDKPartialFailure_Body;
6720 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
6721 LDKPaymentSendFailure_Tag tag;
6724 struct LDKAPIError parameter_error;
6727 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
6730 struct LDKCVec_APIErrorZ all_failed_retry_safe;
6732 LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
6734 } LDKPaymentSendFailure;
6737 * The contents of CResult_PaymentIdPaymentSendFailureZ
6739 typedef union LDKCResult_PaymentIdPaymentSendFailureZPtr {
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 LDKThirtyTwoBytes *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 LDKPaymentSendFailure *err;
6750 } LDKCResult_PaymentIdPaymentSendFailureZPtr;
6753 * A CResult_PaymentIdPaymentSendFailureZ represents the result of a fallible operation,
6754 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
6755 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6757 typedef struct LDKCResult_PaymentIdPaymentSendFailureZ {
6759 * The contents of this CResult_PaymentIdPaymentSendFailureZ, accessible via either
6760 * `err` or `result` depending on the state of `result_ok`.
6762 union LDKCResult_PaymentIdPaymentSendFailureZPtr contents;
6764 * Whether this CResult_PaymentIdPaymentSendFailureZ represents a success state.
6767 } LDKCResult_PaymentIdPaymentSendFailureZ;
6770 * The contents of CResult_NonePaymentSendFailureZ
6772 typedef union LDKCResult_NonePaymentSendFailureZPtr {
6774 * Note that this value is always NULL, as there are no contents in the OK variant
6778 * A pointer to the contents in the error state.
6779 * Reading from this pointer when `result_ok` is set is undefined.
6781 struct LDKPaymentSendFailure *err;
6782 } LDKCResult_NonePaymentSendFailureZPtr;
6785 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
6786 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
6787 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6789 typedef struct LDKCResult_NonePaymentSendFailureZ {
6791 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
6792 * `err` or `result` depending on the state of `result_ok`.
6794 union LDKCResult_NonePaymentSendFailureZPtr contents;
6796 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
6799 } LDKCResult_NonePaymentSendFailureZ;
6802 * A tuple of 2 elements. See the individual fields for the types contained.
6804 typedef struct LDKC2Tuple_PaymentHashPaymentIdZ {
6806 * The element at position 0
6808 struct LDKThirtyTwoBytes a;
6810 * The element at position 1
6812 struct LDKThirtyTwoBytes b;
6813 } LDKC2Tuple_PaymentHashPaymentIdZ;
6816 * The contents of CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ
6818 typedef union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr {
6820 * A pointer to the contents in the success state.
6821 * Reading from this pointer when `result_ok` is not set is undefined.
6823 struct LDKC2Tuple_PaymentHashPaymentIdZ *result;
6825 * A pointer to the contents in the error state.
6826 * Reading from this pointer when `result_ok` is set is undefined.
6828 struct LDKPaymentSendFailure *err;
6829 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr;
6832 * A CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents the result of a fallible operation,
6833 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentIdZ on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
6834 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6836 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ {
6838 * The contents of this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ, accessible via either
6839 * `err` or `result` depending on the state of `result_ok`.
6841 union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr contents;
6843 * Whether this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents a success state.
6846 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ;
6849 * A tuple of 2 elements. See the individual fields for the types contained.
6851 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
6853 * The element at position 0
6855 struct LDKThirtyTwoBytes a;
6857 * The element at position 1
6859 struct LDKThirtyTwoBytes b;
6860 } LDKC2Tuple_PaymentHashPaymentSecretZ;
6863 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ
6865 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
6867 * A pointer to the contents in the success state.
6868 * Reading from this pointer when `result_ok` is not set is undefined.
6870 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
6872 * Note that this value is always NULL, as there are no contents in the Err variant
6875 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr;
6878 * A CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents the result of a fallible operation,
6879 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a () on failure.
6880 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6882 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
6884 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ, accessible via either
6885 * `err` or `result` depending on the state of `result_ok`.
6887 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr contents;
6889 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents a success state.
6892 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ;
6895 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ
6897 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr {
6899 * A pointer to the contents in the success state.
6900 * Reading from this pointer when `result_ok` is not set is undefined.
6902 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
6904 * A pointer to the contents in the error state.
6905 * Reading from this pointer when `result_ok` is set is undefined.
6907 struct LDKAPIError *err;
6908 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr;
6911 * A CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents the result of a fallible operation,
6912 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a crate::lightning::util::errors::APIError on failure.
6913 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6915 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
6917 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ, accessible via either
6918 * `err` or `result` depending on the state of `result_ok`.
6920 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr contents;
6922 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents a success state.
6925 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ;
6928 * The contents of CResult_PaymentSecretNoneZ
6930 typedef union LDKCResult_PaymentSecretNoneZPtr {
6932 * A pointer to the contents in the success state.
6933 * Reading from this pointer when `result_ok` is not set is undefined.
6935 struct LDKThirtyTwoBytes *result;
6937 * Note that this value is always NULL, as there are no contents in the Err variant
6940 } LDKCResult_PaymentSecretNoneZPtr;
6943 * A CResult_PaymentSecretNoneZ represents the result of a fallible operation,
6944 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
6945 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6947 typedef struct LDKCResult_PaymentSecretNoneZ {
6949 * The contents of this CResult_PaymentSecretNoneZ, accessible via either
6950 * `err` or `result` depending on the state of `result_ok`.
6952 union LDKCResult_PaymentSecretNoneZPtr contents;
6954 * Whether this CResult_PaymentSecretNoneZ represents a success state.
6957 } LDKCResult_PaymentSecretNoneZ;
6960 * The contents of CResult_PaymentSecretAPIErrorZ
6962 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
6964 * A pointer to the contents in the success state.
6965 * Reading from this pointer when `result_ok` is not set is undefined.
6967 struct LDKThirtyTwoBytes *result;
6969 * A pointer to the contents in the error state.
6970 * Reading from this pointer when `result_ok` is set is undefined.
6972 struct LDKAPIError *err;
6973 } LDKCResult_PaymentSecretAPIErrorZPtr;
6976 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
6977 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
6978 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6980 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
6982 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
6983 * `err` or `result` depending on the state of `result_ok`.
6985 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
6987 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
6990 } LDKCResult_PaymentSecretAPIErrorZ;
6993 * The contents of CResult_PaymentPreimageAPIErrorZ
6995 typedef union LDKCResult_PaymentPreimageAPIErrorZPtr {
6997 * A pointer to the contents in the success state.
6998 * Reading from this pointer when `result_ok` is not set is undefined.
7000 struct LDKThirtyTwoBytes *result;
7002 * A pointer to the contents in the error state.
7003 * Reading from this pointer when `result_ok` is set is undefined.
7005 struct LDKAPIError *err;
7006 } LDKCResult_PaymentPreimageAPIErrorZPtr;
7009 * A CResult_PaymentPreimageAPIErrorZ represents the result of a fallible operation,
7010 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7011 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7013 typedef struct LDKCResult_PaymentPreimageAPIErrorZ {
7015 * The contents of this CResult_PaymentPreimageAPIErrorZ, accessible via either
7016 * `err` or `result` depending on the state of `result_ok`.
7018 union LDKCResult_PaymentPreimageAPIErrorZPtr contents;
7020 * Whether this CResult_PaymentPreimageAPIErrorZ represents a success state.
7023 } LDKCResult_PaymentPreimageAPIErrorZ;
7028 * Information needed for constructing an invoice route hint for this channel.
7030 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
7032 * A pointer to the opaque Rust object.
7033 * Nearly everywhere, inner must be non-null, however in places where
7034 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7036 LDKnativeCounterpartyForwardingInfo *inner;
7038 * Indicates that this is the only struct which contains the same pointer.
7039 * Rust functions which take ownership of an object provided via an argument require
7040 * this to be true and invalidate the object pointed to by inner.
7043 } LDKCounterpartyForwardingInfo;
7046 * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
7048 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
7050 * A pointer to the contents in the success state.
7051 * Reading from this pointer when `result_ok` is not set is undefined.
7053 struct LDKCounterpartyForwardingInfo *result;
7055 * A pointer to the contents in the error state.
7056 * Reading from this pointer when `result_ok` is set is undefined.
7058 struct LDKDecodeError *err;
7059 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
7062 * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
7063 * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7064 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7066 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
7068 * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
7069 * `err` or `result` depending on the state of `result_ok`.
7071 union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
7073 * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
7076 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
7081 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
7082 * to better separate parameters.
7084 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
7086 * A pointer to the opaque Rust object.
7087 * Nearly everywhere, inner must be non-null, however in places where
7088 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7090 LDKnativeChannelCounterparty *inner;
7092 * Indicates that this is the only struct which contains the same pointer.
7093 * Rust functions which take ownership of an object provided via an argument require
7094 * this to be true and invalidate the object pointed to by inner.
7097 } LDKChannelCounterparty;
7100 * The contents of CResult_ChannelCounterpartyDecodeErrorZ
7102 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
7104 * A pointer to the contents in the success state.
7105 * Reading from this pointer when `result_ok` is not set is undefined.
7107 struct LDKChannelCounterparty *result;
7109 * A pointer to the contents in the error state.
7110 * Reading from this pointer when `result_ok` is set is undefined.
7112 struct LDKDecodeError *err;
7113 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
7116 * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
7117 * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
7118 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7120 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
7122 * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
7123 * `err` or `result` depending on the state of `result_ok`.
7125 union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
7127 * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
7130 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
7133 * The contents of CResult_ChannelDetailsDecodeErrorZ
7135 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
7137 * A pointer to the contents in the success state.
7138 * Reading from this pointer when `result_ok` is not set is undefined.
7140 struct LDKChannelDetails *result;
7142 * A pointer to the contents in the error state.
7143 * Reading from this pointer when `result_ok` is set is undefined.
7145 struct LDKDecodeError *err;
7146 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
7149 * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
7150 * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
7151 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7153 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
7155 * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
7156 * `err` or `result` depending on the state of `result_ok`.
7158 union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
7160 * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
7163 } LDKCResult_ChannelDetailsDecodeErrorZ;
7168 * Route hints used in constructing invoices for [phantom node payents].
7170 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
7172 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
7174 * A pointer to the opaque Rust object.
7175 * Nearly everywhere, inner must be non-null, however in places where
7176 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7178 LDKnativePhantomRouteHints *inner;
7180 * Indicates that this is the only struct which contains the same pointer.
7181 * Rust functions which take ownership of an object provided via an argument require
7182 * this to be true and invalidate the object pointed to by inner.
7185 } LDKPhantomRouteHints;
7188 * The contents of CResult_PhantomRouteHintsDecodeErrorZ
7190 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
7192 * A pointer to the contents in the success state.
7193 * Reading from this pointer when `result_ok` is not set is undefined.
7195 struct LDKPhantomRouteHints *result;
7197 * A pointer to the contents in the error state.
7198 * Reading from this pointer when `result_ok` is set is undefined.
7200 struct LDKDecodeError *err;
7201 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
7204 * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
7205 * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
7206 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7208 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
7210 * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
7211 * `err` or `result` depending on the state of `result_ok`.
7213 union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
7215 * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
7218 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
7221 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
7222 * This corresponds to std::vector in C++
7224 typedef struct LDKCVec_ChannelMonitorZ {
7226 * The elements in the array.
7227 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7229 struct LDKChannelMonitor *data;
7231 * The number of elements pointed to by `data`.
7234 } LDKCVec_ChannelMonitorZ;
7239 * An update generated by the underlying Channel itself which contains some new information the
7240 * ChannelMonitor should be made aware of.
7242 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
7244 * A pointer to the opaque Rust object.
7245 * Nearly everywhere, inner must be non-null, however in places where
7246 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7248 LDKnativeChannelMonitorUpdate *inner;
7250 * Indicates that this is the only struct which contains the same pointer.
7251 * Rust functions which take ownership of an object provided via an argument require
7252 * this to be true and invalidate the object pointed to by inner.
7255 } LDKChannelMonitorUpdate;
7258 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
7259 * blocks are connected and disconnected.
7261 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
7262 * responsible for maintaining a set of monitors such that they can be updated accordingly as
7263 * channel state changes and HTLCs are resolved. See method documentation for specific
7266 * Implementations **must** ensure that updates are successfully applied and persisted upon method
7267 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
7268 * without taking any further action such as persisting the current state.
7270 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
7271 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
7272 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
7273 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
7274 * multiple instances.
7276 * [`PermanentFailure`]: ChannelMonitorUpdateErr::PermanentFailure
7278 typedef struct LDKWatch {
7280 * An opaque pointer which is passed to your function implementations as an argument.
7281 * This has no meaning in the LDK, and can be NULL or any other value.
7285 * Watches a channel identified by `funding_txo` using `monitor`.
7287 * Implementations are responsible for watching the chain for the funding transaction along
7288 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
7289 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
7291 * Note: this interface MUST error with `ChannelMonitorUpdateErr::PermanentFailure` if
7292 * the given `funding_txo` has previously been registered via `watch_channel`.
7294 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
7295 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
7296 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
7298 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
7300 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
7302 * Implementations must call [`update_monitor`] with the given update. See
7303 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
7305 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
7307 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
7309 * Returns any monitor events since the last call. Subsequent calls must only return new
7312 * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
7313 * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
7316 * For details on asynchronous [`ChannelMonitor`] updating and returning
7317 * [`MonitorEvent::UpdateCompleted`] here, see [`ChannelMonitorUpdateErr::TemporaryFailure`].
7319 struct LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ (*release_pending_monitor_events)(const void *this_arg);
7321 * Frees any resources associated with this object given its this_arg pointer.
7322 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7324 void (*free)(void *this_arg);
7328 * An interface to send a transaction to the Bitcoin network.
7330 typedef struct LDKBroadcasterInterface {
7332 * An opaque pointer which is passed to your function implementations as an argument.
7333 * This has no meaning in the LDK, and can be NULL or any other value.
7337 * Sends a transaction out to (hopefully) be mined.
7339 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
7341 * Frees any resources associated with this object given its this_arg pointer.
7342 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7344 void (*free)(void *this_arg);
7345 } LDKBroadcasterInterface;
7348 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
7349 * own the memory pointed to by data.
7351 typedef struct LDKu8slice {
7353 * A pointer to the byte buffer
7355 const uint8_t *data;
7357 * The number of bytes pointed to by `data`.
7363 * A trait to describe an object which can get user secrets and key material.
7365 typedef struct LDKKeysInterface {
7367 * An opaque pointer which is passed to your function implementations as an argument.
7368 * This has no meaning in the LDK, and can be NULL or any other value.
7372 * Get node secret key (aka node_id or network_key) based on the provided [`Recipient`].
7374 * This method must return the same value each time it is called with a given `Recipient`
7377 struct LDKCResult_SecretKeyNoneZ (*get_node_secret)(const void *this_arg, enum LDKRecipient recipient);
7379 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
7381 * This method should return a different value each time it is called, to avoid linking
7382 * on-chain funds across channels as controlled to the same user.
7384 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
7386 * Get a script pubkey which we will send funds to when closing a channel.
7388 * This method should return a different value each time it is called, to avoid linking
7389 * on-chain funds across channels as controlled to the same user.
7391 struct LDKShutdownScript (*get_shutdown_scriptpubkey)(const void *this_arg);
7393 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
7394 * restarted with some stale data!
7396 * This method must return a different value each time it is called.
7398 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
7400 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
7401 * onion packets and for temporary channel IDs. There is no requirement that these be
7402 * persisted anywhere, though they must be unique across restarts.
7404 * This method must return a different value each time it is called.
7406 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
7408 * Reads a `Signer` for this `KeysInterface` from the given input stream.
7409 * This is only called during deserialization of other objects which contain
7410 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
7411 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
7412 * contain no versioning scheme. You may wish to include your own version prefix and ensure
7413 * you've read all of the provided bytes to ensure no corruption occurred.
7415 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
7418 * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
7419 * this trait to parse the invoice and make sure they're signing what they expect, rather than
7420 * blindly signing the hash.
7421 * The hrp is ascii bytes, while the invoice data is base32.
7423 * The secret key used to sign the invoice is dependent on the [`Recipient`].
7425 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z invoice_data, enum LDKRecipient receipient);
7427 * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
7429 * If the implementor of this trait supports [phantom node payments], then every node that is
7430 * intended to be included in the phantom invoice route hints must return the same value from
7433 * This method must return the same value each time it is called.
7435 * [phantom node payments]: PhantomKeysManager
7437 struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
7439 * Frees any resources associated with this object given its this_arg pointer.
7440 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7442 void (*free)(void *this_arg);
7446 * A trait which should be implemented to provide feerate information on a number of time
7449 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
7450 * called from inside the library in response to chain events, P2P events, or timer events).
7452 typedef struct LDKFeeEstimator {
7454 * An opaque pointer which is passed to your function implementations as an argument.
7455 * This has no meaning in the LDK, and can be NULL or any other value.
7459 * Gets estimated satoshis of fee required per 1000 Weight-Units.
7461 * Must return a value no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later
7462 * round-downs don't put us below 1 satoshi-per-byte).
7464 * This method can be implemented with the following unit conversions:
7465 * * max(satoshis-per-byte * 250, 253)
7466 * * max(satoshis-per-kbyte / 4, 253)
7468 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
7470 * Frees any resources associated with this object given its this_arg pointer.
7471 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7473 void (*free)(void *this_arg);
7479 * Manager which keeps track of a number of channels and sends messages to the appropriate
7480 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
7482 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
7483 * to individual Channels.
7485 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
7486 * all peers during write/read (though does not modify this instance, only the instance being
7487 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
7488 * called funding_transaction_generated for outbound channels).
7490 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
7491 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
7492 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
7493 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
7494 * the serialization process). If the deserialized version is out-of-date compared to the
7495 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
7496 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
7498 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
7499 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
7500 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
7501 * block_connected() to step towards your best block) upon deserialization before using the
7504 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
7505 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
7506 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
7507 * offline for a full minute. In order to track this, you must call
7508 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
7510 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
7511 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
7512 * essentially you should default to using a SimpleRefChannelManager, and use a
7513 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
7514 * you're using lightning-net-tokio.
7516 typedef struct MUST_USE_STRUCT LDKChannelManager {
7518 * A pointer to the opaque Rust object.
7519 * Nearly everywhere, inner must be non-null, however in places where
7520 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7522 LDKnativeChannelManager *inner;
7524 * Indicates that this is the only struct which contains the same pointer.
7525 * Rust functions which take ownership of an object provided via an argument require
7526 * this to be true and invalidate the object pointed to by inner.
7529 } LDKChannelManager;
7532 * A tuple of 2 elements. See the individual fields for the types contained.
7534 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
7536 * The element at position 0
7538 struct LDKThirtyTwoBytes a;
7540 * The element at position 1
7542 struct LDKChannelManager b;
7543 } LDKC2Tuple_BlockHashChannelManagerZ;
7546 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
7548 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
7550 * A pointer to the contents in the success state.
7551 * Reading from this pointer when `result_ok` is not set is undefined.
7553 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
7555 * A pointer to the contents in the error state.
7556 * Reading from this pointer when `result_ok` is set is undefined.
7558 struct LDKDecodeError *err;
7559 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
7562 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
7563 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
7564 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7566 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
7568 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
7569 * `err` or `result` depending on the state of `result_ok`.
7571 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
7573 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
7576 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
7581 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
7582 * with our counterparty.
7584 typedef struct MUST_USE_STRUCT LDKChannelConfig {
7586 * A pointer to the opaque Rust object.
7587 * Nearly everywhere, inner must be non-null, however in places where
7588 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7590 LDKnativeChannelConfig *inner;
7592 * Indicates that this is the only struct which contains the same pointer.
7593 * Rust functions which take ownership of an object provided via an argument require
7594 * this to be true and invalidate the object pointed to by inner.
7600 * The contents of CResult_ChannelConfigDecodeErrorZ
7602 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
7604 * A pointer to the contents in the success state.
7605 * Reading from this pointer when `result_ok` is not set is undefined.
7607 struct LDKChannelConfig *result;
7609 * A pointer to the contents in the error state.
7610 * Reading from this pointer when `result_ok` is set is undefined.
7612 struct LDKDecodeError *err;
7613 } LDKCResult_ChannelConfigDecodeErrorZPtr;
7616 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
7617 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
7618 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7620 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
7622 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
7623 * `err` or `result` depending on the state of `result_ok`.
7625 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
7627 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
7630 } LDKCResult_ChannelConfigDecodeErrorZ;
7633 * The contents of CResult_OutPointDecodeErrorZ
7635 typedef union LDKCResult_OutPointDecodeErrorZPtr {
7637 * A pointer to the contents in the success state.
7638 * Reading from this pointer when `result_ok` is not set is undefined.
7640 struct LDKOutPoint *result;
7642 * A pointer to the contents in the error state.
7643 * Reading from this pointer when `result_ok` is set is undefined.
7645 struct LDKDecodeError *err;
7646 } LDKCResult_OutPointDecodeErrorZPtr;
7649 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
7650 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
7651 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7653 typedef struct LDKCResult_OutPointDecodeErrorZ {
7655 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
7656 * `err` or `result` depending on the state of `result_ok`.
7658 union LDKCResult_OutPointDecodeErrorZPtr contents;
7660 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
7663 } LDKCResult_OutPointDecodeErrorZ;
7666 * Defines a type identifier for sending messages over the wire.
7668 * Messages implementing this trait specify a type and must be [`Writeable`].
7670 typedef struct LDKType {
7672 * An opaque pointer which is passed to your function implementations as an argument.
7673 * This has no meaning in the LDK, and can be NULL or any other value.
7677 * Returns the type identifying the message payload.
7679 uint16_t (*type_id)(const void *this_arg);
7681 * Return a human-readable "debug" string describing this object
7683 struct LDKStr (*debug_str)(const void *this_arg);
7685 * Serialize the object into a byte array
7687 struct LDKCVec_u8Z (*write)(const void *this_arg);
7689 * Frees any resources associated with this object given its this_arg pointer.
7690 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7692 void (*free)(void *this_arg);
7696 * An enum which can either contain a crate::lightning::ln::wire::Type or not
7698 typedef enum LDKCOption_TypeZ_Tag {
7700 * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
7702 LDKCOption_TypeZ_Some,
7704 * When we're in this state, this COption_TypeZ contains nothing
7706 LDKCOption_TypeZ_None,
7708 * Must be last for serialization purposes
7710 LDKCOption_TypeZ_Sentinel,
7711 } LDKCOption_TypeZ_Tag;
7713 typedef struct LDKCOption_TypeZ {
7714 LDKCOption_TypeZ_Tag tag;
7717 struct LDKType some;
7723 * The contents of CResult_COption_TypeZDecodeErrorZ
7725 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
7727 * A pointer to the contents in the success state.
7728 * Reading from this pointer when `result_ok` is not set is undefined.
7730 struct LDKCOption_TypeZ *result;
7732 * A pointer to the contents in the error state.
7733 * Reading from this pointer when `result_ok` is set is undefined.
7735 struct LDKDecodeError *err;
7736 } LDKCResult_COption_TypeZDecodeErrorZPtr;
7739 * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
7740 * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
7741 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7743 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
7745 * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
7746 * `err` or `result` depending on the state of `result_ok`.
7748 union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
7750 * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
7753 } LDKCResult_COption_TypeZDecodeErrorZ;
7756 * An error that may occur when making a payment.
7758 typedef enum LDKPaymentError_Tag {
7760 * An error resulting from the provided [`Invoice`] or payment hash.
7762 LDKPaymentError_Invoice,
7764 * An error occurring when finding a route.
7766 LDKPaymentError_Routing,
7768 * An error occurring when sending a payment.
7770 LDKPaymentError_Sending,
7772 * Must be last for serialization purposes
7774 LDKPaymentError_Sentinel,
7775 } LDKPaymentError_Tag;
7777 typedef struct MUST_USE_STRUCT LDKPaymentError {
7778 LDKPaymentError_Tag tag;
7781 struct LDKStr invoice;
7784 struct LDKLightningError routing;
7787 struct LDKPaymentSendFailure sending;
7793 * The contents of CResult_PaymentIdPaymentErrorZ
7795 typedef union LDKCResult_PaymentIdPaymentErrorZPtr {
7797 * A pointer to the contents in the success state.
7798 * Reading from this pointer when `result_ok` is not set is undefined.
7800 struct LDKThirtyTwoBytes *result;
7802 * A pointer to the contents in the error state.
7803 * Reading from this pointer when `result_ok` is set is undefined.
7805 struct LDKPaymentError *err;
7806 } LDKCResult_PaymentIdPaymentErrorZPtr;
7809 * A CResult_PaymentIdPaymentErrorZ represents the result of a fallible operation,
7810 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning_invoice::payment::PaymentError on failure.
7811 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7813 typedef struct LDKCResult_PaymentIdPaymentErrorZ {
7815 * The contents of this CResult_PaymentIdPaymentErrorZ, accessible via either
7816 * `err` or `result` depending on the state of `result_ok`.
7818 union LDKCResult_PaymentIdPaymentErrorZPtr contents;
7820 * Whether this CResult_PaymentIdPaymentErrorZ represents a success state.
7823 } LDKCResult_PaymentIdPaymentErrorZ;
7826 * Sub-errors which don't have specific information in them use this type.
7828 typedef struct LDKError {
7830 * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
7836 * Errors that indicate what is wrong with the invoice. They have some granularity for debug
7837 * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
7839 typedef enum LDKParseError_Tag {
7840 LDKParseError_Bech32Error,
7841 LDKParseError_ParseAmountError,
7842 LDKParseError_MalformedSignature,
7843 LDKParseError_BadPrefix,
7844 LDKParseError_UnknownCurrency,
7845 LDKParseError_UnknownSiPrefix,
7846 LDKParseError_MalformedHRP,
7847 LDKParseError_TooShortDataPart,
7848 LDKParseError_UnexpectedEndOfTaggedFields,
7849 LDKParseError_DescriptionDecodeError,
7850 LDKParseError_PaddingError,
7851 LDKParseError_IntegerOverflowError,
7852 LDKParseError_InvalidSegWitProgramLength,
7853 LDKParseError_InvalidPubKeyHashLength,
7854 LDKParseError_InvalidScriptHashLength,
7855 LDKParseError_InvalidRecoveryId,
7856 LDKParseError_InvalidSliceLength,
7858 * Not an error, but used internally to signal that a part of the invoice should be ignored
7859 * according to BOLT11
7863 * Must be last for serialization purposes
7865 LDKParseError_Sentinel,
7866 } LDKParseError_Tag;
7868 typedef struct MUST_USE_STRUCT LDKParseError {
7869 LDKParseError_Tag tag;
7872 struct LDKBech32Error bech32_error;
7875 struct LDKError parse_amount_error;
7878 enum LDKSecp256k1Error malformed_signature;
7881 struct LDKError description_decode_error;
7884 struct LDKStr invalid_slice_length;
7890 * The contents of CResult_SiPrefixParseErrorZ
7892 typedef union LDKCResult_SiPrefixParseErrorZPtr {
7894 * A pointer to the contents in the success state.
7895 * Reading from this pointer when `result_ok` is not set is undefined.
7897 enum LDKSiPrefix *result;
7899 * A pointer to the contents in the error state.
7900 * Reading from this pointer when `result_ok` is set is undefined.
7902 struct LDKParseError *err;
7903 } LDKCResult_SiPrefixParseErrorZPtr;
7906 * A CResult_SiPrefixParseErrorZ represents the result of a fallible operation,
7907 * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::ParseError on failure.
7908 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7910 typedef struct LDKCResult_SiPrefixParseErrorZ {
7912 * The contents of this CResult_SiPrefixParseErrorZ, accessible via either
7913 * `err` or `result` depending on the state of `result_ok`.
7915 union LDKCResult_SiPrefixParseErrorZPtr contents;
7917 * Whether this CResult_SiPrefixParseErrorZ represents a success state.
7920 } LDKCResult_SiPrefixParseErrorZ;
7925 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
7927 * There are three ways to construct an `Invoice`:
7928 * 1. using `InvoiceBuilder`
7929 * 2. using `Invoice::from_signed(SignedRawInvoice)`
7930 * 3. using `str::parse::<Invoice>(&str)`
7932 typedef struct MUST_USE_STRUCT LDKInvoice {
7934 * A pointer to the opaque Rust object.
7935 * Nearly everywhere, inner must be non-null, however in places where
7936 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7938 LDKnativeInvoice *inner;
7940 * Indicates that this is the only struct which contains the same pointer.
7941 * Rust functions which take ownership of an object provided via an argument require
7942 * this to be true and invalidate the object pointed to by inner.
7948 * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
7949 * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
7950 * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
7952 typedef enum LDKParseOrSemanticError_Tag {
7954 * The invoice couldn't be decoded
7956 LDKParseOrSemanticError_ParseError,
7958 * The invoice could be decoded but violates the BOLT11 standard
7960 LDKParseOrSemanticError_SemanticError,
7962 * Must be last for serialization purposes
7964 LDKParseOrSemanticError_Sentinel,
7965 } LDKParseOrSemanticError_Tag;
7967 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
7968 LDKParseOrSemanticError_Tag tag;
7971 struct LDKParseError parse_error;
7974 enum LDKSemanticError semantic_error;
7977 } LDKParseOrSemanticError;
7980 * The contents of CResult_InvoiceParseOrSemanticErrorZ
7982 typedef union LDKCResult_InvoiceParseOrSemanticErrorZPtr {
7984 * A pointer to the contents in the success state.
7985 * Reading from this pointer when `result_ok` is not set is undefined.
7987 struct LDKInvoice *result;
7989 * A pointer to the contents in the error state.
7990 * Reading from this pointer when `result_ok` is set is undefined.
7992 struct LDKParseOrSemanticError *err;
7993 } LDKCResult_InvoiceParseOrSemanticErrorZPtr;
7996 * A CResult_InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
7997 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
7998 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8000 typedef struct LDKCResult_InvoiceParseOrSemanticErrorZ {
8002 * The contents of this CResult_InvoiceParseOrSemanticErrorZ, accessible via either
8003 * `err` or `result` depending on the state of `result_ok`.
8005 union LDKCResult_InvoiceParseOrSemanticErrorZPtr contents;
8007 * Whether this CResult_InvoiceParseOrSemanticErrorZ represents a success state.
8010 } LDKCResult_InvoiceParseOrSemanticErrorZ;
8015 * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
8019 * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
8021 typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
8023 * A pointer to the opaque Rust object.
8024 * Nearly everywhere, inner must be non-null, however in places where
8025 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8027 LDKnativeSignedRawInvoice *inner;
8029 * Indicates that this is the only struct which contains the same pointer.
8030 * Rust functions which take ownership of an object provided via an argument require
8031 * this to be true and invalidate the object pointed to by inner.
8034 } LDKSignedRawInvoice;
8037 * The contents of CResult_SignedRawInvoiceParseErrorZ
8039 typedef union LDKCResult_SignedRawInvoiceParseErrorZPtr {
8041 * A pointer to the contents in the success state.
8042 * Reading from this pointer when `result_ok` is not set is undefined.
8044 struct LDKSignedRawInvoice *result;
8046 * A pointer to the contents in the error state.
8047 * Reading from this pointer when `result_ok` is set is undefined.
8049 struct LDKParseError *err;
8050 } LDKCResult_SignedRawInvoiceParseErrorZPtr;
8053 * A CResult_SignedRawInvoiceParseErrorZ represents the result of a fallible operation,
8054 * containing a crate::lightning_invoice::SignedRawInvoice on success and a crate::lightning_invoice::ParseError on failure.
8055 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8057 typedef struct LDKCResult_SignedRawInvoiceParseErrorZ {
8059 * The contents of this CResult_SignedRawInvoiceParseErrorZ, accessible via either
8060 * `err` or `result` depending on the state of `result_ok`.
8062 union LDKCResult_SignedRawInvoiceParseErrorZPtr contents;
8064 * Whether this CResult_SignedRawInvoiceParseErrorZ represents a success state.
8067 } LDKCResult_SignedRawInvoiceParseErrorZ;
8072 * Represents an syntactically correct Invoice for a payment on the lightning network,
8073 * but without the signature information.
8074 * De- and encoding should not lead to information loss but may lead to different hashes.
8076 * For methods without docs see the corresponding methods in `Invoice`.
8078 typedef struct MUST_USE_STRUCT LDKRawInvoice {
8080 * A pointer to the opaque Rust object.
8081 * Nearly everywhere, inner must be non-null, however in places where
8082 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8084 LDKnativeRawInvoice *inner;
8086 * Indicates that this is the only struct which contains the same pointer.
8087 * Rust functions which take ownership of an object provided via an argument require
8088 * this to be true and invalidate the object pointed to by inner.
8096 * Recoverable signature
8098 typedef struct MUST_USE_STRUCT LDKInvoiceSignature {
8100 * A pointer to the opaque Rust object.
8101 * Nearly everywhere, inner must be non-null, however in places where
8102 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8104 LDKnativeInvoiceSignature *inner;
8106 * Indicates that this is the only struct which contains the same pointer.
8107 * Rust functions which take ownership of an object provided via an argument require
8108 * this to be true and invalidate the object pointed to by inner.
8111 } LDKInvoiceSignature;
8114 * A tuple of 3 elements. See the individual fields for the types contained.
8116 typedef struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ {
8118 * The element at position 0
8120 struct LDKRawInvoice a;
8122 * The element at position 1
8124 struct LDKThirtyTwoBytes b;
8126 * The element at position 2
8128 struct LDKInvoiceSignature c;
8129 } LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ;
8136 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
8138 * A pointer to the opaque Rust object.
8139 * Nearly everywhere, inner must be non-null, however in places where
8140 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8142 LDKnativePayeePubKey *inner;
8144 * Indicates that this is the only struct which contains the same pointer.
8145 * Rust functions which take ownership of an object provided via an argument require
8146 * this to be true and invalidate the object pointed to by inner.
8152 * The contents of CResult_PayeePubKeyErrorZ
8154 typedef union LDKCResult_PayeePubKeyErrorZPtr {
8156 * A pointer to the contents in the success state.
8157 * Reading from this pointer when `result_ok` is not set is undefined.
8159 struct LDKPayeePubKey *result;
8161 * A pointer to the contents in the error state.
8162 * Reading from this pointer when `result_ok` is set is undefined.
8164 enum LDKSecp256k1Error *err;
8165 } LDKCResult_PayeePubKeyErrorZPtr;
8168 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
8169 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
8170 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8172 typedef struct LDKCResult_PayeePubKeyErrorZ {
8174 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
8175 * `err` or `result` depending on the state of `result_ok`.
8177 union LDKCResult_PayeePubKeyErrorZPtr contents;
8179 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
8182 } LDKCResult_PayeePubKeyErrorZ;
8187 * Private routing information
8190 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
8193 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
8195 * A pointer to the opaque Rust object.
8196 * Nearly everywhere, inner must be non-null, however in places where
8197 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8199 LDKnativePrivateRoute *inner;
8201 * Indicates that this is the only struct which contains the same pointer.
8202 * Rust functions which take ownership of an object provided via an argument require
8203 * this to be true and invalidate the object pointed to by inner.
8209 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
8210 * This corresponds to std::vector in C++
8212 typedef struct LDKCVec_PrivateRouteZ {
8214 * The elements in the array.
8215 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8217 struct LDKPrivateRoute *data;
8219 * The number of elements pointed to by `data`.
8222 } LDKCVec_PrivateRouteZ;
8227 * A timestamp that refers to a date after 1 January 1970.
8231 * The Unix timestamp representing the stored time has to be positive and no greater than
8232 * [`MAX_TIMESTAMP`].
8234 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
8236 * A pointer to the opaque Rust object.
8237 * Nearly everywhere, inner must be non-null, however in places where
8238 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8240 LDKnativePositiveTimestamp *inner;
8242 * Indicates that this is the only struct which contains the same pointer.
8243 * Rust functions which take ownership of an object provided via an argument require
8244 * this to be true and invalidate the object pointed to by inner.
8247 } LDKPositiveTimestamp;
8250 * The contents of CResult_PositiveTimestampCreationErrorZ
8252 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
8254 * A pointer to the contents in the success state.
8255 * Reading from this pointer when `result_ok` is not set is undefined.
8257 struct LDKPositiveTimestamp *result;
8259 * A pointer to the contents in the error state.
8260 * Reading from this pointer when `result_ok` is set is undefined.
8262 enum LDKCreationError *err;
8263 } LDKCResult_PositiveTimestampCreationErrorZPtr;
8266 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
8267 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
8268 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8270 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
8272 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
8273 * `err` or `result` depending on the state of `result_ok`.
8275 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
8277 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
8280 } LDKCResult_PositiveTimestampCreationErrorZ;
8283 * The contents of CResult_NoneSemanticErrorZ
8285 typedef union LDKCResult_NoneSemanticErrorZPtr {
8287 * Note that this value is always NULL, as there are no contents in the OK variant
8291 * A pointer to the contents in the error state.
8292 * Reading from this pointer when `result_ok` is set is undefined.
8294 enum LDKSemanticError *err;
8295 } LDKCResult_NoneSemanticErrorZPtr;
8298 * A CResult_NoneSemanticErrorZ represents the result of a fallible operation,
8299 * containing a () on success and a crate::lightning_invoice::SemanticError on failure.
8300 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8302 typedef struct LDKCResult_NoneSemanticErrorZ {
8304 * The contents of this CResult_NoneSemanticErrorZ, accessible via either
8305 * `err` or `result` depending on the state of `result_ok`.
8307 union LDKCResult_NoneSemanticErrorZPtr contents;
8309 * Whether this CResult_NoneSemanticErrorZ represents a success state.
8312 } LDKCResult_NoneSemanticErrorZ;
8315 * The contents of CResult_InvoiceSemanticErrorZ
8317 typedef union LDKCResult_InvoiceSemanticErrorZPtr {
8319 * A pointer to the contents in the success state.
8320 * Reading from this pointer when `result_ok` is not set is undefined.
8322 struct LDKInvoice *result;
8324 * A pointer to the contents in the error state.
8325 * Reading from this pointer when `result_ok` is set is undefined.
8327 enum LDKSemanticError *err;
8328 } LDKCResult_InvoiceSemanticErrorZPtr;
8331 * A CResult_InvoiceSemanticErrorZ represents the result of a fallible operation,
8332 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SemanticError on failure.
8333 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8335 typedef struct LDKCResult_InvoiceSemanticErrorZ {
8337 * The contents of this CResult_InvoiceSemanticErrorZ, accessible via either
8338 * `err` or `result` depending on the state of `result_ok`.
8340 union LDKCResult_InvoiceSemanticErrorZPtr contents;
8342 * Whether this CResult_InvoiceSemanticErrorZ represents a success state.
8345 } LDKCResult_InvoiceSemanticErrorZ;
8350 * Description string
8353 * The description can be at most 639 __bytes__ long
8355 typedef struct MUST_USE_STRUCT LDKDescription {
8357 * A pointer to the opaque Rust object.
8358 * Nearly everywhere, inner must be non-null, however in places where
8359 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8361 LDKnativeDescription *inner;
8363 * Indicates that this is the only struct which contains the same pointer.
8364 * Rust functions which take ownership of an object provided via an argument require
8365 * this to be true and invalidate the object pointed to by inner.
8371 * The contents of CResult_DescriptionCreationErrorZ
8373 typedef union LDKCResult_DescriptionCreationErrorZPtr {
8375 * A pointer to the contents in the success state.
8376 * Reading from this pointer when `result_ok` is not set is undefined.
8378 struct LDKDescription *result;
8380 * A pointer to the contents in the error state.
8381 * Reading from this pointer when `result_ok` is set is undefined.
8383 enum LDKCreationError *err;
8384 } LDKCResult_DescriptionCreationErrorZPtr;
8387 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
8388 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
8389 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8391 typedef struct LDKCResult_DescriptionCreationErrorZ {
8393 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
8394 * `err` or `result` depending on the state of `result_ok`.
8396 union LDKCResult_DescriptionCreationErrorZPtr contents;
8398 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
8401 } LDKCResult_DescriptionCreationErrorZ;
8404 * The contents of CResult_PrivateRouteCreationErrorZ
8406 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
8408 * A pointer to the contents in the success state.
8409 * Reading from this pointer when `result_ok` is not set is undefined.
8411 struct LDKPrivateRoute *result;
8413 * A pointer to the contents in the error state.
8414 * Reading from this pointer when `result_ok` is set is undefined.
8416 enum LDKCreationError *err;
8417 } LDKCResult_PrivateRouteCreationErrorZPtr;
8420 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
8421 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
8422 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8424 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
8426 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
8427 * `err` or `result` depending on the state of `result_ok`.
8429 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
8431 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
8434 } LDKCResult_PrivateRouteCreationErrorZ;
8437 * The contents of CResult_StringErrorZ
8439 typedef union LDKCResult_StringErrorZPtr {
8441 * A pointer to the contents in the success state.
8442 * Reading from this pointer when `result_ok` is not set is undefined.
8444 struct LDKStr *result;
8446 * A pointer to the contents in the error state.
8447 * Reading from this pointer when `result_ok` is set is undefined.
8449 enum LDKSecp256k1Error *err;
8450 } LDKCResult_StringErrorZPtr;
8453 * A CResult_StringErrorZ represents the result of a fallible operation,
8454 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
8455 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8457 typedef struct LDKCResult_StringErrorZ {
8459 * The contents of this CResult_StringErrorZ, accessible via either
8460 * `err` or `result` depending on the state of `result_ok`.
8462 union LDKCResult_StringErrorZPtr contents;
8464 * Whether this CResult_StringErrorZ represents a success state.
8467 } LDKCResult_StringErrorZ;
8470 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
8472 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
8474 * A pointer to the contents in the success state.
8475 * Reading from this pointer when `result_ok` is not set is undefined.
8477 struct LDKChannelMonitorUpdate *result;
8479 * A pointer to the contents in the error state.
8480 * Reading from this pointer when `result_ok` is set is undefined.
8482 struct LDKDecodeError *err;
8483 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
8486 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
8487 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
8488 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8490 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
8492 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
8493 * `err` or `result` depending on the state of `result_ok`.
8495 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
8497 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
8500 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
8503 * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
8505 typedef enum LDKCOption_MonitorEventZ_Tag {
8507 * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
8509 LDKCOption_MonitorEventZ_Some,
8511 * When we're in this state, this COption_MonitorEventZ contains nothing
8513 LDKCOption_MonitorEventZ_None,
8515 * Must be last for serialization purposes
8517 LDKCOption_MonitorEventZ_Sentinel,
8518 } LDKCOption_MonitorEventZ_Tag;
8520 typedef struct LDKCOption_MonitorEventZ {
8521 LDKCOption_MonitorEventZ_Tag tag;
8524 struct LDKMonitorEvent some;
8527 } LDKCOption_MonitorEventZ;
8530 * The contents of CResult_COption_MonitorEventZDecodeErrorZ
8532 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
8534 * A pointer to the contents in the success state.
8535 * Reading from this pointer when `result_ok` is not set is undefined.
8537 struct LDKCOption_MonitorEventZ *result;
8539 * A pointer to the contents in the error state.
8540 * Reading from this pointer when `result_ok` is set is undefined.
8542 struct LDKDecodeError *err;
8543 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
8546 * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
8547 * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
8548 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8550 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
8552 * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
8553 * `err` or `result` depending on the state of `result_ok`.
8555 union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
8557 * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
8560 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
8563 * The contents of CResult_HTLCUpdateDecodeErrorZ
8565 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
8567 * A pointer to the contents in the success state.
8568 * Reading from this pointer when `result_ok` is not set is undefined.
8570 struct LDKHTLCUpdate *result;
8572 * A pointer to the contents in the error state.
8573 * Reading from this pointer when `result_ok` is set is undefined.
8575 struct LDKDecodeError *err;
8576 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
8579 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
8580 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
8581 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8583 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
8585 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
8586 * `err` or `result` depending on the state of `result_ok`.
8588 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
8590 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
8593 } LDKCResult_HTLCUpdateDecodeErrorZ;
8596 * A tuple of 2 elements. See the individual fields for the types contained.
8598 typedef struct LDKC2Tuple_OutPointScriptZ {
8600 * The element at position 0
8602 struct LDKOutPoint a;
8604 * The element at position 1
8606 struct LDKCVec_u8Z b;
8607 } LDKC2Tuple_OutPointScriptZ;
8610 * A tuple of 2 elements. See the individual fields for the types contained.
8612 typedef struct LDKC2Tuple_u32ScriptZ {
8614 * The element at position 0
8618 * The element at position 1
8620 struct LDKCVec_u8Z b;
8621 } LDKC2Tuple_u32ScriptZ;
8624 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
8625 * This corresponds to std::vector in C++
8627 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
8629 * The elements in the array.
8630 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8632 struct LDKC2Tuple_u32ScriptZ *data;
8634 * The number of elements pointed to by `data`.
8637 } LDKCVec_C2Tuple_u32ScriptZZ;
8640 * A tuple of 2 elements. See the individual fields for the types contained.
8642 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
8644 * The element at position 0
8646 struct LDKThirtyTwoBytes a;
8648 * The element at position 1
8650 struct LDKCVec_C2Tuple_u32ScriptZZ b;
8651 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
8654 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
8655 * This corresponds to std::vector in C++
8657 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
8659 * The elements in the array.
8660 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8662 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
8664 * The number of elements pointed to by `data`.
8667 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
8670 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
8671 * This corresponds to std::vector in C++
8673 typedef struct LDKCVec_EventZ {
8675 * The elements in the array.
8676 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8678 struct LDKEvent *data;
8680 * The number of elements pointed to by `data`.
8686 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
8687 * This corresponds to std::vector in C++
8689 typedef struct LDKCVec_TransactionZ {
8691 * The elements in the array.
8692 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8694 struct LDKTransaction *data;
8696 * The number of elements pointed to by `data`.
8699 } LDKCVec_TransactionZ;
8702 * A tuple of 2 elements. See the individual fields for the types contained.
8704 typedef struct LDKC2Tuple_u32TxOutZ {
8706 * The element at position 0
8710 * The element at position 1
8713 } LDKC2Tuple_u32TxOutZ;
8716 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
8717 * This corresponds to std::vector in C++
8719 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
8721 * The elements in the array.
8722 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8724 struct LDKC2Tuple_u32TxOutZ *data;
8726 * The number of elements pointed to by `data`.
8729 } LDKCVec_C2Tuple_u32TxOutZZ;
8732 * A tuple of 2 elements. See the individual fields for the types contained.
8734 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
8736 * The element at position 0
8738 struct LDKThirtyTwoBytes a;
8740 * The element at position 1
8742 struct LDKCVec_C2Tuple_u32TxOutZZ b;
8743 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
8746 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
8747 * This corresponds to std::vector in C++
8749 typedef struct LDKCVec_TransactionOutputsZ {
8751 * The elements in the array.
8752 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8754 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
8756 * The number of elements pointed to by `data`.
8759 } LDKCVec_TransactionOutputsZ;
8762 * Details about the balance(s) available for spending once the channel appears on chain.
8764 * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
8767 typedef enum LDKBalance_Tag {
8769 * The channel is not yet closed (or the commitment or closing transaction has not yet
8770 * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
8773 LDKBalance_ClaimableOnChannelClose,
8775 * The channel has been closed, and the given balance is ours but awaiting confirmations until
8776 * we consider it spendable.
8778 LDKBalance_ClaimableAwaitingConfirmations,
8780 * The channel has been closed, and the given balance should be ours but awaiting spending
8781 * transaction confirmation. If the spending transaction does not confirm in time, it is
8782 * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
8784 * Once the spending transaction confirms, before it has reached enough confirmations to be
8785 * considered safe from chain reorganizations, the balance will instead be provided via
8786 * [`Balance::ClaimableAwaitingConfirmations`].
8788 LDKBalance_ContentiousClaimable,
8790 * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
8791 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
8792 * likely to be claimed by our counterparty before we do.
8794 LDKBalance_MaybeClaimableHTLCAwaitingTimeout,
8796 * Must be last for serialization purposes
8798 LDKBalance_Sentinel,
8801 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
8803 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
8804 * required to do so.
8806 uint64_t claimable_amount_satoshis;
8807 } LDKBalance_LDKClaimableOnChannelClose_Body;
8809 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
8811 * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
8812 * were spent in broadcasting the transaction.
8814 uint64_t claimable_amount_satoshis;
8816 * The height at which an [`Event::SpendableOutputs`] event will be generated for this
8819 uint32_t confirmation_height;
8820 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
8822 typedef struct LDKBalance_LDKContentiousClaimable_Body {
8824 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
8825 * required to do so.
8827 uint64_t claimable_amount_satoshis;
8829 * The height at which the counterparty may be able to claim the balance if we have not
8832 uint32_t timeout_height;
8833 } LDKBalance_LDKContentiousClaimable_Body;
8835 typedef struct LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body {
8837 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
8838 * required to do so.
8840 uint64_t claimable_amount_satoshis;
8842 * The height at which we will be able to claim the balance if our counterparty has not
8845 uint32_t claimable_height;
8846 } LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body;
8848 typedef struct MUST_USE_STRUCT LDKBalance {
8851 LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
8852 LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
8853 LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
8854 LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body maybe_claimable_htlc_awaiting_timeout;
8859 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
8860 * This corresponds to std::vector in C++
8862 typedef struct LDKCVec_BalanceZ {
8864 * The elements in the array.
8865 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8867 struct LDKBalance *data;
8869 * The number of elements pointed to by `data`.
8875 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
8877 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
8879 * A pointer to the contents in the success state.
8880 * Reading from this pointer when `result_ok` is not set is undefined.
8882 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
8884 * A pointer to the contents in the error state.
8885 * Reading from this pointer when `result_ok` is set is undefined.
8887 struct LDKDecodeError *err;
8888 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
8891 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
8892 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
8893 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8895 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
8897 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
8898 * `err` or `result` depending on the state of `result_ok`.
8900 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
8902 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
8905 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
8908 * A tuple of 2 elements. See the individual fields for the types contained.
8910 typedef struct LDKC2Tuple_PublicKeyTypeZ {
8912 * The element at position 0
8914 struct LDKPublicKey a;
8916 * The element at position 1
8919 } LDKC2Tuple_PublicKeyTypeZ;
8922 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
8923 * This corresponds to std::vector in C++
8925 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
8927 * The elements in the array.
8928 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8930 struct LDKC2Tuple_PublicKeyTypeZ *data;
8932 * The number of elements pointed to by `data`.
8935 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
8938 * An enum which can either contain a crate::lightning::ln::msgs::NetAddress or not
8940 typedef enum LDKCOption_NetAddressZ_Tag {
8942 * When we're in this state, this COption_NetAddressZ contains a crate::lightning::ln::msgs::NetAddress
8944 LDKCOption_NetAddressZ_Some,
8946 * When we're in this state, this COption_NetAddressZ contains nothing
8948 LDKCOption_NetAddressZ_None,
8950 * Must be last for serialization purposes
8952 LDKCOption_NetAddressZ_Sentinel,
8953 } LDKCOption_NetAddressZ_Tag;
8955 typedef struct LDKCOption_NetAddressZ {
8956 LDKCOption_NetAddressZ_Tag tag;
8959 struct LDKNetAddress some;
8962 } LDKCOption_NetAddressZ;
8967 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
8968 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
8971 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
8973 * A pointer to the opaque Rust object.
8974 * Nearly everywhere, inner must be non-null, however in places where
8975 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8977 LDKnativePeerHandleError *inner;
8979 * Indicates that this is the only struct which contains the same pointer.
8980 * Rust functions which take ownership of an object provided via an argument require
8981 * this to be true and invalidate the object pointed to by inner.
8984 } LDKPeerHandleError;
8987 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
8989 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
8991 * A pointer to the contents in the success state.
8992 * Reading from this pointer when `result_ok` is not set is undefined.
8994 struct LDKCVec_u8Z *result;
8996 * A pointer to the contents in the error state.
8997 * Reading from this pointer when `result_ok` is set is undefined.
8999 struct LDKPeerHandleError *err;
9000 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
9003 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
9004 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9005 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9007 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
9009 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
9010 * `err` or `result` depending on the state of `result_ok`.
9012 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
9014 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
9017 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
9020 * The contents of CResult_NonePeerHandleErrorZ
9022 typedef union LDKCResult_NonePeerHandleErrorZPtr {
9024 * Note that this value is always NULL, as there are no contents in the OK variant
9028 * A pointer to the contents in the error state.
9029 * Reading from this pointer when `result_ok` is set is undefined.
9031 struct LDKPeerHandleError *err;
9032 } LDKCResult_NonePeerHandleErrorZPtr;
9035 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
9036 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9037 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9039 typedef struct LDKCResult_NonePeerHandleErrorZ {
9041 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
9042 * `err` or `result` depending on the state of `result_ok`.
9044 union LDKCResult_NonePeerHandleErrorZPtr contents;
9046 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
9049 } LDKCResult_NonePeerHandleErrorZ;
9052 * The contents of CResult_boolPeerHandleErrorZ
9054 typedef union LDKCResult_boolPeerHandleErrorZPtr {
9056 * A pointer to the contents in the success state.
9057 * Reading from this pointer when `result_ok` is not set is undefined.
9061 * A pointer to the contents in the error state.
9062 * Reading from this pointer when `result_ok` is set is undefined.
9064 struct LDKPeerHandleError *err;
9065 } LDKCResult_boolPeerHandleErrorZPtr;
9068 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
9069 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9070 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9072 typedef struct LDKCResult_boolPeerHandleErrorZ {
9074 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
9075 * `err` or `result` depending on the state of `result_ok`.
9077 union LDKCResult_boolPeerHandleErrorZPtr contents;
9079 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
9082 } LDKCResult_boolPeerHandleErrorZ;
9085 * All-encompassing standard error type that processing can return
9087 typedef enum LDKGraphSyncError_Tag {
9089 * Error trying to read the update data, typically due to an erroneous data length indication
9090 * that is greater than the actual amount of data provided
9092 LDKGraphSyncError_DecodeError,
9094 * Error applying the patch to the network graph, usually the result of updates that are too
9095 * old or missing prerequisite data to the application of updates out of order
9097 LDKGraphSyncError_LightningError,
9099 * Must be last for serialization purposes
9101 LDKGraphSyncError_Sentinel,
9102 } LDKGraphSyncError_Tag;
9104 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
9105 LDKGraphSyncError_Tag tag;
9108 struct LDKDecodeError decode_error;
9111 struct LDKLightningError lightning_error;
9114 } LDKGraphSyncError;
9117 * The contents of CResult_u32GraphSyncErrorZ
9119 typedef union LDKCResult_u32GraphSyncErrorZPtr {
9121 * A pointer to the contents in the success state.
9122 * Reading from this pointer when `result_ok` is not set is undefined.
9126 * A pointer to the contents in the error state.
9127 * Reading from this pointer when `result_ok` is set is undefined.
9129 struct LDKGraphSyncError *err;
9130 } LDKCResult_u32GraphSyncErrorZPtr;
9133 * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
9134 * containing a u32 on success and a crate::lightning_rapid_gossip_sync::error::GraphSyncError on failure.
9135 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9137 typedef struct LDKCResult_u32GraphSyncErrorZ {
9139 * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
9140 * `err` or `result` depending on the state of `result_ok`.
9142 union LDKCResult_u32GraphSyncErrorZPtr contents;
9144 * Whether this CResult_u32GraphSyncErrorZ represents a success state.
9147 } LDKCResult_u32GraphSyncErrorZ;
9150 * The contents of CResult_NetAddressDecodeErrorZ
9152 typedef union LDKCResult_NetAddressDecodeErrorZPtr {
9154 * A pointer to the contents in the success state.
9155 * Reading from this pointer when `result_ok` is not set is undefined.
9157 struct LDKNetAddress *result;
9159 * A pointer to the contents in the error state.
9160 * Reading from this pointer when `result_ok` is set is undefined.
9162 struct LDKDecodeError *err;
9163 } LDKCResult_NetAddressDecodeErrorZPtr;
9166 * A CResult_NetAddressDecodeErrorZ represents the result of a fallible operation,
9167 * containing a crate::lightning::ln::msgs::NetAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
9168 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9170 typedef struct LDKCResult_NetAddressDecodeErrorZ {
9172 * The contents of this CResult_NetAddressDecodeErrorZ, accessible via either
9173 * `err` or `result` depending on the state of `result_ok`.
9175 union LDKCResult_NetAddressDecodeErrorZPtr contents;
9177 * Whether this CResult_NetAddressDecodeErrorZ represents a success state.
9180 } LDKCResult_NetAddressDecodeErrorZ;
9185 * An update_add_htlc message to be sent or received from a peer
9187 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
9189 * A pointer to the opaque Rust object.
9190 * Nearly everywhere, inner must be non-null, however in places where
9191 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9193 LDKnativeUpdateAddHTLC *inner;
9195 * Indicates that this is the only struct which contains the same pointer.
9196 * Rust functions which take ownership of an object provided via an argument require
9197 * this to be true and invalidate the object pointed to by inner.
9203 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
9204 * This corresponds to std::vector in C++
9206 typedef struct LDKCVec_UpdateAddHTLCZ {
9208 * The elements in the array.
9209 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9211 struct LDKUpdateAddHTLC *data;
9213 * The number of elements pointed to by `data`.
9216 } LDKCVec_UpdateAddHTLCZ;
9221 * An update_fulfill_htlc message to be sent or received from a peer
9223 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
9225 * A pointer to the opaque Rust object.
9226 * Nearly everywhere, inner must be non-null, however in places where
9227 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9229 LDKnativeUpdateFulfillHTLC *inner;
9231 * Indicates that this is the only struct which contains the same pointer.
9232 * Rust functions which take ownership of an object provided via an argument require
9233 * this to be true and invalidate the object pointed to by inner.
9236 } LDKUpdateFulfillHTLC;
9239 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
9240 * This corresponds to std::vector in C++
9242 typedef struct LDKCVec_UpdateFulfillHTLCZ {
9244 * The elements in the array.
9245 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9247 struct LDKUpdateFulfillHTLC *data;
9249 * The number of elements pointed to by `data`.
9252 } LDKCVec_UpdateFulfillHTLCZ;
9257 * An update_fail_htlc message to be sent or received from a peer
9259 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
9261 * A pointer to the opaque Rust object.
9262 * Nearly everywhere, inner must be non-null, however in places where
9263 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9265 LDKnativeUpdateFailHTLC *inner;
9267 * Indicates that this is the only struct which contains the same pointer.
9268 * Rust functions which take ownership of an object provided via an argument require
9269 * this to be true and invalidate the object pointed to by inner.
9272 } LDKUpdateFailHTLC;
9275 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
9276 * This corresponds to std::vector in C++
9278 typedef struct LDKCVec_UpdateFailHTLCZ {
9280 * The elements in the array.
9281 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9283 struct LDKUpdateFailHTLC *data;
9285 * The number of elements pointed to by `data`.
9288 } LDKCVec_UpdateFailHTLCZ;
9293 * An update_fail_malformed_htlc message to be sent or received from a peer
9295 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
9297 * A pointer to the opaque Rust object.
9298 * Nearly everywhere, inner must be non-null, however in places where
9299 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9301 LDKnativeUpdateFailMalformedHTLC *inner;
9303 * Indicates that this is the only struct which contains the same pointer.
9304 * Rust functions which take ownership of an object provided via an argument require
9305 * this to be true and invalidate the object pointed to by inner.
9308 } LDKUpdateFailMalformedHTLC;
9311 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
9312 * This corresponds to std::vector in C++
9314 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
9316 * The elements in the array.
9317 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9319 struct LDKUpdateFailMalformedHTLC *data;
9321 * The number of elements pointed to by `data`.
9324 } LDKCVec_UpdateFailMalformedHTLCZ;
9327 * The contents of CResult_AcceptChannelDecodeErrorZ
9329 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
9331 * A pointer to the contents in the success state.
9332 * Reading from this pointer when `result_ok` is not set is undefined.
9334 struct LDKAcceptChannel *result;
9336 * A pointer to the contents in the error state.
9337 * Reading from this pointer when `result_ok` is set is undefined.
9339 struct LDKDecodeError *err;
9340 } LDKCResult_AcceptChannelDecodeErrorZPtr;
9343 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
9344 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
9345 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9347 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
9349 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
9350 * `err` or `result` depending on the state of `result_ok`.
9352 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
9354 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
9357 } LDKCResult_AcceptChannelDecodeErrorZ;
9360 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
9362 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
9364 * A pointer to the contents in the success state.
9365 * Reading from this pointer when `result_ok` is not set is undefined.
9367 struct LDKAnnouncementSignatures *result;
9369 * A pointer to the contents in the error state.
9370 * Reading from this pointer when `result_ok` is set is undefined.
9372 struct LDKDecodeError *err;
9373 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
9376 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
9377 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
9378 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9380 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
9382 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
9383 * `err` or `result` depending on the state of `result_ok`.
9385 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
9387 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
9390 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
9393 * The contents of CResult_ChannelReestablishDecodeErrorZ
9395 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
9397 * A pointer to the contents in the success state.
9398 * Reading from this pointer when `result_ok` is not set is undefined.
9400 struct LDKChannelReestablish *result;
9402 * A pointer to the contents in the error state.
9403 * Reading from this pointer when `result_ok` is set is undefined.
9405 struct LDKDecodeError *err;
9406 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
9409 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
9410 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
9411 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9413 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
9415 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
9416 * `err` or `result` depending on the state of `result_ok`.
9418 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
9420 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
9423 } LDKCResult_ChannelReestablishDecodeErrorZ;
9426 * The contents of CResult_ClosingSignedDecodeErrorZ
9428 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
9430 * A pointer to the contents in the success state.
9431 * Reading from this pointer when `result_ok` is not set is undefined.
9433 struct LDKClosingSigned *result;
9435 * A pointer to the contents in the error state.
9436 * Reading from this pointer when `result_ok` is set is undefined.
9438 struct LDKDecodeError *err;
9439 } LDKCResult_ClosingSignedDecodeErrorZPtr;
9442 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
9443 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
9444 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9446 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
9448 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
9449 * `err` or `result` depending on the state of `result_ok`.
9451 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
9453 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
9456 } LDKCResult_ClosingSignedDecodeErrorZ;
9461 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
9462 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
9465 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
9467 * A pointer to the opaque Rust object.
9468 * Nearly everywhere, inner must be non-null, however in places where
9469 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9471 LDKnativeClosingSignedFeeRange *inner;
9473 * Indicates that this is the only struct which contains the same pointer.
9474 * Rust functions which take ownership of an object provided via an argument require
9475 * this to be true and invalidate the object pointed to by inner.
9478 } LDKClosingSignedFeeRange;
9481 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
9483 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
9485 * A pointer to the contents in the success state.
9486 * Reading from this pointer when `result_ok` is not set is undefined.
9488 struct LDKClosingSignedFeeRange *result;
9490 * A pointer to the contents in the error state.
9491 * Reading from this pointer when `result_ok` is set is undefined.
9493 struct LDKDecodeError *err;
9494 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
9497 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
9498 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
9499 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9501 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
9503 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
9504 * `err` or `result` depending on the state of `result_ok`.
9506 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
9508 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
9511 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
9516 * A commitment_signed message to be sent or received from a peer
9518 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
9520 * A pointer to the opaque Rust object.
9521 * Nearly everywhere, inner must be non-null, however in places where
9522 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9524 LDKnativeCommitmentSigned *inner;
9526 * Indicates that this is the only struct which contains the same pointer.
9527 * Rust functions which take ownership of an object provided via an argument require
9528 * this to be true and invalidate the object pointed to by inner.
9531 } LDKCommitmentSigned;
9534 * The contents of CResult_CommitmentSignedDecodeErrorZ
9536 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
9538 * A pointer to the contents in the success state.
9539 * Reading from this pointer when `result_ok` is not set is undefined.
9541 struct LDKCommitmentSigned *result;
9543 * A pointer to the contents in the error state.
9544 * Reading from this pointer when `result_ok` is set is undefined.
9546 struct LDKDecodeError *err;
9547 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
9550 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
9551 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
9552 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9554 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
9556 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
9557 * `err` or `result` depending on the state of `result_ok`.
9559 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
9561 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
9564 } LDKCResult_CommitmentSignedDecodeErrorZ;
9567 * The contents of CResult_FundingCreatedDecodeErrorZ
9569 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
9571 * A pointer to the contents in the success state.
9572 * Reading from this pointer when `result_ok` is not set is undefined.
9574 struct LDKFundingCreated *result;
9576 * A pointer to the contents in the error state.
9577 * Reading from this pointer when `result_ok` is set is undefined.
9579 struct LDKDecodeError *err;
9580 } LDKCResult_FundingCreatedDecodeErrorZPtr;
9583 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
9584 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
9585 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9587 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
9589 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
9590 * `err` or `result` depending on the state of `result_ok`.
9592 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
9594 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
9597 } LDKCResult_FundingCreatedDecodeErrorZ;
9600 * The contents of CResult_FundingSignedDecodeErrorZ
9602 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
9604 * A pointer to the contents in the success state.
9605 * Reading from this pointer when `result_ok` is not set is undefined.
9607 struct LDKFundingSigned *result;
9609 * A pointer to the contents in the error state.
9610 * Reading from this pointer when `result_ok` is set is undefined.
9612 struct LDKDecodeError *err;
9613 } LDKCResult_FundingSignedDecodeErrorZPtr;
9616 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
9617 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
9618 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9620 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
9622 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
9623 * `err` or `result` depending on the state of `result_ok`.
9625 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
9627 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
9630 } LDKCResult_FundingSignedDecodeErrorZ;
9633 * The contents of CResult_ChannelReadyDecodeErrorZ
9635 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
9637 * A pointer to the contents in the success state.
9638 * Reading from this pointer when `result_ok` is not set is undefined.
9640 struct LDKChannelReady *result;
9642 * A pointer to the contents in the error state.
9643 * Reading from this pointer when `result_ok` is set is undefined.
9645 struct LDKDecodeError *err;
9646 } LDKCResult_ChannelReadyDecodeErrorZPtr;
9649 * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
9650 * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
9651 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9653 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
9655 * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
9656 * `err` or `result` depending on the state of `result_ok`.
9658 union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
9660 * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
9663 } LDKCResult_ChannelReadyDecodeErrorZ;
9668 * An init message to be sent or received from a peer
9670 typedef struct MUST_USE_STRUCT LDKInit {
9672 * A pointer to the opaque Rust object.
9673 * Nearly everywhere, inner must be non-null, however in places where
9674 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9676 LDKnativeInit *inner;
9678 * Indicates that this is the only struct which contains the same pointer.
9679 * Rust functions which take ownership of an object provided via an argument require
9680 * this to be true and invalidate the object pointed to by inner.
9686 * The contents of CResult_InitDecodeErrorZ
9688 typedef union LDKCResult_InitDecodeErrorZPtr {
9690 * A pointer to the contents in the success state.
9691 * Reading from this pointer when `result_ok` is not set is undefined.
9693 struct LDKInit *result;
9695 * A pointer to the contents in the error state.
9696 * Reading from this pointer when `result_ok` is set is undefined.
9698 struct LDKDecodeError *err;
9699 } LDKCResult_InitDecodeErrorZPtr;
9702 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
9703 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
9704 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9706 typedef struct LDKCResult_InitDecodeErrorZ {
9708 * The contents of this CResult_InitDecodeErrorZ, accessible via either
9709 * `err` or `result` depending on the state of `result_ok`.
9711 union LDKCResult_InitDecodeErrorZPtr contents;
9713 * Whether this CResult_InitDecodeErrorZ represents a success state.
9716 } LDKCResult_InitDecodeErrorZ;
9719 * The contents of CResult_OpenChannelDecodeErrorZ
9721 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
9723 * A pointer to the contents in the success state.
9724 * Reading from this pointer when `result_ok` is not set is undefined.
9726 struct LDKOpenChannel *result;
9728 * A pointer to the contents in the error state.
9729 * Reading from this pointer when `result_ok` is set is undefined.
9731 struct LDKDecodeError *err;
9732 } LDKCResult_OpenChannelDecodeErrorZPtr;
9735 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
9736 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
9737 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9739 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
9741 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
9742 * `err` or `result` depending on the state of `result_ok`.
9744 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
9746 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
9749 } LDKCResult_OpenChannelDecodeErrorZ;
9752 * The contents of CResult_RevokeAndACKDecodeErrorZ
9754 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
9756 * A pointer to the contents in the success state.
9757 * Reading from this pointer when `result_ok` is not set is undefined.
9759 struct LDKRevokeAndACK *result;
9761 * A pointer to the contents in the error state.
9762 * Reading from this pointer when `result_ok` is set is undefined.
9764 struct LDKDecodeError *err;
9765 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
9768 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
9769 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
9770 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9772 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
9774 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
9775 * `err` or `result` depending on the state of `result_ok`.
9777 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
9779 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
9782 } LDKCResult_RevokeAndACKDecodeErrorZ;
9785 * The contents of CResult_ShutdownDecodeErrorZ
9787 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
9789 * A pointer to the contents in the success state.
9790 * Reading from this pointer when `result_ok` is not set is undefined.
9792 struct LDKShutdown *result;
9794 * A pointer to the contents in the error state.
9795 * Reading from this pointer when `result_ok` is set is undefined.
9797 struct LDKDecodeError *err;
9798 } LDKCResult_ShutdownDecodeErrorZPtr;
9801 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
9802 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
9803 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9805 typedef struct LDKCResult_ShutdownDecodeErrorZ {
9807 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
9808 * `err` or `result` depending on the state of `result_ok`.
9810 union LDKCResult_ShutdownDecodeErrorZPtr contents;
9812 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
9815 } LDKCResult_ShutdownDecodeErrorZ;
9818 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
9820 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
9822 * A pointer to the contents in the success state.
9823 * Reading from this pointer when `result_ok` is not set is undefined.
9825 struct LDKUpdateFailHTLC *result;
9827 * A pointer to the contents in the error state.
9828 * Reading from this pointer when `result_ok` is set is undefined.
9830 struct LDKDecodeError *err;
9831 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
9834 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
9835 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
9836 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9838 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
9840 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
9841 * `err` or `result` depending on the state of `result_ok`.
9843 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
9845 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
9848 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
9851 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
9853 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
9855 * A pointer to the contents in the success state.
9856 * Reading from this pointer when `result_ok` is not set is undefined.
9858 struct LDKUpdateFailMalformedHTLC *result;
9860 * A pointer to the contents in the error state.
9861 * Reading from this pointer when `result_ok` is set is undefined.
9863 struct LDKDecodeError *err;
9864 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
9867 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
9868 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
9869 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9871 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
9873 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
9874 * `err` or `result` depending on the state of `result_ok`.
9876 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
9878 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
9881 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
9886 * An update_fee message to be sent or received from a peer
9888 typedef struct MUST_USE_STRUCT LDKUpdateFee {
9890 * A pointer to the opaque Rust object.
9891 * Nearly everywhere, inner must be non-null, however in places where
9892 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9894 LDKnativeUpdateFee *inner;
9896 * Indicates that this is the only struct which contains the same pointer.
9897 * Rust functions which take ownership of an object provided via an argument require
9898 * this to be true and invalidate the object pointed to by inner.
9904 * The contents of CResult_UpdateFeeDecodeErrorZ
9906 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
9908 * A pointer to the contents in the success state.
9909 * Reading from this pointer when `result_ok` is not set is undefined.
9911 struct LDKUpdateFee *result;
9913 * A pointer to the contents in the error state.
9914 * Reading from this pointer when `result_ok` is set is undefined.
9916 struct LDKDecodeError *err;
9917 } LDKCResult_UpdateFeeDecodeErrorZPtr;
9920 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
9921 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
9922 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9924 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
9926 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
9927 * `err` or `result` depending on the state of `result_ok`.
9929 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
9931 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
9934 } LDKCResult_UpdateFeeDecodeErrorZ;
9937 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
9939 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
9941 * A pointer to the contents in the success state.
9942 * Reading from this pointer when `result_ok` is not set is undefined.
9944 struct LDKUpdateFulfillHTLC *result;
9946 * A pointer to the contents in the error state.
9947 * Reading from this pointer when `result_ok` is set is undefined.
9949 struct LDKDecodeError *err;
9950 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
9953 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
9954 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
9955 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9957 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
9959 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
9960 * `err` or `result` depending on the state of `result_ok`.
9962 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
9964 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
9967 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
9970 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
9972 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
9974 * A pointer to the contents in the success state.
9975 * Reading from this pointer when `result_ok` is not set is undefined.
9977 struct LDKUpdateAddHTLC *result;
9979 * A pointer to the contents in the error state.
9980 * Reading from this pointer when `result_ok` is set is undefined.
9982 struct LDKDecodeError *err;
9983 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
9986 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
9987 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
9988 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9990 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
9992 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
9993 * `err` or `result` depending on the state of `result_ok`.
9995 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
9997 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
10000 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
10005 * A ping message to be sent or received from a peer
10007 typedef struct MUST_USE_STRUCT LDKPing {
10009 * A pointer to the opaque Rust object.
10010 * Nearly everywhere, inner must be non-null, however in places where
10011 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10013 LDKnativePing *inner;
10015 * Indicates that this is the only struct which contains the same pointer.
10016 * Rust functions which take ownership of an object provided via an argument require
10017 * this to be true and invalidate the object pointed to by inner.
10023 * The contents of CResult_PingDecodeErrorZ
10025 typedef union LDKCResult_PingDecodeErrorZPtr {
10027 * A pointer to the contents in the success state.
10028 * Reading from this pointer when `result_ok` is not set is undefined.
10030 struct LDKPing *result;
10032 * A pointer to the contents in the error state.
10033 * Reading from this pointer when `result_ok` is set is undefined.
10035 struct LDKDecodeError *err;
10036 } LDKCResult_PingDecodeErrorZPtr;
10039 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
10040 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
10041 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10043 typedef struct LDKCResult_PingDecodeErrorZ {
10045 * The contents of this CResult_PingDecodeErrorZ, accessible via either
10046 * `err` or `result` depending on the state of `result_ok`.
10048 union LDKCResult_PingDecodeErrorZPtr contents;
10050 * Whether this CResult_PingDecodeErrorZ represents a success state.
10053 } LDKCResult_PingDecodeErrorZ;
10058 * A pong message to be sent or received from a peer
10060 typedef struct MUST_USE_STRUCT LDKPong {
10062 * A pointer to the opaque Rust object.
10063 * Nearly everywhere, inner must be non-null, however in places where
10064 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10066 LDKnativePong *inner;
10068 * Indicates that this is the only struct which contains the same pointer.
10069 * Rust functions which take ownership of an object provided via an argument require
10070 * this to be true and invalidate the object pointed to by inner.
10076 * The contents of CResult_PongDecodeErrorZ
10078 typedef union LDKCResult_PongDecodeErrorZPtr {
10080 * A pointer to the contents in the success state.
10081 * Reading from this pointer when `result_ok` is not set is undefined.
10083 struct LDKPong *result;
10085 * A pointer to the contents in the error state.
10086 * Reading from this pointer when `result_ok` is set is undefined.
10088 struct LDKDecodeError *err;
10089 } LDKCResult_PongDecodeErrorZPtr;
10092 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
10093 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
10094 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10096 typedef struct LDKCResult_PongDecodeErrorZ {
10098 * The contents of this CResult_PongDecodeErrorZ, accessible via either
10099 * `err` or `result` depending on the state of `result_ok`.
10101 union LDKCResult_PongDecodeErrorZPtr contents;
10103 * Whether this CResult_PongDecodeErrorZ represents a success state.
10106 } LDKCResult_PongDecodeErrorZ;
10109 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
10111 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
10113 * A pointer to the contents in the success state.
10114 * Reading from this pointer when `result_ok` is not set is undefined.
10116 struct LDKUnsignedChannelAnnouncement *result;
10118 * A pointer to the contents in the error state.
10119 * Reading from this pointer when `result_ok` is set is undefined.
10121 struct LDKDecodeError *err;
10122 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
10125 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
10126 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10127 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10129 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
10131 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
10132 * `err` or `result` depending on the state of `result_ok`.
10134 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
10136 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
10139 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
10142 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
10144 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
10146 * A pointer to the contents in the success state.
10147 * Reading from this pointer when `result_ok` is not set is undefined.
10149 struct LDKChannelAnnouncement *result;
10151 * A pointer to the contents in the error state.
10152 * Reading from this pointer when `result_ok` is set is undefined.
10154 struct LDKDecodeError *err;
10155 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
10158 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
10159 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10160 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10162 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
10164 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
10165 * `err` or `result` depending on the state of `result_ok`.
10167 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
10169 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
10172 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
10177 * The unsigned part of a channel_update
10179 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
10181 * A pointer to the opaque Rust object.
10182 * Nearly everywhere, inner must be non-null, however in places where
10183 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10185 LDKnativeUnsignedChannelUpdate *inner;
10187 * Indicates that this is the only struct which contains the same pointer.
10188 * Rust functions which take ownership of an object provided via an argument require
10189 * this to be true and invalidate the object pointed to by inner.
10192 } LDKUnsignedChannelUpdate;
10195 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
10197 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
10199 * A pointer to the contents in the success state.
10200 * Reading from this pointer when `result_ok` is not set is undefined.
10202 struct LDKUnsignedChannelUpdate *result;
10204 * A pointer to the contents in the error state.
10205 * Reading from this pointer when `result_ok` is set is undefined.
10207 struct LDKDecodeError *err;
10208 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
10211 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
10212 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
10213 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10215 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
10217 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
10218 * `err` or `result` depending on the state of `result_ok`.
10220 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
10222 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
10225 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
10228 * The contents of CResult_ChannelUpdateDecodeErrorZ
10230 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
10232 * A pointer to the contents in the success state.
10233 * Reading from this pointer when `result_ok` is not set is undefined.
10235 struct LDKChannelUpdate *result;
10237 * A pointer to the contents in the error state.
10238 * Reading from this pointer when `result_ok` is set is undefined.
10240 struct LDKDecodeError *err;
10241 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
10244 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
10245 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
10246 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10248 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
10250 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
10251 * `err` or `result` depending on the state of `result_ok`.
10253 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
10255 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
10258 } LDKCResult_ChannelUpdateDecodeErrorZ;
10261 * The contents of CResult_ErrorMessageDecodeErrorZ
10263 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
10265 * A pointer to the contents in the success state.
10266 * Reading from this pointer when `result_ok` is not set is undefined.
10268 struct LDKErrorMessage *result;
10270 * A pointer to the contents in the error state.
10271 * Reading from this pointer when `result_ok` is set is undefined.
10273 struct LDKDecodeError *err;
10274 } LDKCResult_ErrorMessageDecodeErrorZPtr;
10277 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
10278 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
10279 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10281 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
10283 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
10284 * `err` or `result` depending on the state of `result_ok`.
10286 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
10288 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
10291 } LDKCResult_ErrorMessageDecodeErrorZ;
10294 * The contents of CResult_WarningMessageDecodeErrorZ
10296 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
10298 * A pointer to the contents in the success state.
10299 * Reading from this pointer when `result_ok` is not set is undefined.
10301 struct LDKWarningMessage *result;
10303 * A pointer to the contents in the error state.
10304 * Reading from this pointer when `result_ok` is set is undefined.
10306 struct LDKDecodeError *err;
10307 } LDKCResult_WarningMessageDecodeErrorZPtr;
10310 * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
10311 * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
10312 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10314 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
10316 * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
10317 * `err` or `result` depending on the state of `result_ok`.
10319 union LDKCResult_WarningMessageDecodeErrorZPtr contents;
10321 * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
10324 } LDKCResult_WarningMessageDecodeErrorZ;
10329 * The unsigned part of a node_announcement
10331 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
10333 * A pointer to the opaque Rust object.
10334 * Nearly everywhere, inner must be non-null, however in places where
10335 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10337 LDKnativeUnsignedNodeAnnouncement *inner;
10339 * Indicates that this is the only struct which contains the same pointer.
10340 * Rust functions which take ownership of an object provided via an argument require
10341 * this to be true and invalidate the object pointed to by inner.
10344 } LDKUnsignedNodeAnnouncement;
10347 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
10349 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
10351 * A pointer to the contents in the success state.
10352 * Reading from this pointer when `result_ok` is not set is undefined.
10354 struct LDKUnsignedNodeAnnouncement *result;
10356 * A pointer to the contents in the error state.
10357 * Reading from this pointer when `result_ok` is set is undefined.
10359 struct LDKDecodeError *err;
10360 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
10363 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
10364 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10365 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10367 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
10369 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
10370 * `err` or `result` depending on the state of `result_ok`.
10372 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
10374 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
10377 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
10380 * The contents of CResult_NodeAnnouncementDecodeErrorZ
10382 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
10384 * A pointer to the contents in the success state.
10385 * Reading from this pointer when `result_ok` is not set is undefined.
10387 struct LDKNodeAnnouncement *result;
10389 * A pointer to the contents in the error state.
10390 * Reading from this pointer when `result_ok` is set is undefined.
10392 struct LDKDecodeError *err;
10393 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
10396 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
10397 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10398 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10400 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
10402 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
10403 * `err` or `result` depending on the state of `result_ok`.
10405 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
10407 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
10410 } LDKCResult_NodeAnnouncementDecodeErrorZ;
10413 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
10415 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
10417 * A pointer to the contents in the success state.
10418 * Reading from this pointer when `result_ok` is not set is undefined.
10420 struct LDKQueryShortChannelIds *result;
10422 * A pointer to the contents in the error state.
10423 * Reading from this pointer when `result_ok` is set is undefined.
10425 struct LDKDecodeError *err;
10426 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
10429 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
10430 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
10431 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10433 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
10435 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
10436 * `err` or `result` depending on the state of `result_ok`.
10438 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
10440 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
10443 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
10448 * A reply_short_channel_ids_end message is sent as a reply to a
10449 * query_short_channel_ids message. The query recipient makes a best
10450 * effort to respond based on their local network view which may not be
10451 * a perfect view of the network.
10453 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
10455 * A pointer to the opaque Rust object.
10456 * Nearly everywhere, inner must be non-null, however in places where
10457 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10459 LDKnativeReplyShortChannelIdsEnd *inner;
10461 * Indicates that this is the only struct which contains the same pointer.
10462 * Rust functions which take ownership of an object provided via an argument require
10463 * this to be true and invalidate the object pointed to by inner.
10466 } LDKReplyShortChannelIdsEnd;
10469 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
10471 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
10473 * A pointer to the contents in the success state.
10474 * Reading from this pointer when `result_ok` is not set is undefined.
10476 struct LDKReplyShortChannelIdsEnd *result;
10478 * A pointer to the contents in the error state.
10479 * Reading from this pointer when `result_ok` is set is undefined.
10481 struct LDKDecodeError *err;
10482 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
10485 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
10486 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
10487 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10489 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
10491 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
10492 * `err` or `result` depending on the state of `result_ok`.
10494 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
10496 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
10499 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
10502 * The contents of CResult_QueryChannelRangeDecodeErrorZ
10504 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
10506 * A pointer to the contents in the success state.
10507 * Reading from this pointer when `result_ok` is not set is undefined.
10509 struct LDKQueryChannelRange *result;
10511 * A pointer to the contents in the error state.
10512 * Reading from this pointer when `result_ok` is set is undefined.
10514 struct LDKDecodeError *err;
10515 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
10518 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
10519 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
10520 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10522 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
10524 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
10525 * `err` or `result` depending on the state of `result_ok`.
10527 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
10529 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
10532 } LDKCResult_QueryChannelRangeDecodeErrorZ;
10535 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
10537 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
10539 * A pointer to the contents in the success state.
10540 * Reading from this pointer when `result_ok` is not set is undefined.
10542 struct LDKReplyChannelRange *result;
10544 * A pointer to the contents in the error state.
10545 * Reading from this pointer when `result_ok` is set is undefined.
10547 struct LDKDecodeError *err;
10548 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
10551 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
10552 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
10553 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10555 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
10557 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
10558 * `err` or `result` depending on the state of `result_ok`.
10560 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
10562 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
10565 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
10568 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
10570 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
10572 * A pointer to the contents in the success state.
10573 * Reading from this pointer when `result_ok` is not set is undefined.
10575 struct LDKGossipTimestampFilter *result;
10577 * A pointer to the contents in the error state.
10578 * Reading from this pointer when `result_ok` is set is undefined.
10580 struct LDKDecodeError *err;
10581 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
10584 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
10585 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
10586 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10588 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
10590 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
10591 * `err` or `result` depending on the state of `result_ok`.
10593 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
10595 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
10598 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
10601 * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
10602 * This corresponds to std::vector in C++
10604 typedef struct LDKCVec_PhantomRouteHintsZ {
10606 * The elements in the array.
10607 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10609 struct LDKPhantomRouteHints *data;
10611 * The number of elements pointed to by `data`.
10614 } LDKCVec_PhantomRouteHintsZ;
10617 * When signing using a fallible method either an user-supplied `SignError` or a `CreationError`
10620 typedef enum LDKSignOrCreationError_Tag {
10622 * An error occurred during signing
10624 LDKSignOrCreationError_SignError,
10626 * An error occurred while building the transaction
10628 LDKSignOrCreationError_CreationError,
10630 * Must be last for serialization purposes
10632 LDKSignOrCreationError_Sentinel,
10633 } LDKSignOrCreationError_Tag;
10635 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
10636 LDKSignOrCreationError_Tag tag;
10639 enum LDKCreationError creation_error;
10642 } LDKSignOrCreationError;
10645 * The contents of CResult_InvoiceSignOrCreationErrorZ
10647 typedef union LDKCResult_InvoiceSignOrCreationErrorZPtr {
10649 * A pointer to the contents in the success state.
10650 * Reading from this pointer when `result_ok` is not set is undefined.
10652 struct LDKInvoice *result;
10654 * A pointer to the contents in the error state.
10655 * Reading from this pointer when `result_ok` is set is undefined.
10657 struct LDKSignOrCreationError *err;
10658 } LDKCResult_InvoiceSignOrCreationErrorZPtr;
10661 * A CResult_InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
10662 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
10663 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10665 typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
10667 * The contents of this CResult_InvoiceSignOrCreationErrorZ, accessible via either
10668 * `err` or `result` depending on the state of `result_ok`.
10670 union LDKCResult_InvoiceSignOrCreationErrorZPtr contents;
10672 * Whether this CResult_InvoiceSignOrCreationErrorZ represents a success state.
10675 } LDKCResult_InvoiceSignOrCreationErrorZ;
10680 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
10682 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
10683 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
10684 * the return value of [`Filter::register_output`].
10686 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
10687 * may have been spent there. See [`Filter::register_output`] for details.
10689 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
10690 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
10692 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
10694 * A pointer to the opaque Rust object.
10695 * Nearly everywhere, inner must be non-null, however in places where
10696 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10698 LDKnativeWatchedOutput *inner;
10700 * Indicates that this is the only struct which contains the same pointer.
10701 * Rust functions which take ownership of an object provided via an argument require
10702 * this to be true and invalidate the object pointed to by inner.
10705 } LDKWatchedOutput;
10708 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
10711 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
10712 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
10713 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
10714 * receiving full blocks from a chain source, any further filtering is unnecessary.
10716 * After an output has been registered, subsequent block retrievals from the chain source must not
10717 * exclude any transactions matching the new criteria nor any in-block descendants of such
10720 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
10721 * should not block on I/O. Implementations should instead queue the newly monitored data to be
10722 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
10723 * invocation that has called the `Filter` must return [`TemporaryFailure`].
10725 * [`TemporaryFailure`]: ChannelMonitorUpdateErr::TemporaryFailure
10726 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
10727 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
10729 typedef struct LDKFilter {
10731 * An opaque pointer which is passed to your function implementations as an argument.
10732 * This has no meaning in the LDK, and can be NULL or any other value.
10736 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
10737 * a spending condition.
10739 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
10741 * Registers interest in spends of a transaction output.
10743 * Optionally, when `output.block_hash` is set, should return any transaction spending the
10744 * output that is found in the corresponding block along with its index.
10746 * This return value is useful for Electrum clients in order to supply in-block descendant
10747 * transactions which otherwise were not included. This is not necessary for other clients if
10748 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
10751 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
10753 * Frees any resources associated with this object given its this_arg pointer.
10754 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10756 void (*free)(void *this_arg);
10760 * An enum which can either contain a crate::lightning::chain::Filter or not
10762 typedef enum LDKCOption_FilterZ_Tag {
10764 * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
10766 LDKCOption_FilterZ_Some,
10768 * When we're in this state, this COption_FilterZ contains nothing
10770 LDKCOption_FilterZ_None,
10772 * Must be last for serialization purposes
10774 LDKCOption_FilterZ_Sentinel,
10775 } LDKCOption_FilterZ_Tag;
10777 typedef struct LDKCOption_FilterZ {
10778 LDKCOption_FilterZ_Tag tag;
10781 struct LDKFilter some;
10784 } LDKCOption_FilterZ;
10789 * A read-only reference to a current ChannelMonitor.
10791 * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
10794 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
10796 * A pointer to the opaque Rust object.
10797 * Nearly everywhere, inner must be non-null, however in places where
10798 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10800 LDKnativeLockedChannelMonitor *inner;
10802 * Indicates that this is the only struct which contains the same pointer.
10803 * Rust functions which take ownership of an object provided via an argument require
10804 * this to be true and invalidate the object pointed to by inner.
10807 } LDKLockedChannelMonitor;
10810 * The contents of CResult_LockedChannelMonitorNoneZ
10812 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
10814 * A pointer to the contents in the success state.
10815 * Reading from this pointer when `result_ok` is not set is undefined.
10817 struct LDKLockedChannelMonitor *result;
10819 * Note that this value is always NULL, as there are no contents in the Err variant
10822 } LDKCResult_LockedChannelMonitorNoneZPtr;
10825 * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
10826 * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
10827 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10829 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
10831 * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
10832 * `err` or `result` depending on the state of `result_ok`.
10834 union LDKCResult_LockedChannelMonitorNoneZPtr contents;
10836 * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
10839 } LDKCResult_LockedChannelMonitorNoneZ;
10842 * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
10843 * This corresponds to std::vector in C++
10845 typedef struct LDKCVec_OutPointZ {
10847 * The elements in the array.
10848 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10850 struct LDKOutPoint *data;
10852 * The number of elements pointed to by `data`.
10855 } LDKCVec_OutPointZ;
10858 * A trait indicating an object may generate message send events
10860 typedef struct LDKMessageSendEventsProvider {
10862 * An opaque pointer which is passed to your function implementations as an argument.
10863 * This has no meaning in the LDK, and can be NULL or any other value.
10867 * Gets the list of pending events which were generated by previous actions, clearing the list
10870 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
10872 * Frees any resources associated with this object given its this_arg pointer.
10873 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10875 void (*free)(void *this_arg);
10876 } LDKMessageSendEventsProvider;
10879 * A trait implemented for objects handling events from [`EventsProvider`].
10881 typedef struct LDKEventHandler {
10883 * An opaque pointer which is passed to your function implementations as an argument.
10884 * This has no meaning in the LDK, and can be NULL or any other value.
10888 * Handles the given [`Event`].
10890 * See [`EventsProvider`] for details that must be considered when implementing this method.
10892 void (*handle_event)(const void *this_arg, const struct LDKEvent *NONNULL_PTR event);
10894 * Frees any resources associated with this object given its this_arg pointer.
10895 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10897 void (*free)(void *this_arg);
10901 * A trait indicating an object may generate events.
10903 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
10907 * See [`process_pending_events`] for requirements around event processing.
10909 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
10910 * event since the last invocation. The handler must either act upon the event immediately
10911 * or preserve it for later handling.
10913 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
10914 * consult the provider's documentation on the implication of processing events and how a handler
10915 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
10916 * [`ChainMonitor::process_pending_events`]).
10918 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
10921 * [`process_pending_events`]: Self::process_pending_events
10922 * [`handle_event`]: EventHandler::handle_event
10923 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
10924 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
10926 typedef struct LDKEventsProvider {
10928 * An opaque pointer which is passed to your function implementations as an argument.
10929 * This has no meaning in the LDK, and can be NULL or any other value.
10933 * Processes any events generated since the last call using the given event handler.
10935 * Subsequent calls must only process new events. However, handlers must be capable of handling
10936 * duplicate events across process restarts. This may occur if the provider was recovered from
10937 * an old state (i.e., it hadn't been successfully persisted after processing pending events).
10939 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
10941 * Frees any resources associated with this object given its this_arg pointer.
10942 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10944 void (*free)(void *this_arg);
10945 } LDKEventsProvider;
10950 * Lightning TLV uses a custom variable-length integer called BigSize. It is similar to Bitcoin's
10951 * variable-length integers except that it is serialized in big-endian instead of little-endian.
10953 * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
10954 * encoded in several different ways, which we must check for at deserialization-time. Thus, if
10955 * you're looking for an example of a variable-length integer to use for your own project, move
10956 * along, this is a rather poor design.
10958 typedef struct MUST_USE_STRUCT LDKBigSize {
10960 * A pointer to the opaque Rust object.
10961 * Nearly everywhere, inner must be non-null, however in places where
10962 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10964 LDKnativeBigSize *inner;
10966 * Indicates that this is the only struct which contains the same pointer.
10967 * Rust functions which take ownership of an object provided via an argument require
10968 * this to be true and invalidate the object pointed to by inner.
10976 * Proposed use of a channel passed as a parameter to [`Score::channel_penalty_msat`].
10978 typedef struct MUST_USE_STRUCT LDKChannelUsage {
10980 * A pointer to the opaque Rust object.
10981 * Nearly everywhere, inner must be non-null, however in places where
10982 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10984 LDKnativeChannelUsage *inner;
10986 * Indicates that this is the only struct which contains the same pointer.
10987 * Rust functions which take ownership of an object provided via an argument require
10988 * this to be true and invalidate the object pointed to by inner.
10994 * An interface used to score payment channels for path finding.
10996 *\tScoring is in terms of fees willing to be paid in order to avoid routing through a channel.
10998 typedef struct LDKScore {
11000 * An opaque pointer which is passed to your function implementations as an argument.
11001 * This has no meaning in the LDK, and can be NULL or any other value.
11005 * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
11006 * given channel in the direction from `source` to `target`.
11008 * The channel's capacity (less any other MPP parts that are also being considered for use in
11009 * the same payment) is given by `capacity_msat`. It may be determined from various sources
11010 * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
11011 * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
11012 * Thus, implementations should be overflow-safe.
11014 uint64_t (*channel_penalty_msat)(const void *this_arg, uint64_t short_channel_id, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, struct LDKChannelUsage usage);
11016 * Handles updating channel penalties after failing to route through a channel.
11018 void (*payment_path_failed)(void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
11020 * Handles updating channel penalties after successfully routing along a path.
11022 void (*payment_path_successful)(void *this_arg, struct LDKCVec_RouteHopZ path);
11024 * Serialize the object into a byte array
11026 struct LDKCVec_u8Z (*write)(const void *this_arg);
11028 * Frees any resources associated with this object given its this_arg pointer.
11029 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11031 void (*free)(void *this_arg);
11037 * A concrete implementation of [`LockableScore`] which supports multi-threading.
11039 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
11041 * A pointer to the opaque Rust object.
11042 * Nearly everywhere, inner must be non-null, however in places where
11043 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11045 LDKnativeMultiThreadedLockableScore *inner;
11047 * Indicates that this is the only struct which contains the same pointer.
11048 * Rust functions which take ownership of an object provided via an argument require
11049 * this to be true and invalidate the object pointed to by inner.
11052 } LDKMultiThreadedLockableScore;
11055 * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`MultiThreadedLockableScore`] to disk.
11057 typedef struct LDKPersister {
11059 * An opaque pointer which is passed to your function implementations as an argument.
11060 * This has no meaning in the LDK, and can be NULL or any other value.
11064 * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
11066 struct LDKCResult_NoneErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
11068 * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
11070 struct LDKCResult_NoneErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
11072 * Persist the given [`MultiThreadedLockableScore`] to disk, returning an error if persistence failed.
11074 struct LDKCResult_NoneErrorZ (*persist_scorer)(const void *this_arg, const struct LDKMultiThreadedLockableScore *NONNULL_PTR scorer);
11076 * Frees any resources associated with this object given its this_arg pointer.
11077 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11079 void (*free)(void *this_arg);
11085 * Configuration we set when applicable.
11087 * Default::default() provides sane defaults.
11089 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
11091 * A pointer to the opaque Rust object.
11092 * Nearly everywhere, inner must be non-null, however in places where
11093 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11095 LDKnativeChannelHandshakeConfig *inner;
11097 * Indicates that this is the only struct which contains the same pointer.
11098 * Rust functions which take ownership of an object provided via an argument require
11099 * this to be true and invalidate the object pointed to by inner.
11102 } LDKChannelHandshakeConfig;
11107 * Optional channel limits which are applied during channel creation.
11109 * These limits are only applied to our counterparty's limits, not our own.
11111 * Use 0/<type>::max_value() as appropriate to skip checking.
11113 * Provides sane defaults for most configurations.
11115 * Most additional limits are disabled except those with which specify a default in individual
11116 * field documentation. Note that this may result in barely-usable channels, but since they
11117 * are applied mostly only to incoming channels that's not much of a problem.
11119 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
11121 * A pointer to the opaque Rust object.
11122 * Nearly everywhere, inner must be non-null, however in places where
11123 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11125 LDKnativeChannelHandshakeLimits *inner;
11127 * Indicates that this is the only struct which contains the same pointer.
11128 * Rust functions which take ownership of an object provided via an argument require
11129 * this to be true and invalidate the object pointed to by inner.
11132 } LDKChannelHandshakeLimits;
11137 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
11139 * Default::default() provides sane defaults for most configurations
11140 * (but currently with 0 relay fees!)
11142 typedef struct MUST_USE_STRUCT LDKUserConfig {
11144 * A pointer to the opaque Rust object.
11145 * Nearly everywhere, inner must be non-null, however in places where
11146 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11148 LDKnativeUserConfig *inner;
11150 * Indicates that this is the only struct which contains the same pointer.
11151 * Rust functions which take ownership of an object provided via an argument require
11152 * this to be true and invalidate the object pointed to by inner.
11160 * The best known block as identified by its hash and height.
11162 typedef struct MUST_USE_STRUCT LDKBestBlock {
11164 * A pointer to the opaque Rust object.
11165 * Nearly everywhere, inner must be non-null, however in places where
11166 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11168 LDKnativeBestBlock *inner;
11170 * Indicates that this is the only struct which contains the same pointer.
11171 * Rust functions which take ownership of an object provided via an argument require
11172 * this to be true and invalidate the object pointed to by inner.
11178 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
11181 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
11182 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
11183 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
11186 * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
11187 * entire header chain and only blocks with matching transaction data using BIP 157 filters or
11188 * other similar filtering.
11190 typedef struct LDKListen {
11192 * An opaque pointer which is passed to your function implementations as an argument.
11193 * This has no meaning in the LDK, and can be NULL or any other value.
11197 * Notifies the listener that a block was added at the given height, with the transaction data
11198 * possibly filtered.
11200 void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
11202 * Notifies the listener that a block was added at the given height.
11204 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
11206 * Notifies the listener that a block was removed at the given height.
11208 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
11210 * Frees any resources associated with this object given its this_arg pointer.
11211 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11213 void (*free)(void *this_arg);
11217 * The `Confirm` trait is used to notify when transactions have been confirmed on chain or
11218 * unconfirmed during a chain reorganization.
11220 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
11221 * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity
11222 * related to registered transactions and outputs. Upon notification, it would pass along the
11223 * matching transactions using this interface.
11227 * The intended use is as follows:
11228 * - Call [`transactions_confirmed`] to process any on-chain activity of interest.
11229 * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`]
11230 * that has been reorganized out of the chain.
11231 * - Call [`best_block_updated`] whenever a new chain tip becomes available.
11235 * Clients must call these methods in chain order. Specifically:
11236 * - Transactions confirmed in a block must be given before transactions confirmed in a later
11238 * - Dependent transactions within the same block must be given in topological order, possibly in
11240 * - Unconfirmed transactions must be given after the original confirmations and before any
11243 * See individual method documentation for further details.
11245 * [`transactions_confirmed`]: Self::transactions_confirmed
11246 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
11247 * [`best_block_updated`]: Self::best_block_updated
11248 * [`get_relevant_txids`]: Self::get_relevant_txids
11250 typedef struct LDKConfirm {
11252 * An opaque pointer which is passed to your function implementations as an argument.
11253 * This has no meaning in the LDK, and can be NULL or any other value.
11257 * Processes transactions confirmed in a block with a given header and height.
11259 * Should be called for any transactions registered by [`Filter::register_tx`] or any
11260 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
11261 * appearing in the same block do not need to be included in the same call; instead, multiple
11262 * calls with additional transactions may be made so long as they are made in [chain order].
11264 * May be called before or after [`best_block_updated`] for the corresponding block. However,
11265 * in the event of a chain reorganization, it must not be called with a `header` that is no
11266 * longer in the chain as of the last call to [`best_block_updated`].
11268 * [chain order]: Confirm#Order
11269 * [`best_block_updated`]: Self::best_block_updated
11271 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
11273 * Processes a transaction that is no longer confirmed as result of a chain reorganization.
11275 * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
11276 * reorganized out of the best chain. Once called, the given transaction should not be returned
11277 * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`].
11279 * [`get_relevant_txids`]: Self::get_relevant_txids
11280 * [`transactions_confirmed`]: Self::transactions_confirmed
11282 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
11284 * Processes an update to the best header connected at the given height.
11286 * Should be called when a new header is available but may be skipped for intermediary blocks
11287 * if they become available at the same time.
11289 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
11291 * Returns transactions that should be monitored for reorganization out of the chain.
11293 * Should include any transactions passed to [`transactions_confirmed`] that have insufficient
11294 * confirmations to be safe from a chain reorganization. Should not include any transactions
11295 * passed to [`transaction_unconfirmed`] unless later reconfirmed.
11297 * May be called to determine the subset of transactions that must still be monitored for
11298 * reorganization. Will be idempotent between calls but may change as a result of calls to the
11299 * other interface methods. Thus, this is useful to determine which transactions may need to be
11300 * given to [`transaction_unconfirmed`].
11302 * [`transactions_confirmed`]: Self::transactions_confirmed
11303 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
11305 struct LDKCVec_TxidZ (*get_relevant_txids)(const void *this_arg);
11307 * Frees any resources associated with this object given its this_arg pointer.
11308 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11310 void (*free)(void *this_arg);
11316 * An opaque identifier describing a specific [`Persist`] method call.
11318 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
11320 * A pointer to the opaque Rust object.
11321 * Nearly everywhere, inner must be non-null, however in places where
11322 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11324 LDKnativeMonitorUpdateId *inner;
11326 * Indicates that this is the only struct which contains the same pointer.
11327 * Rust functions which take ownership of an object provided via an argument require
11328 * this to be true and invalidate the object pointed to by inner.
11331 } LDKMonitorUpdateId;
11334 * `Persist` defines behavior for persisting channel monitors: this could mean
11335 * writing once to disk, and/or uploading to one or more backup services.
11337 * Each method can return three possible values:
11338 * * If persistence (including any relevant `fsync()` calls) happens immediately, the
11339 * implementation should return `Ok(())`, indicating normal channel operation should continue.
11340 * * If persistence happens asynchronously, implementations should first ensure the
11341 * [`ChannelMonitor`] or [`ChannelMonitorUpdate`] are written durably to disk, and then return
11342 * `Err(ChannelMonitorUpdateErr::TemporaryFailure)` while the update continues in the
11343 * background. Once the update completes, [`ChainMonitor::channel_monitor_updated`] should be
11344 * called with the corresponding [`MonitorUpdateId`].
11346 * Note that unlike the direct [`chain::Watch`] interface,
11347 * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
11349 * * If persistence fails for some reason, implementations should return
11350 * `Err(ChannelMonitorUpdateErr::PermanentFailure)`, in which case the channel will likely be
11351 * closed without broadcasting the latest state. See
11352 * [`ChannelMonitorUpdateErr::PermanentFailure`] for more details.
11354 typedef struct LDKPersist {
11356 * An opaque pointer which is passed to your function implementations as an argument.
11357 * This has no meaning in the LDK, and can be NULL or any other value.
11361 * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
11362 * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
11364 * The data can be stored any way you want, but the identifier provided by LDK is the
11365 * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
11366 * and the stored channel data). Note that you **must** persist every new monitor to disk.
11368 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
11369 * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
11371 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
11372 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
11374 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11375 * [`Writeable::write`]: crate::util::ser::Writeable::write
11377 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
11379 * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
11382 * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
11383 * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
11386 * During blockchain synchronization operations, this may be called with no
11387 * [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
11388 * Note that after the full [`ChannelMonitor`] is persisted any previous
11389 * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
11390 * applied to the persisted [`ChannelMonitor`] as they were already applied.
11392 * If an implementer chooses to persist the updates only, they need to make
11393 * sure that all the updates are applied to the `ChannelMonitors` *before*
11394 * the set of channel monitors is given to the `ChannelManager`
11395 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
11396 * applying a monitor update to a monitor. If full `ChannelMonitors` are
11397 * persisted, then there is no need to persist individual updates.
11399 * Note that there could be a performance tradeoff between persisting complete
11400 * channel monitors on every update vs. persisting only updates and applying
11401 * them in batches. The size of each monitor grows `O(number of state updates)`
11402 * whereas updates are small and `O(1)`.
11404 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
11405 * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
11407 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
11408 * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
11409 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
11411 * [`Writeable::write`]: crate::util::ser::Writeable::write
11413 * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
11415 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
11417 * Frees any resources associated with this object given its this_arg pointer.
11418 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11420 void (*free)(void *this_arg);
11426 * An implementation of [`chain::Watch`] for monitoring channels.
11428 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
11429 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
11430 * or used independently to monitor channels remotely. See the [module-level documentation] for
11433 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11434 * [module-level documentation]: crate::chain::chainmonitor
11436 typedef struct MUST_USE_STRUCT LDKChainMonitor {
11438 * A pointer to the opaque Rust object.
11439 * Nearly everywhere, inner must be non-null, however in places where
11440 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11442 LDKnativeChainMonitor *inner;
11444 * Indicates that this is the only struct which contains the same pointer.
11445 * Rust functions which take ownership of an object provided via an argument require
11446 * this to be true and invalidate the object pointed to by inner.
11454 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
11455 * and derives keys from that.
11457 * Your node_id is seed/0'
11458 * ChannelMonitor closes may use seed/1'
11459 * Cooperative closes may use seed/2'
11460 * The two close keys may be needed to claim on-chain funds!
11462 * This struct cannot be used for nodes that wish to support receiving phantom payments;
11463 * [`PhantomKeysManager`] must be used instead.
11465 * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
11466 * previously issued invoices and attempts to pay previous invoices will fail.
11468 typedef struct MUST_USE_STRUCT LDKKeysManager {
11470 * A pointer to the opaque Rust object.
11471 * Nearly everywhere, inner must be non-null, however in places where
11472 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11474 LDKnativeKeysManager *inner;
11476 * Indicates that this is the only struct which contains the same pointer.
11477 * Rust functions which take ownership of an object provided via an argument require
11478 * this to be true and invalidate the object pointed to by inner.
11486 * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
11489 * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
11490 * paid to one of multiple nodes. This works because we encode the invoice route hints such that
11491 * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
11492 * itself without ever needing to forward to this fake node.
11494 * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
11495 * provide some fault tolerance, because payers will automatically retry paying other provided
11496 * nodes in the case that one node goes down.
11498 * Note that multi-path payments are not supported in phantom invoices for security reasons.
11499 * Switching between this struct and [`KeysManager`] will invalidate any previously issued
11500 * invoices and attempts to pay previous invoices will fail.
11502 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
11504 * A pointer to the opaque Rust object.
11505 * Nearly everywhere, inner must be non-null, however in places where
11506 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11508 LDKnativePhantomKeysManager *inner;
11510 * Indicates that this is the only struct which contains the same pointer.
11511 * Rust functions which take ownership of an object provided via an argument require
11512 * this to be true and invalidate the object pointed to by inner.
11515 } LDKPhantomKeysManager;
11520 * Chain-related parameters used to construct a new `ChannelManager`.
11522 * Typically, the block-specific parameters are derived from the best block hash for the network,
11523 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
11524 * are not needed when deserializing a previously constructed `ChannelManager`.
11526 typedef struct MUST_USE_STRUCT LDKChainParameters {
11528 * A pointer to the opaque Rust object.
11529 * Nearly everywhere, inner must be non-null, however in places where
11530 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11532 LDKnativeChainParameters *inner;
11534 * Indicates that this is the only struct which contains the same pointer.
11535 * Rust functions which take ownership of an object provided via an argument require
11536 * this to be true and invalidate the object pointed to by inner.
11539 } LDKChainParameters;
11542 * A 3-byte byte array.
11544 typedef struct LDKThreeBytes {
11552 * A trait to describe an object which can receive channel messages.
11554 * Messages MAY be called in parallel when they originate from different their_node_ids, however
11555 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
11557 typedef struct LDKChannelMessageHandler {
11559 * An opaque pointer which is passed to your function implementations as an argument.
11560 * This has no meaning in the LDK, and can be NULL or any other value.
11564 * Handle an incoming open_channel message from the given peer.
11566 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
11568 * Handle an incoming accept_channel message from the given peer.
11570 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
11572 * Handle an incoming funding_created message from the given peer.
11574 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
11576 * Handle an incoming funding_signed message from the given peer.
11578 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
11580 * Handle an incoming channel_ready message from the given peer.
11582 void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
11584 * Handle an incoming shutdown message from the given peer.
11586 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);
11588 * Handle an incoming closing_signed message from the given peer.
11590 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
11592 * Handle an incoming update_add_htlc message from the given peer.
11594 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
11596 * Handle an incoming update_fulfill_htlc message from the given peer.
11598 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
11600 * Handle an incoming update_fail_htlc message from the given peer.
11602 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
11604 * Handle an incoming update_fail_malformed_htlc message from the given peer.
11606 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
11608 * Handle an incoming commitment_signed message from the given peer.
11610 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
11612 * Handle an incoming revoke_and_ack message from the given peer.
11614 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
11616 * Handle an incoming update_fee message from the given peer.
11618 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
11620 * Handle an incoming announcement_signatures message from the given peer.
11622 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
11624 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
11625 * is believed to be possible in the future (eg they're sending us messages we don't
11626 * understand or indicate they require unknown feature bits), no_connection_possible is set
11627 * and any outstanding channels should be failed.
11629 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
11631 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
11633 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
11635 * Handle an incoming channel_reestablish message from the given peer.
11637 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
11639 * Handle an incoming channel update from the given peer.
11641 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
11643 * Handle an incoming error message from the given peer.
11645 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
11647 * Implementation of MessageSendEventsProvider for this object.
11649 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
11651 * Frees any resources associated with this object given its this_arg pointer.
11652 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11654 void (*free)(void *this_arg);
11655 } LDKChannelMessageHandler;
11660 * Arguments for the creation of a ChannelManager that are not deserialized.
11662 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
11664 * 1) Deserialize all stored [`ChannelMonitor`]s.
11665 * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
11666 * `<(BlockHash, ChannelManager)>::read(reader, args)`
11667 * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
11668 * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
11669 * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
11670 * same way you would handle a [`chain::Filter`] call using
11671 * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
11672 * 4) Reconnect blocks on your [`ChannelMonitor`]s.
11673 * 5) Disconnect/connect blocks on the [`ChannelManager`].
11674 * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
11675 * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
11676 * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
11678 * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
11679 * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
11681 * Note that the ordering of #4-7 is not of importance, however all four must occur before you
11682 * call any other methods on the newly-deserialized [`ChannelManager`].
11684 * Note that because some channels may be closed during deserialization, it is critical that you
11685 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
11686 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
11687 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
11688 * not force-close the same channels but consider them live), you may end up revoking a state for
11689 * which you've already broadcasted the transaction.
11691 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
11693 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
11695 * A pointer to the opaque Rust object.
11696 * Nearly everywhere, inner must be non-null, however in places where
11697 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11699 LDKnativeChannelManagerReadArgs *inner;
11701 * Indicates that this is the only struct which contains the same pointer.
11702 * Rust functions which take ownership of an object provided via an argument require
11703 * this to be true and invalidate the object pointed to by inner.
11706 } LDKChannelManagerReadArgs;
11711 * A set of keys that were HKDF-expanded from an initial call to
11712 * [`KeysInterface::get_inbound_payment_key_material`].
11714 * [`KeysInterface::get_inbound_payment_key_material`]: crate::chain::keysinterface::KeysInterface::get_inbound_payment_key_material
11716 typedef struct MUST_USE_STRUCT LDKExpandedKey {
11718 * A pointer to the opaque Rust object.
11719 * Nearly everywhere, inner must be non-null, however in places where
11720 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11722 LDKnativeExpandedKey *inner;
11724 * Indicates that this is the only struct which contains the same pointer.
11725 * Rust functions which take ownership of an object provided via an argument require
11726 * this to be true and invalidate the object pointed to by inner.
11734 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
11735 * This is used to convince the recipient that the channel is at a certain commitment
11736 * number even if they lost that data due to a local failure. Of course, the peer may lie
11737 * and even later commitments may have been revoked.
11739 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
11741 * A pointer to the opaque Rust object.
11742 * Nearly everywhere, inner must be non-null, however in places where
11743 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11745 LDKnativeDataLossProtect *inner;
11747 * Indicates that this is the only struct which contains the same pointer.
11748 * Rust functions which take ownership of an object provided via an argument require
11749 * this to be true and invalidate the object pointed to by inner.
11752 } LDKDataLossProtect;
11755 * A trait to describe an object which can receive routing messages.
11757 * # Implementor DoS Warnings
11759 * For `gossip_queries` messages there are potential DoS vectors when handling
11760 * inbound queries. Implementors using an on-disk network graph should be aware of
11761 * repeated disk I/O for queries accessing different parts of the network graph.
11763 typedef struct LDKRoutingMessageHandler {
11765 * An opaque pointer which is passed to your function implementations as an argument.
11766 * This has no meaning in the LDK, and can be NULL or any other value.
11770 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
11771 * false or returning an Err otherwise.
11773 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
11775 * Handle a channel_announcement message, returning true if it should be forwarded on, false
11776 * or returning an Err otherwise.
11778 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
11780 * Handle an incoming channel_update message, returning true if it should be forwarded on,
11781 * false or returning an Err otherwise.
11783 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
11785 * Gets a subset of the channel announcements and updates required to dump our routing table
11786 * to a remote node, starting at the short_channel_id indicated by starting_point and
11787 * including the batch_amount entries immediately higher in numerical value than starting_point.
11789 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
11791 * Gets a subset of the node announcements required to dump our routing table to a remote node,
11792 * starting at the node *after* the provided publickey and including batch_amount entries
11793 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
11794 * If None is provided for starting_point, we start at the first node.
11796 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
11798 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
11800 * Called when a connection is established with a peer. This can be used to
11801 * perform routing table synchronization using a strategy defined by the
11804 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
11806 * Handles the reply of a query we initiated to learn about channels
11807 * for a given range of blocks. We can expect to receive one or more
11808 * replies to a single query.
11810 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
11812 * Handles the reply of a query we initiated asking for routing gossip
11813 * messages for a list of channels. We should receive this message when
11814 * a node has completed its best effort to send us the pertaining routing
11817 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
11819 * Handles when a peer asks us to send a list of short_channel_ids
11820 * for the requested range of blocks.
11822 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
11824 * Handles when a peer asks us to send routing gossip messages for a
11825 * list of short_channel_ids.
11827 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
11829 * Implementation of MessageSendEventsProvider for this object.
11831 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
11833 * Frees any resources associated with this object given its this_arg pointer.
11834 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11836 void (*free)(void *this_arg);
11837 } LDKRoutingMessageHandler;
11840 * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
11843 typedef struct LDKCustomMessageReader {
11845 * An opaque pointer which is passed to your function implementations as an argument.
11846 * This has no meaning in the LDK, and can be NULL or any other value.
11850 * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
11851 * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
11852 * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
11853 * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
11855 struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
11857 * Frees any resources associated with this object given its this_arg pointer.
11858 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11860 void (*free)(void *this_arg);
11861 } LDKCustomMessageReader;
11864 * Handler for BOLT1-compliant messages.
11866 typedef struct LDKCustomMessageHandler {
11868 * An opaque pointer which is passed to your function implementations as an argument.
11869 * This has no meaning in the LDK, and can be NULL or any other value.
11873 * Called with the message type that was received and the buffer to be read.
11874 * Can return a `MessageHandlingError` if the message could not be handled.
11876 struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
11878 * Gets the list of pending messages which were generated by the custom message
11879 * handler, clearing the list in the process. The first tuple element must
11880 * correspond to the intended recipients node ids. If no connection to one of the
11881 * specified node does not exist, the message is simply not sent to it.
11883 struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
11885 * Implementation of CustomMessageReader for this object.
11887 struct LDKCustomMessageReader CustomMessageReader;
11889 * Frees any resources associated with this object given its this_arg pointer.
11890 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11892 void (*free)(void *this_arg);
11893 } LDKCustomMessageHandler;
11898 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
11899 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
11901 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
11903 * A pointer to the opaque Rust object.
11904 * Nearly everywhere, inner must be non-null, however in places where
11905 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11907 LDKnativeIgnoringMessageHandler *inner;
11909 * Indicates that this is the only struct which contains the same pointer.
11910 * Rust functions which take ownership of an object provided via an argument require
11911 * this to be true and invalidate the object pointed to by inner.
11914 } LDKIgnoringMessageHandler;
11919 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
11920 * You can provide one of these as the route_handler in a MessageHandler.
11922 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
11924 * A pointer to the opaque Rust object.
11925 * Nearly everywhere, inner must be non-null, however in places where
11926 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11928 LDKnativeErroringMessageHandler *inner;
11930 * Indicates that this is the only struct which contains the same pointer.
11931 * Rust functions which take ownership of an object provided via an argument require
11932 * this to be true and invalidate the object pointed to by inner.
11935 } LDKErroringMessageHandler;
11940 * Provides references to trait impls which handle different types of messages.
11942 typedef struct MUST_USE_STRUCT LDKMessageHandler {
11944 * A pointer to the opaque Rust object.
11945 * Nearly everywhere, inner must be non-null, however in places where
11946 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11948 LDKnativeMessageHandler *inner;
11950 * Indicates that this is the only struct which contains the same pointer.
11951 * Rust functions which take ownership of an object provided via an argument require
11952 * this to be true and invalidate the object pointed to by inner.
11955 } LDKMessageHandler;
11958 * Provides an object which can be used to send data to and which uniquely identifies a connection
11959 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
11960 * implement Hash to meet the PeerManager API.
11962 * For efficiency, Clone should be relatively cheap for this type.
11964 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
11965 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
11966 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
11967 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
11968 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
11969 * to simply use another value which is guaranteed to be globally unique instead.
11971 typedef struct LDKSocketDescriptor {
11973 * An opaque pointer which is passed to your function implementations as an argument.
11974 * This has no meaning in the LDK, and can be NULL or any other value.
11978 * Attempts to send some data from the given slice to the peer.
11980 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
11981 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
11982 * called and further write attempts may occur until that time.
11984 * If the returned size is smaller than `data.len()`, a
11985 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
11986 * written. Additionally, until a `send_data` event completes fully, no further
11987 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
11988 * prevent denial-of-service issues, you should not read or buffer any data from the socket
11991 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
11992 * (indicating that read events should be paused to prevent DoS in the send buffer),
11993 * `resume_read` may be set indicating that read events on this descriptor should resume. A
11994 * `resume_read` of false carries no meaning, and should not cause any action.
11996 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
11998 * Disconnect the socket pointed to by this SocketDescriptor.
12000 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
12001 * call (doing so is a noop).
12003 void (*disconnect_socket)(void *this_arg);
12005 * Checks if two objects are equal given this object's this_arg pointer and another object.
12007 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
12009 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
12010 * This is used, for example, for inclusion of this object in a hash map.
12012 uint64_t (*hash)(const void *this_arg);
12014 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
12015 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
12016 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
12018 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
12020 * Frees any resources associated with this object given its this_arg pointer.
12021 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12023 void (*free)(void *this_arg);
12024 } LDKSocketDescriptor;
12029 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
12030 * socket events into messages which it passes on to its [`MessageHandler`].
12032 * Locks are taken internally, so you must never assume that reentrancy from a
12033 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
12035 * Calls to [`read_event`] will decode relevant messages and pass them to the
12036 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
12037 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
12038 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
12039 * calls only after previous ones have returned.
12041 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
12042 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
12043 * essentially you should default to using a SimpleRefPeerManager, and use a
12044 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
12045 * you're using lightning-net-tokio.
12047 * [`read_event`]: PeerManager::read_event
12049 typedef struct MUST_USE_STRUCT LDKPeerManager {
12051 * A pointer to the opaque Rust object.
12052 * Nearly everywhere, inner must be non-null, however in places where
12053 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12055 LDKnativePeerManager *inner;
12057 * Indicates that this is the only struct which contains the same pointer.
12058 * Rust functions which take ownership of an object provided via an argument require
12059 * this to be true and invalidate the object pointed to by inner.
12067 * Static channel fields used to build transactions given per-commitment fields, organized by
12068 * broadcaster/countersignatory.
12070 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
12071 * as_holder_broadcastable and as_counterparty_broadcastable functions.
12073 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
12075 * A pointer to the opaque Rust object.
12076 * Nearly everywhere, inner must be non-null, however in places where
12077 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12079 LDKnativeDirectedChannelTransactionParameters *inner;
12081 * Indicates that this is the only struct which contains the same pointer.
12082 * Rust functions which take ownership of an object provided via an argument require
12083 * this to be true and invalidate the object pointed to by inner.
12086 } LDKDirectedChannelTransactionParameters;
12089 * Integer in the range `0..=16`
12091 typedef struct LDKWitnessVersion {
12093 } LDKWitnessVersion;
12098 * A read-only view of [`NetworkGraph`].
12100 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
12102 * A pointer to the opaque Rust object.
12103 * Nearly everywhere, inner must be non-null, however in places where
12104 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12106 LDKnativeReadOnlyNetworkGraph *inner;
12108 * Indicates that this is the only struct which contains the same pointer.
12109 * Rust functions which take ownership of an object provided via an argument require
12110 * this to be true and invalidate the object pointed to by inner.
12113 } LDKReadOnlyNetworkGraph;
12118 * Receives and validates network updates from peers,
12119 * stores authentic and relevant data as a network graph.
12120 * This network graph is then used for routing payments.
12121 * Provides interface to help with initial routing sync by
12122 * serving historical announcements.
12124 * Serves as an [`EventHandler`] for applying updates from [`Event::PaymentPathFailed`] to the
12125 * [`NetworkGraph`].
12127 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
12129 * A pointer to the opaque Rust object.
12130 * Nearly everywhere, inner must be non-null, however in places where
12131 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12133 LDKnativeP2PGossipSync *inner;
12135 * Indicates that this is the only struct which contains the same pointer.
12136 * Rust functions which take ownership of an object provided via an argument require
12137 * this to be true and invalidate the object pointed to by inner.
12140 } LDKP2PGossipSync;
12145 * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
12146 * source node to a target node.
12148 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
12150 * A pointer to the opaque Rust object.
12151 * Nearly everywhere, inner must be non-null, however in places where
12152 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12154 LDKnativeDirectedChannelInfo *inner;
12156 * Indicates that this is the only struct which contains the same pointer.
12157 * Rust functions which take ownership of an object provided via an argument require
12158 * this to be true and invalidate the object pointed to by inner.
12161 } LDKDirectedChannelInfo;
12164 * The effective capacity of a channel for routing purposes.
12166 * While this may be smaller than the actual channel capacity, amounts greater than
12167 * [`Self::as_msat`] should not be routed through the channel.
12169 typedef enum LDKEffectiveCapacity_Tag {
12171 * The available liquidity in the channel known from being a channel counterparty, and thus a
12174 LDKEffectiveCapacity_ExactLiquidity,
12176 * The maximum HTLC amount in one direction as advertised on the gossip network.
12178 LDKEffectiveCapacity_MaximumHTLC,
12180 * The total capacity of the channel as determined by the funding transaction.
12182 LDKEffectiveCapacity_Total,
12184 * A capacity sufficient to route any payment, typically used for private channels provided by
12187 LDKEffectiveCapacity_Infinite,
12189 * A capacity that is unknown possibly because either the chain state is unavailable to know
12190 * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
12192 LDKEffectiveCapacity_Unknown,
12194 * Must be last for serialization purposes
12196 LDKEffectiveCapacity_Sentinel,
12197 } LDKEffectiveCapacity_Tag;
12199 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
12201 * Either the inbound or outbound liquidity depending on the direction, denominated in
12204 uint64_t liquidity_msat;
12205 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
12207 typedef struct LDKEffectiveCapacity_LDKMaximumHTLC_Body {
12209 * The maximum HTLC amount denominated in millisatoshi.
12211 uint64_t amount_msat;
12212 } LDKEffectiveCapacity_LDKMaximumHTLC_Body;
12214 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
12216 * The funding amount denominated in millisatoshi.
12218 uint64_t capacity_msat;
12219 } LDKEffectiveCapacity_LDKTotal_Body;
12221 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
12222 LDKEffectiveCapacity_Tag tag;
12224 LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
12225 LDKEffectiveCapacity_LDKMaximumHTLC_Body maximum_htlc;
12226 LDKEffectiveCapacity_LDKTotal_Body total;
12228 } LDKEffectiveCapacity;
12231 * A scorer that is accessed under a lock.
12233 * Needed so that calls to [`Score::channel_penalty_msat`] in [`find_route`] can be made while
12234 * having shared ownership of a scorer but without requiring internal locking in [`Score`]
12235 * implementations. Internal locking would be detrimental to route finding performance and could
12236 * result in [`Score::channel_penalty_msat`] returning a different value for the same channel.
12238 * [`find_route`]: crate::routing::router::find_route
12240 typedef struct LDKLockableScore {
12242 * An opaque pointer which is passed to your function implementations as an argument.
12243 * This has no meaning in the LDK, and can be NULL or any other value.
12247 * Returns the locked scorer.
12249 struct LDKScore (*lock)(const void *this_arg);
12251 * Frees any resources associated with this object given its this_arg pointer.
12252 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12254 void (*free)(void *this_arg);
12255 } LDKLockableScore;
12260 * Parameters for configuring [`ProbabilisticScorer`].
12262 * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
12263 * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
12265 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringParameters {
12267 * A pointer to the opaque Rust object.
12268 * Nearly everywhere, inner must be non-null, however in places where
12269 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12271 LDKnativeProbabilisticScoringParameters *inner;
12273 * Indicates that this is the only struct which contains the same pointer.
12274 * Rust functions which take ownership of an object provided via an argument require
12275 * this to be true and invalidate the object pointed to by inner.
12278 } LDKProbabilisticScoringParameters;
12283 * FilesystemPersister persists channel data on disk, where each channel's
12284 * data is stored in a file named after its funding outpoint.
12286 * Warning: this module does the best it can with calls to persist data, but it
12287 * can only guarantee that the data is passed to the drive. It is up to the
12288 * drive manufacturers to do the actual persistence properly, which they often
12289 * don't (especially on consumer-grade hardware). Therefore, it is up to the
12290 * user to validate their entire storage stack, to ensure the writes are
12292 * Corollary: especially when dealing with larger amounts of money, it is best
12293 * practice to have multiple channel data backups and not rely only on one
12294 * FilesystemPersister.
12296 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
12298 * A pointer to the opaque Rust object.
12299 * Nearly everywhere, inner must be non-null, however in places where
12300 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12302 LDKnativeFilesystemPersister *inner;
12304 * Indicates that this is the only struct which contains the same pointer.
12305 * Rust functions which take ownership of an object provided via an argument require
12306 * this to be true and invalidate the object pointed to by inner.
12309 } LDKFilesystemPersister;
12314 * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
12315 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
12316 * responsibilities are:
12317 * * Processing [`Event`]s with a user-provided [`EventHandler`].
12318 * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
12319 * writing it to disk/backups by invoking the callback given to it at startup.
12320 * [`ChannelManager`] persistence should be done in the background.
12321 * * Calling [`ChannelManager::timer_tick_occurred`] and [`PeerManager::timer_tick_occurred`]
12322 * at the appropriate intervals.
12323 * * Calling [`NetworkGraph::remove_stale_channels`] (if a [`GossipSync`] with a [`NetworkGraph`]
12324 * is provided to [`BackgroundProcessor::start`]).
12326 * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
12327 * upon as doing so may result in high latency.
12331 * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
12332 * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
12333 * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
12334 * unilateral chain closure fees are at risk.
12336 * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
12337 * [`Event`]: lightning::util::events::Event
12338 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
12340 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
12342 * A pointer to the opaque Rust object.
12343 * Nearly everywhere, inner must be non-null, however in places where
12344 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12346 LDKnativeBackgroundProcessor *inner;
12348 * Indicates that this is the only struct which contains the same pointer.
12349 * Rust functions which take ownership of an object provided via an argument require
12350 * this to be true and invalidate the object pointed to by inner.
12353 } LDKBackgroundProcessor;
12358 * Rapid Gossip Sync struct
12359 * See [crate-level documentation] for usage.
12361 * [crate-level documentation]: crate
12363 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
12365 * A pointer to the opaque Rust object.
12366 * Nearly everywhere, inner must be non-null, however in places where
12367 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12369 LDKnativeRapidGossipSync *inner;
12371 * Indicates that this is the only struct which contains the same pointer.
12372 * Rust functions which take ownership of an object provided via an argument require
12373 * this to be true and invalidate the object pointed to by inner.
12376 } LDKRapidGossipSync;
12379 * Either [`P2PGossipSync`] or [`RapidGossipSync`].
12381 typedef enum LDKGossipSync_Tag {
12383 * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
12387 * Rapid gossip sync from a trusted server.
12389 LDKGossipSync_Rapid,
12393 LDKGossipSync_None,
12395 * Must be last for serialization purposes
12397 LDKGossipSync_Sentinel,
12398 } LDKGossipSync_Tag;
12400 typedef struct MUST_USE_STRUCT LDKGossipSync {
12401 LDKGossipSync_Tag tag;
12405 * Note that this field is expected to be a reference.
12407 struct LDKP2PGossipSync p2p;
12411 * Note that this field is expected to be a reference.
12413 struct LDKRapidGossipSync rapid;
12421 * Data of the `RawInvoice` that is encoded in the data part
12423 typedef struct MUST_USE_STRUCT LDKRawDataPart {
12425 * A pointer to the opaque Rust object.
12426 * Nearly everywhere, inner must be non-null, however in places where
12427 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12429 LDKnativeRawDataPart *inner;
12431 * Indicates that this is the only struct which contains the same pointer.
12432 * Rust functions which take ownership of an object provided via an argument require
12433 * this to be true and invalidate the object pointed to by inner.
12443 typedef struct MUST_USE_STRUCT LDKSha256 {
12445 * A pointer to the opaque Rust object.
12446 * Nearly everywhere, inner must be non-null, however in places where
12447 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12449 LDKnativeSha256 *inner;
12451 * Indicates that this is the only struct which contains the same pointer.
12452 * Rust functions which take ownership of an object provided via an argument require
12453 * this to be true and invalidate the object pointed to by inner.
12461 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
12464 typedef struct MUST_USE_STRUCT LDKExpiryTime {
12466 * A pointer to the opaque Rust object.
12467 * Nearly everywhere, inner must be non-null, however in places where
12468 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12470 LDKnativeExpiryTime *inner;
12472 * Indicates that this is the only struct which contains the same pointer.
12473 * Rust functions which take ownership of an object provided via an argument require
12474 * this to be true and invalidate the object pointed to by inner.
12482 * `min_final_cltv_expiry` to use for the last HTLC in the route
12484 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiry {
12486 * A pointer to the opaque Rust object.
12487 * Nearly everywhere, inner must be non-null, however in places where
12488 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12490 LDKnativeMinFinalCltvExpiry *inner;
12492 * Indicates that this is the only struct which contains the same pointer.
12493 * Rust functions which take ownership of an object provided via an argument require
12494 * this to be true and invalidate the object pointed to by inner.
12497 } LDKMinFinalCltvExpiry;
12500 * A 20-byte byte array.
12502 typedef struct LDKTwentyBytes {
12510 * Fallback address in case no LN payment is possible
12512 typedef enum LDKFallback_Tag {
12513 LDKFallback_SegWitProgram,
12514 LDKFallback_PubKeyHash,
12515 LDKFallback_ScriptHash,
12517 * Must be last for serialization purposes
12519 LDKFallback_Sentinel,
12522 typedef struct LDKFallback_LDKSegWitProgram_Body {
12523 struct LDKu5 version;
12524 struct LDKCVec_u8Z program;
12525 } LDKFallback_LDKSegWitProgram_Body;
12527 typedef struct MUST_USE_STRUCT LDKFallback {
12528 LDKFallback_Tag tag;
12530 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
12532 struct LDKTwentyBytes pub_key_hash;
12535 struct LDKTwentyBytes script_hash;
12541 * A trait defining behavior of an [`Invoice`] payer.
12543 typedef struct LDKPayer {
12545 * An opaque pointer which is passed to your function implementations as an argument.
12546 * This has no meaning in the LDK, and can be NULL or any other value.
12550 * Returns the payer's node id.
12552 struct LDKPublicKey (*node_id)(const void *this_arg);
12554 * Returns the payer's channels.
12556 struct LDKCVec_ChannelDetailsZ (*first_hops)(const void *this_arg);
12558 * Sends a payment over the Lightning Network using the given [`Route`].
12560 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
12562 struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
12564 * Sends a spontaneous payment over the Lightning Network using the given [`Route`].
12566 struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_spontaneous_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage);
12568 * Retries a failed payment path for the [`PaymentId`] using the given [`Route`].
12570 struct LDKCResult_NonePaymentSendFailureZ (*retry_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id);
12572 * Signals that no further retries for the given payment will occur.
12574 void (*abandon_payment)(const void *this_arg, struct LDKThirtyTwoBytes payment_id);
12576 * Frees any resources associated with this object given its this_arg pointer.
12577 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12579 void (*free)(void *this_arg);
12583 * A trait defining behavior for routing an [`Invoice`] payment.
12585 typedef struct LDKRouter {
12587 * An opaque pointer which is passed to your function implementations as an argument.
12588 * This has no meaning in the LDK, and can be NULL or any other value.
12592 * Finds a [`Route`] between `payer` and `payee` for a payment with the given values.
12594 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
12596 struct LDKCResult_RouteLightningErrorZ (*find_route)(const void *this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, const uint8_t (*payment_hash)[32], struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKScore *NONNULL_PTR scorer);
12598 * Frees any resources associated with this object given its this_arg pointer.
12599 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12601 void (*free)(void *this_arg);
12607 * A utility for paying [`Invoice`]s and sending spontaneous payments.
12609 * See [module-level documentation] for details.
12611 * [module-level documentation]: crate::payment
12613 typedef struct MUST_USE_STRUCT LDKInvoicePayer {
12615 * A pointer to the opaque Rust object.
12616 * Nearly everywhere, inner must be non-null, however in places where
12617 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12619 LDKnativeInvoicePayer *inner;
12621 * Indicates that this is the only struct which contains the same pointer.
12622 * Rust functions which take ownership of an object provided via an argument require
12623 * this to be true and invalidate the object pointed to by inner.
12629 * Strategies available to retry payment path failures for an [`Invoice`].
12632 typedef enum LDKRetry_Tag {
12634 * Max number of attempts to retry payment.
12636 * Note that this is the number of *path* failures, not full payment retries. For multi-path
12637 * payments, if this is less than the total number of paths, we will never even retry all of the
12642 * Time elapsed before abandoning retries for a payment.
12646 * Must be last for serialization purposes
12651 typedef struct MUST_USE_STRUCT LDKRetry {
12655 uintptr_t attempts;
12666 * A [`Router`] implemented using [`find_route`].
12668 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
12670 * A pointer to the opaque Rust object.
12671 * Nearly everywhere, inner must be non-null, however in places where
12672 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12674 LDKnativeDefaultRouter *inner;
12676 * Indicates that this is the only struct which contains the same pointer.
12677 * Rust functions which take ownership of an object provided via an argument require
12678 * this to be true and invalidate the object pointed to by inner.
12681 } LDKDefaultRouter;
12683 extern const uintptr_t MAX_BUF_SIZE;
12685 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
12687 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
12689 extern const uint32_t ANTI_REORG_DELAY;
12691 extern const uint16_t BREAKDOWN_TIMEOUT;
12693 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
12695 extern const uint32_t MIN_FINAL_CLTV_EXPIRY;
12697 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
12699 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
12701 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
12703 extern const uint64_t MAX_TIMESTAMP;
12705 extern const uint64_t DEFAULT_EXPIRY_TIME;
12707 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY;
12709 extern const uint8_t TAG_PAYMENT_HASH;
12711 extern const uint8_t TAG_DESCRIPTION;
12713 extern const uint8_t TAG_PAYEE_PUB_KEY;
12715 extern const uint8_t TAG_DESCRIPTION_HASH;
12717 extern const uint8_t TAG_EXPIRY_TIME;
12719 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
12721 extern const uint8_t TAG_FALLBACK;
12723 extern const uint8_t TAG_PRIVATE_ROUTE;
12725 extern const uint8_t TAG_PAYMENT_SECRET;
12727 extern const uint8_t TAG_FEATURES;
12729 struct LDKStr _ldk_get_compiled_version(void);
12731 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
12734 * Creates a new Bech32Error which has the same data as `orig`
12736 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
12739 * Releases any memory held by the given `Bech32Error` (which is currently none)
12741 void Bech32Error_free(struct LDKBech32Error o);
12744 * Frees the data buffer, if data_is_owned is set and datalen > 0.
12746 void Transaction_free(struct LDKTransaction _res);
12749 * Convenience function for constructing a new TxOut
12751 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
12754 * Frees the data pointed to by script_pubkey.
12756 void TxOut_free(struct LDKTxOut _res);
12759 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
12761 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
12764 * Frees the data buffer, if chars_is_owned is set and len > 0.
12766 void Str_free(struct LDKStr _res);
12768 #if defined(LDK_DEBUG_BUILD)
12770 * This function exists for memory safety testing purposes. It should never be used in production
12773 const void *__unmangle_inner_ptr(const void *ptr);
12777 * Creates a new CResult_NoneNoneZ in the success state.
12779 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
12782 * Creates a new CResult_NoneNoneZ in the error state.
12784 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
12787 * Checks if the given object is currently in the success state
12789 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
12792 * Frees any resources used by the CResult_NoneNoneZ.
12794 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
12797 * Creates a new CResult_NoneNoneZ which has the same data as `orig`
12798 * but with all dynamically-allocated buffers duplicated in new buffers.
12800 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
12803 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
12805 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
12808 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
12810 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
12813 * Checks if the given object is currently in the success state
12815 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
12818 * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
12820 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
12823 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
12824 * but with all dynamically-allocated buffers duplicated in new buffers.
12826 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
12829 * Creates a new CResult_SecretKeyErrorZ in the success state.
12831 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
12834 * Creates a new CResult_SecretKeyErrorZ in the error state.
12836 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
12839 * Checks if the given object is currently in the success state
12841 bool CResult_SecretKeyErrorZ_is_ok(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR o);
12844 * Frees any resources used by the CResult_SecretKeyErrorZ.
12846 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
12849 * Creates a new CResult_SecretKeyErrorZ which has the same data as `orig`
12850 * but with all dynamically-allocated buffers duplicated in new buffers.
12852 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_clone(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR orig);
12855 * Creates a new CResult_PublicKeyErrorZ in the success state.
12857 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
12860 * Creates a new CResult_PublicKeyErrorZ in the error state.
12862 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
12865 * Checks if the given object is currently in the success state
12867 bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o);
12870 * Frees any resources used by the CResult_PublicKeyErrorZ.
12872 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
12875 * Creates a new CResult_PublicKeyErrorZ which has the same data as `orig`
12876 * but with all dynamically-allocated buffers duplicated in new buffers.
12878 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig);
12881 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
12883 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
12886 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
12888 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
12891 * Checks if the given object is currently in the success state
12893 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
12896 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
12898 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
12901 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
12902 * but with all dynamically-allocated buffers duplicated in new buffers.
12904 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
12907 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
12909 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
12912 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
12914 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
12917 * Checks if the given object is currently in the success state
12919 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
12922 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
12924 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
12927 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
12928 * but with all dynamically-allocated buffers duplicated in new buffers.
12930 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
12933 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
12935 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
12938 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
12940 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
12943 * Checks if the given object is currently in the success state
12945 bool CResult_TxCreationKeysErrorZ_is_ok(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR o);
12948 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
12950 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
12953 * Creates a new CResult_TxCreationKeysErrorZ which has the same data as `orig`
12954 * but with all dynamically-allocated buffers duplicated in new buffers.
12956 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_clone(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR orig);
12959 * Constructs a new COption_u32Z containing a u32
12961 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
12964 * Constructs a new COption_u32Z containing nothing
12966 struct LDKCOption_u32Z COption_u32Z_none(void);
12969 * Frees any resources associated with the u32, if we are in the Some state
12971 void COption_u32Z_free(struct LDKCOption_u32Z _res);
12974 * Creates a new COption_u32Z which has the same data as `orig`
12975 * but with all dynamically-allocated buffers duplicated in new buffers.
12977 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
12980 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
12982 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
12985 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
12987 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
12990 * Checks if the given object is currently in the success state
12992 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
12995 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
12997 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
13000 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
13001 * but with all dynamically-allocated buffers duplicated in new buffers.
13003 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
13006 * Constructs a new COption_NoneZ containing a
13008 enum LDKCOption_NoneZ COption_NoneZ_some(void);
13011 * Constructs a new COption_NoneZ containing nothing
13013 enum LDKCOption_NoneZ COption_NoneZ_none(void);
13016 * Frees any resources associated with the , if we are in the Some state
13018 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
13021 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
13023 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
13026 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
13028 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
13031 * Checks if the given object is currently in the success state
13033 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
13036 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
13038 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
13041 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
13042 * but with all dynamically-allocated buffers duplicated in new buffers.
13044 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
13047 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
13049 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
13052 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
13054 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
13057 * Checks if the given object is currently in the success state
13059 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
13062 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
13064 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
13067 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
13068 * but with all dynamically-allocated buffers duplicated in new buffers.
13070 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
13073 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13075 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
13078 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
13080 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
13083 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
13085 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
13088 * Checks if the given object is currently in the success state
13090 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
13093 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
13095 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
13098 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
13099 * but with all dynamically-allocated buffers duplicated in new buffers.
13101 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
13104 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
13106 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
13109 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
13111 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
13114 * Checks if the given object is currently in the success state
13116 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
13119 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
13121 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
13124 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
13125 * but with all dynamically-allocated buffers duplicated in new buffers.
13127 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
13130 * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
13132 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
13135 * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
13137 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
13140 * Checks if the given object is currently in the success state
13142 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
13145 * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
13147 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
13150 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
13152 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
13155 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
13157 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
13160 * Checks if the given object is currently in the success state
13162 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
13165 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
13167 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
13170 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
13171 * but with all dynamically-allocated buffers duplicated in new buffers.
13173 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
13176 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
13178 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
13181 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
13183 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
13186 * Checks if the given object is currently in the success state
13188 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
13191 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
13193 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
13196 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
13198 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
13201 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
13203 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
13206 * Checks if the given object is currently in the success state
13208 bool CResult_CVec_SignatureZNoneZ_is_ok(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR o);
13211 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
13213 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
13216 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
13217 * but with all dynamically-allocated buffers duplicated in new buffers.
13219 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
13222 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
13224 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
13227 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
13229 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
13232 * Checks if the given object is currently in the success state
13234 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
13237 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
13239 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
13242 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
13243 * but with all dynamically-allocated buffers duplicated in new buffers.
13245 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
13248 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
13250 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
13253 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
13255 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
13258 * Checks if the given object is currently in the success state
13260 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
13263 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
13265 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
13268 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
13269 * but with all dynamically-allocated buffers duplicated in new buffers.
13271 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
13274 * Creates a new CResult_NoneErrorZ in the success state.
13276 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
13279 * Creates a new CResult_NoneErrorZ in the error state.
13281 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
13284 * Checks if the given object is currently in the success state
13286 bool CResult_NoneErrorZ_is_ok(const struct LDKCResult_NoneErrorZ *NONNULL_PTR o);
13289 * Frees any resources used by the CResult_NoneErrorZ.
13291 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
13294 * Creates a new CResult_NoneErrorZ which has the same data as `orig`
13295 * but with all dynamically-allocated buffers duplicated in new buffers.
13297 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig);
13300 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
13302 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
13305 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
13307 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
13310 * Checks if the given object is currently in the success state
13312 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
13315 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
13317 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
13320 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
13321 * but with all dynamically-allocated buffers duplicated in new buffers.
13323 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
13326 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13328 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
13331 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13333 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
13336 * Creates a new CResult_RouteDecodeErrorZ in the success state.
13338 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
13341 * Creates a new CResult_RouteDecodeErrorZ in the error state.
13343 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
13346 * Checks if the given object is currently in the success state
13348 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
13351 * Frees any resources used by the CResult_RouteDecodeErrorZ.
13353 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
13356 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
13357 * but with all dynamically-allocated buffers duplicated in new buffers.
13359 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
13362 * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
13364 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
13367 * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
13369 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
13372 * Checks if the given object is currently in the success state
13374 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
13377 * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
13379 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
13382 * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
13383 * but with all dynamically-allocated buffers duplicated in new buffers.
13385 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
13388 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13390 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
13393 * Constructs a new COption_u64Z containing a u64
13395 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
13398 * Constructs a new COption_u64Z containing nothing
13400 struct LDKCOption_u64Z COption_u64Z_none(void);
13403 * Frees any resources associated with the u64, if we are in the Some state
13405 void COption_u64Z_free(struct LDKCOption_u64Z _res);
13408 * Creates a new COption_u64Z which has the same data as `orig`
13409 * but with all dynamically-allocated buffers duplicated in new buffers.
13411 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
13414 * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
13416 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
13419 * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
13421 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
13424 * Checks if the given object is currently in the success state
13426 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
13429 * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
13431 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
13434 * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
13435 * but with all dynamically-allocated buffers duplicated in new buffers.
13437 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
13440 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13442 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
13445 * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
13447 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
13450 * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
13452 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
13455 * Checks if the given object is currently in the success state
13457 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
13460 * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
13462 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
13465 * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
13466 * but with all dynamically-allocated buffers duplicated in new buffers.
13468 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
13471 * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
13473 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
13476 * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
13478 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
13481 * Checks if the given object is currently in the success state
13483 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
13486 * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
13488 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
13491 * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
13492 * but with all dynamically-allocated buffers duplicated in new buffers.
13494 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
13497 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13499 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
13502 * Creates a new CResult_RouteLightningErrorZ in the success state.
13504 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
13507 * Creates a new CResult_RouteLightningErrorZ in the error state.
13509 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
13512 * Checks if the given object is currently in the success state
13514 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
13517 * Frees any resources used by the CResult_RouteLightningErrorZ.
13519 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
13522 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
13523 * but with all dynamically-allocated buffers duplicated in new buffers.
13525 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
13528 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13530 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
13533 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
13535 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
13538 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
13540 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
13543 * Checks if the given object is currently in the success state
13545 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
13548 * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
13550 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
13553 * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
13554 * but with all dynamically-allocated buffers duplicated in new buffers.
13556 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
13559 * Constructs a new COption_ClosureReasonZ containing a crate::lightning::util::events::ClosureReason
13561 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
13564 * Constructs a new COption_ClosureReasonZ containing nothing
13566 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
13569 * Frees any resources associated with the crate::lightning::util::events::ClosureReason, if we are in the Some state
13571 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
13574 * Creates a new COption_ClosureReasonZ which has the same data as `orig`
13575 * but with all dynamically-allocated buffers duplicated in new buffers.
13577 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
13580 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
13582 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
13585 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
13587 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
13590 * Checks if the given object is currently in the success state
13592 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
13595 * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
13597 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
13600 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
13601 * but with all dynamically-allocated buffers duplicated in new buffers.
13603 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
13606 * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
13608 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
13611 * Constructs a new COption_NetworkUpdateZ containing nothing
13613 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
13616 * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
13618 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
13621 * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
13622 * but with all dynamically-allocated buffers duplicated in new buffers.
13624 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
13627 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13629 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
13632 * Constructs a new COption_EventZ containing a crate::lightning::util::events::Event
13634 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
13637 * Constructs a new COption_EventZ containing nothing
13639 struct LDKCOption_EventZ COption_EventZ_none(void);
13642 * Frees any resources associated with the crate::lightning::util::events::Event, if we are in the Some state
13644 void COption_EventZ_free(struct LDKCOption_EventZ _res);
13647 * Creates a new COption_EventZ which has the same data as `orig`
13648 * but with all dynamically-allocated buffers duplicated in new buffers.
13650 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
13653 * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
13655 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
13658 * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
13660 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
13663 * Checks if the given object is currently in the success state
13665 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
13668 * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
13670 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
13673 * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
13674 * but with all dynamically-allocated buffers duplicated in new buffers.
13676 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
13679 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13681 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
13684 * Creates a new CResult_TxOutAccessErrorZ in the success state.
13686 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
13689 * Creates a new CResult_TxOutAccessErrorZ in the error state.
13691 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
13694 * Checks if the given object is currently in the success state
13696 bool CResult_TxOutAccessErrorZ_is_ok(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR o);
13699 * Frees any resources used by the CResult_TxOutAccessErrorZ.
13701 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
13704 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
13705 * but with all dynamically-allocated buffers duplicated in new buffers.
13707 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
13710 * Creates a new tuple which has the same data as `orig`
13711 * but with all dynamically-allocated buffers duplicated in new buffers.
13713 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
13716 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
13718 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
13721 * Frees any resources used by the C2Tuple_usizeTransactionZ.
13723 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
13726 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13728 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
13731 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13733 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
13736 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
13738 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
13741 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
13743 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
13746 * Checks if the given object is currently in the success state
13748 bool CResult_NoneChannelMonitorUpdateErrZ_is_ok(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR o);
13751 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
13753 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
13756 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
13757 * but with all dynamically-allocated buffers duplicated in new buffers.
13759 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
13762 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13764 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
13767 * Creates a new tuple which has the same data as `orig`
13768 * but with all dynamically-allocated buffers duplicated in new buffers.
13770 struct LDKC2Tuple_OutPointCVec_MonitorEventZZ C2Tuple_OutPointCVec_MonitorEventZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorEventZZ *NONNULL_PTR orig);
13773 * Creates a new C2Tuple_OutPointCVec_MonitorEventZZ from the contained elements.
13775 struct LDKC2Tuple_OutPointCVec_MonitorEventZZ C2Tuple_OutPointCVec_MonitorEventZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b);
13778 * Frees any resources used by the C2Tuple_OutPointCVec_MonitorEventZZ.
13780 void C2Tuple_OutPointCVec_MonitorEventZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorEventZZ _res);
13783 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13785 void CVec_C2Tuple_OutPointCVec_MonitorEventZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ _res);
13788 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
13790 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
13793 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
13795 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
13798 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
13800 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
13803 * Creates a new COption_C2Tuple_usizeTransactionZZ which has the same data as `orig`
13804 * but with all dynamically-allocated buffers duplicated in new buffers.
13806 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_clone(const struct LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR orig);
13809 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
13811 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
13814 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
13816 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
13819 * Checks if the given object is currently in the success state
13821 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
13824 * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
13826 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
13829 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
13830 * but with all dynamically-allocated buffers duplicated in new buffers.
13832 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
13835 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
13837 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
13840 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
13842 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
13845 * Checks if the given object is currently in the success state
13847 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
13850 * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
13852 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
13855 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
13857 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
13860 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
13862 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
13865 * Checks if the given object is currently in the success state
13867 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
13870 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
13872 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
13875 * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
13876 * but with all dynamically-allocated buffers duplicated in new buffers.
13878 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
13881 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
13883 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
13886 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
13888 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
13891 * Checks if the given object is currently in the success state
13893 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
13896 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
13898 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
13901 * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
13902 * but with all dynamically-allocated buffers duplicated in new buffers.
13904 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
13907 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
13909 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
13912 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
13914 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
13917 * Checks if the given object is currently in the success state
13919 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
13922 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
13924 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
13927 * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
13928 * but with all dynamically-allocated buffers duplicated in new buffers.
13930 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
13933 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
13935 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
13938 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
13940 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
13943 * Checks if the given object is currently in the success state
13945 bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
13948 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
13950 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
13953 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
13954 * but with all dynamically-allocated buffers duplicated in new buffers.
13956 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
13959 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
13961 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
13964 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
13966 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
13969 * Checks if the given object is currently in the success state
13971 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
13974 * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
13976 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
13979 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
13980 * but with all dynamically-allocated buffers duplicated in new buffers.
13982 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
13985 * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
13987 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
13990 * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
13992 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
13995 * Checks if the given object is currently in the success state
13997 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
14000 * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
14002 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
14005 * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
14006 * but with all dynamically-allocated buffers duplicated in new buffers.
14008 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
14011 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
14013 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
14016 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
14018 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
14021 * Checks if the given object is currently in the success state
14023 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
14026 * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
14028 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
14031 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
14032 * but with all dynamically-allocated buffers duplicated in new buffers.
14034 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
14037 * Constructs a new COption_AccessZ containing a crate::lightning::chain::Access
14039 struct LDKCOption_AccessZ COption_AccessZ_some(struct LDKAccess o);
14042 * Constructs a new COption_AccessZ containing nothing
14044 struct LDKCOption_AccessZ COption_AccessZ_none(void);
14047 * Frees any resources associated with the crate::lightning::chain::Access, if we are in the Some state
14049 void COption_AccessZ_free(struct LDKCOption_AccessZ _res);
14052 * Creates a new CResult_boolLightningErrorZ in the success state.
14054 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
14057 * Creates a new CResult_boolLightningErrorZ in the error state.
14059 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
14062 * Checks if the given object is currently in the success state
14064 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
14067 * Frees any resources used by the CResult_boolLightningErrorZ.
14069 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
14072 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
14073 * but with all dynamically-allocated buffers duplicated in new buffers.
14075 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
14078 * Creates a new tuple which has the same data as `orig`
14079 * but with all dynamically-allocated buffers duplicated in new buffers.
14081 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
14084 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
14086 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
14089 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
14091 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
14094 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14096 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
14099 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14101 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
14104 * Creates a new CResult_NoneLightningErrorZ in the success state.
14106 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
14109 * Creates a new CResult_NoneLightningErrorZ in the error state.
14111 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
14114 * Checks if the given object is currently in the success state
14116 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
14119 * Frees any resources used by the CResult_NoneLightningErrorZ.
14121 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
14124 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
14125 * but with all dynamically-allocated buffers duplicated in new buffers.
14127 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
14130 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
14132 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
14135 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
14137 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
14140 * Checks if the given object is currently in the success state
14142 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
14145 * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
14147 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
14150 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
14151 * but with all dynamically-allocated buffers duplicated in new buffers.
14153 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
14156 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
14158 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
14161 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
14163 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
14166 * Checks if the given object is currently in the success state
14168 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
14171 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
14173 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
14176 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
14177 * but with all dynamically-allocated buffers duplicated in new buffers.
14179 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
14182 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
14184 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
14187 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
14189 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
14192 * Checks if the given object is currently in the success state
14194 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
14197 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
14199 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
14202 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
14203 * but with all dynamically-allocated buffers duplicated in new buffers.
14205 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
14208 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14210 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
14213 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
14215 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
14218 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
14220 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
14223 * Checks if the given object is currently in the success state
14225 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
14228 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
14230 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
14233 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
14234 * but with all dynamically-allocated buffers duplicated in new buffers.
14236 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
14239 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14241 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
14244 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
14246 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
14249 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
14251 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
14254 * Checks if the given object is currently in the success state
14256 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
14259 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
14261 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
14264 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
14265 * but with all dynamically-allocated buffers duplicated in new buffers.
14267 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
14270 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
14272 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
14275 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
14277 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
14280 * Checks if the given object is currently in the success state
14282 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
14285 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
14287 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
14290 * Constructs a new COption_CVec_NetAddressZZ containing a crate::c_types::derived::CVec_NetAddressZ
14292 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o);
14295 * Constructs a new COption_CVec_NetAddressZZ containing nothing
14297 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void);
14300 * Frees any resources associated with the crate::c_types::derived::CVec_NetAddressZ, if we are in the Some state
14302 void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res);
14305 * Creates a new COption_CVec_NetAddressZZ which has the same data as `orig`
14306 * but with all dynamically-allocated buffers duplicated in new buffers.
14308 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig);
14311 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
14313 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
14316 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
14318 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
14321 * Checks if the given object is currently in the success state
14323 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
14326 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
14328 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
14331 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
14332 * but with all dynamically-allocated buffers duplicated in new buffers.
14334 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
14337 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
14339 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
14342 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
14344 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
14347 * Checks if the given object is currently in the success state
14349 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
14352 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
14354 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
14357 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
14358 * but with all dynamically-allocated buffers duplicated in new buffers.
14360 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
14363 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
14365 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
14368 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
14370 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
14373 * Checks if the given object is currently in the success state
14375 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
14378 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
14380 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
14383 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
14384 * but with all dynamically-allocated buffers duplicated in new buffers.
14386 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
14389 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14391 void CVec_PaymentPreimageZ_free(struct LDKCVec_PaymentPreimageZ _res);
14394 * Creates a new tuple which has the same data as `orig`
14395 * but with all dynamically-allocated buffers duplicated in new buffers.
14397 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
14400 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
14402 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
14405 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
14407 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
14410 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
14412 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
14415 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
14417 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
14420 * Checks if the given object is currently in the success state
14422 bool CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR o);
14425 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
14427 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
14430 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
14431 * but with all dynamically-allocated buffers duplicated in new buffers.
14433 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
14436 * Creates a new CResult_SignatureNoneZ in the success state.
14438 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
14441 * Creates a new CResult_SignatureNoneZ in the error state.
14443 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
14446 * Checks if the given object is currently in the success state
14448 bool CResult_SignatureNoneZ_is_ok(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR o);
14451 * Frees any resources used by the CResult_SignatureNoneZ.
14453 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
14456 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
14457 * but with all dynamically-allocated buffers duplicated in new buffers.
14459 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
14462 * Creates a new tuple which has the same data as `orig`
14463 * but with all dynamically-allocated buffers duplicated in new buffers.
14465 struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_clone(const struct LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR orig);
14468 * Creates a new C2Tuple_SignatureSignatureZ from the contained elements.
14470 struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_new(struct LDKSignature a, struct LDKSignature b);
14473 * Frees any resources used by the C2Tuple_SignatureSignatureZ.
14475 void C2Tuple_SignatureSignatureZ_free(struct LDKC2Tuple_SignatureSignatureZ _res);
14478 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the success state.
14480 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_ok(struct LDKC2Tuple_SignatureSignatureZ o);
14483 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the error state.
14485 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_err(void);
14488 * Checks if the given object is currently in the success state
14490 bool CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR o);
14493 * Frees any resources used by the CResult_C2Tuple_SignatureSignatureZNoneZ.
14495 void CResult_C2Tuple_SignatureSignatureZNoneZ_free(struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res);
14498 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ which has the same data as `orig`
14499 * but with all dynamically-allocated buffers duplicated in new buffers.
14501 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR orig);
14504 * Creates a new CResult_SecretKeyNoneZ in the success state.
14506 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_ok(struct LDKSecretKey o);
14509 * Creates a new CResult_SecretKeyNoneZ in the error state.
14511 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_err(void);
14514 * Checks if the given object is currently in the success state
14516 bool CResult_SecretKeyNoneZ_is_ok(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR o);
14519 * Frees any resources used by the CResult_SecretKeyNoneZ.
14521 void CResult_SecretKeyNoneZ_free(struct LDKCResult_SecretKeyNoneZ _res);
14524 * Creates a new CResult_SecretKeyNoneZ which has the same data as `orig`
14525 * but with all dynamically-allocated buffers duplicated in new buffers.
14527 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_clone(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR orig);
14530 * Creates a new CResult_SignDecodeErrorZ in the success state.
14532 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
14535 * Creates a new CResult_SignDecodeErrorZ in the error state.
14537 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
14540 * Checks if the given object is currently in the success state
14542 bool CResult_SignDecodeErrorZ_is_ok(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR o);
14545 * Frees any resources used by the CResult_SignDecodeErrorZ.
14547 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
14550 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
14551 * but with all dynamically-allocated buffers duplicated in new buffers.
14553 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
14556 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14558 void CVec_u5Z_free(struct LDKCVec_u5Z _res);
14561 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
14563 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
14566 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
14568 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
14571 * Checks if the given object is currently in the success state
14573 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
14576 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
14578 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
14581 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
14582 * but with all dynamically-allocated buffers duplicated in new buffers.
14584 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
14587 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14589 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
14592 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14594 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
14597 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
14599 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
14602 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
14604 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
14607 * Checks if the given object is currently in the success state
14609 bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o);
14612 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
14614 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
14617 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
14618 * but with all dynamically-allocated buffers duplicated in new buffers.
14620 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
14623 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
14625 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
14628 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
14630 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
14633 * Checks if the given object is currently in the success state
14635 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
14638 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
14640 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
14643 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
14644 * but with all dynamically-allocated buffers duplicated in new buffers.
14646 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
14649 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14651 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
14654 * Creates a new CResult_TransactionNoneZ in the success state.
14656 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
14659 * Creates a new CResult_TransactionNoneZ in the error state.
14661 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
14664 * Checks if the given object is currently in the success state
14666 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
14669 * Frees any resources used by the CResult_TransactionNoneZ.
14671 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
14674 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
14675 * but with all dynamically-allocated buffers duplicated in new buffers.
14677 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
14680 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
14682 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
14685 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
14687 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
14690 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14692 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
14695 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
14697 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
14700 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
14702 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
14705 * Checks if the given object is currently in the success state
14707 bool CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR o);
14710 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
14712 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
14715 * Constructs a new COption_u16Z containing a u16
14717 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
14720 * Constructs a new COption_u16Z containing nothing
14722 struct LDKCOption_u16Z COption_u16Z_none(void);
14725 * Frees any resources associated with the u16, if we are in the Some state
14727 void COption_u16Z_free(struct LDKCOption_u16Z _res);
14730 * Creates a new COption_u16Z which has the same data as `orig`
14731 * but with all dynamically-allocated buffers duplicated in new buffers.
14733 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
14736 * Creates a new CResult_NoneAPIErrorZ in the success state.
14738 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
14741 * Creates a new CResult_NoneAPIErrorZ in the error state.
14743 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
14746 * Checks if the given object is currently in the success state
14748 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
14751 * Frees any resources used by the CResult_NoneAPIErrorZ.
14753 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
14756 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
14757 * but with all dynamically-allocated buffers duplicated in new buffers.
14759 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
14762 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14764 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
14767 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14769 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
14772 * Creates a new CResult__u832APIErrorZ in the success state.
14774 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_ok(struct LDKThirtyTwoBytes o);
14777 * Creates a new CResult__u832APIErrorZ in the error state.
14779 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_err(struct LDKAPIError e);
14782 * Checks if the given object is currently in the success state
14784 bool CResult__u832APIErrorZ_is_ok(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR o);
14787 * Frees any resources used by the CResult__u832APIErrorZ.
14789 void CResult__u832APIErrorZ_free(struct LDKCResult__u832APIErrorZ _res);
14792 * Creates a new CResult__u832APIErrorZ which has the same data as `orig`
14793 * but with all dynamically-allocated buffers duplicated in new buffers.
14795 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig);
14798 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the success state.
14800 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
14803 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the error state.
14805 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
14808 * Checks if the given object is currently in the success state
14810 bool CResult_PaymentIdPaymentSendFailureZ_is_ok(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR o);
14813 * Frees any resources used by the CResult_PaymentIdPaymentSendFailureZ.
14815 void CResult_PaymentIdPaymentSendFailureZ_free(struct LDKCResult_PaymentIdPaymentSendFailureZ _res);
14818 * Creates a new CResult_PaymentIdPaymentSendFailureZ which has the same data as `orig`
14819 * but with all dynamically-allocated buffers duplicated in new buffers.
14821 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_clone(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR orig);
14824 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
14826 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
14829 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
14831 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
14834 * Checks if the given object is currently in the success state
14836 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
14839 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
14841 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
14844 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
14845 * but with all dynamically-allocated buffers duplicated in new buffers.
14847 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
14850 * Creates a new tuple which has the same data as `orig`
14851 * but with all dynamically-allocated buffers duplicated in new buffers.
14853 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig);
14856 * Creates a new C2Tuple_PaymentHashPaymentIdZ from the contained elements.
14858 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
14861 * Frees any resources used by the C2Tuple_PaymentHashPaymentIdZ.
14863 void C2Tuple_PaymentHashPaymentIdZ_free(struct LDKC2Tuple_PaymentHashPaymentIdZ _res);
14866 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the success state.
14868 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(struct LDKC2Tuple_PaymentHashPaymentIdZ o);
14871 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the error state.
14873 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
14876 * Checks if the given object is currently in the success state
14878 bool CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR o);
14881 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.
14883 void CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res);
14886 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ which has the same data as `orig`
14887 * but with all dynamically-allocated buffers duplicated in new buffers.
14889 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig);
14892 * Creates a new tuple which has the same data as `orig`
14893 * but with all dynamically-allocated buffers duplicated in new buffers.
14895 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig);
14898 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
14900 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
14903 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
14905 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
14908 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the success state.
14910 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
14913 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the error state.
14915 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(void);
14918 * Checks if the given object is currently in the success state
14920 bool CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR o);
14923 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ.
14925 void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res);
14928 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ which has the same data as `orig`
14929 * but with all dynamically-allocated buffers duplicated in new buffers.
14931 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR orig);
14934 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the success state.
14936 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
14939 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the error state.
14941 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(struct LDKAPIError e);
14944 * Checks if the given object is currently in the success state
14946 bool CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR o);
14949 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.
14951 void CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res);
14954 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ which has the same data as `orig`
14955 * but with all dynamically-allocated buffers duplicated in new buffers.
14957 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR orig);
14960 * Creates a new CResult_PaymentSecretNoneZ in the success state.
14962 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
14965 * Creates a new CResult_PaymentSecretNoneZ in the error state.
14967 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_err(void);
14970 * Checks if the given object is currently in the success state
14972 bool CResult_PaymentSecretNoneZ_is_ok(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR o);
14975 * Frees any resources used by the CResult_PaymentSecretNoneZ.
14977 void CResult_PaymentSecretNoneZ_free(struct LDKCResult_PaymentSecretNoneZ _res);
14980 * Creates a new CResult_PaymentSecretNoneZ which has the same data as `orig`
14981 * but with all dynamically-allocated buffers duplicated in new buffers.
14983 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_clone(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR orig);
14986 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
14988 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
14991 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
14993 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
14996 * Checks if the given object is currently in the success state
14998 bool CResult_PaymentSecretAPIErrorZ_is_ok(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR o);
15001 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
15003 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
15006 * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig`
15007 * but with all dynamically-allocated buffers duplicated in new buffers.
15009 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig);
15012 * Creates a new CResult_PaymentPreimageAPIErrorZ in the success state.
15014 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
15017 * Creates a new CResult_PaymentPreimageAPIErrorZ in the error state.
15019 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_err(struct LDKAPIError e);
15022 * Checks if the given object is currently in the success state
15024 bool CResult_PaymentPreimageAPIErrorZ_is_ok(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR o);
15027 * Frees any resources used by the CResult_PaymentPreimageAPIErrorZ.
15029 void CResult_PaymentPreimageAPIErrorZ_free(struct LDKCResult_PaymentPreimageAPIErrorZ _res);
15032 * Creates a new CResult_PaymentPreimageAPIErrorZ which has the same data as `orig`
15033 * but with all dynamically-allocated buffers duplicated in new buffers.
15035 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_clone(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR orig);
15038 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
15040 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
15043 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
15045 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
15048 * Checks if the given object is currently in the success state
15050 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
15053 * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
15055 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
15058 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
15059 * but with all dynamically-allocated buffers duplicated in new buffers.
15061 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
15064 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
15066 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
15069 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
15071 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
15074 * Checks if the given object is currently in the success state
15076 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
15079 * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
15081 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
15084 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
15085 * but with all dynamically-allocated buffers duplicated in new buffers.
15087 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
15090 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
15092 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
15095 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
15097 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
15100 * Checks if the given object is currently in the success state
15102 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
15105 * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
15107 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
15110 * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
15111 * but with all dynamically-allocated buffers duplicated in new buffers.
15113 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
15116 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
15118 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
15121 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
15123 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
15126 * Checks if the given object is currently in the success state
15128 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
15131 * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
15133 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
15136 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
15137 * but with all dynamically-allocated buffers duplicated in new buffers.
15139 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
15142 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15144 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
15147 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
15149 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
15152 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
15154 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
15157 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
15159 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
15162 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
15164 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
15167 * Checks if the given object is currently in the success state
15169 bool CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR o);
15172 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
15174 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
15177 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
15179 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
15182 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
15184 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
15187 * Checks if the given object is currently in the success state
15189 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
15192 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
15194 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
15197 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
15198 * but with all dynamically-allocated buffers duplicated in new buffers.
15200 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
15203 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
15205 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
15208 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
15210 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
15213 * Checks if the given object is currently in the success state
15215 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
15218 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
15220 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
15223 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
15224 * but with all dynamically-allocated buffers duplicated in new buffers.
15226 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
15229 * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
15231 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
15234 * Constructs a new COption_TypeZ containing nothing
15236 struct LDKCOption_TypeZ COption_TypeZ_none(void);
15239 * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
15241 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
15244 * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
15246 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
15249 * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
15251 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
15254 * Checks if the given object is currently in the success state
15256 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
15259 * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
15261 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
15264 * Creates a new CResult_PaymentIdPaymentErrorZ in the success state.
15266 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
15269 * Creates a new CResult_PaymentIdPaymentErrorZ in the error state.
15271 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e);
15274 * Checks if the given object is currently in the success state
15276 bool CResult_PaymentIdPaymentErrorZ_is_ok(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR o);
15279 * Frees any resources used by the CResult_PaymentIdPaymentErrorZ.
15281 void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res);
15284 * Creates a new CResult_PaymentIdPaymentErrorZ which has the same data as `orig`
15285 * but with all dynamically-allocated buffers duplicated in new buffers.
15287 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig);
15290 * Creates a new CResult_SiPrefixParseErrorZ in the success state.
15292 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_ok(enum LDKSiPrefix o);
15295 * Creates a new CResult_SiPrefixParseErrorZ in the error state.
15297 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_err(struct LDKParseError e);
15300 * Checks if the given object is currently in the success state
15302 bool CResult_SiPrefixParseErrorZ_is_ok(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR o);
15305 * Frees any resources used by the CResult_SiPrefixParseErrorZ.
15307 void CResult_SiPrefixParseErrorZ_free(struct LDKCResult_SiPrefixParseErrorZ _res);
15310 * Creates a new CResult_SiPrefixParseErrorZ which has the same data as `orig`
15311 * but with all dynamically-allocated buffers duplicated in new buffers.
15313 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_clone(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR orig);
15316 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the success state.
15318 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_ok(struct LDKInvoice o);
15321 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the error state.
15323 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
15326 * Checks if the given object is currently in the success state
15328 bool CResult_InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
15331 * Frees any resources used by the CResult_InvoiceParseOrSemanticErrorZ.
15333 void CResult_InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_InvoiceParseOrSemanticErrorZ _res);
15336 * Creates a new CResult_InvoiceParseOrSemanticErrorZ which has the same data as `orig`
15337 * but with all dynamically-allocated buffers duplicated in new buffers.
15339 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
15342 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the success state.
15344 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_ok(struct LDKSignedRawInvoice o);
15347 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the error state.
15349 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_err(struct LDKParseError e);
15352 * Checks if the given object is currently in the success state
15354 bool CResult_SignedRawInvoiceParseErrorZ_is_ok(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR o);
15357 * Frees any resources used by the CResult_SignedRawInvoiceParseErrorZ.
15359 void CResult_SignedRawInvoiceParseErrorZ_free(struct LDKCResult_SignedRawInvoiceParseErrorZ _res);
15362 * Creates a new CResult_SignedRawInvoiceParseErrorZ which has the same data as `orig`
15363 * but with all dynamically-allocated buffers duplicated in new buffers.
15365 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_clone(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR orig);
15368 * Creates a new tuple which has the same data as `orig`
15369 * but with all dynamically-allocated buffers duplicated in new buffers.
15371 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig);
15374 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
15376 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
15379 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
15381 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
15384 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
15386 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
15389 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
15391 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
15394 * Checks if the given object is currently in the success state
15396 bool CResult_PayeePubKeyErrorZ_is_ok(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR o);
15399 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
15401 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
15404 * Creates a new CResult_PayeePubKeyErrorZ which has the same data as `orig`
15405 * but with all dynamically-allocated buffers duplicated in new buffers.
15407 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig);
15410 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15412 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
15415 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
15417 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
15420 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
15422 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
15425 * Checks if the given object is currently in the success state
15427 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
15430 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
15432 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
15435 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
15436 * but with all dynamically-allocated buffers duplicated in new buffers.
15438 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
15441 * Creates a new CResult_NoneSemanticErrorZ in the success state.
15443 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
15446 * Creates a new CResult_NoneSemanticErrorZ in the error state.
15448 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
15451 * Checks if the given object is currently in the success state
15453 bool CResult_NoneSemanticErrorZ_is_ok(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR o);
15456 * Frees any resources used by the CResult_NoneSemanticErrorZ.
15458 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
15461 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
15462 * but with all dynamically-allocated buffers duplicated in new buffers.
15464 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
15467 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
15469 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
15472 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
15474 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
15477 * Checks if the given object is currently in the success state
15479 bool CResult_InvoiceSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR o);
15482 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
15484 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
15487 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
15488 * but with all dynamically-allocated buffers duplicated in new buffers.
15490 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
15493 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
15495 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
15498 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
15500 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
15503 * Checks if the given object is currently in the success state
15505 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
15508 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
15510 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
15513 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
15514 * but with all dynamically-allocated buffers duplicated in new buffers.
15516 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
15519 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
15521 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
15524 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
15526 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
15529 * Checks if the given object is currently in the success state
15531 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
15534 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
15536 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
15539 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
15540 * but with all dynamically-allocated buffers duplicated in new buffers.
15542 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
15545 * Creates a new CResult_StringErrorZ in the success state.
15547 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
15550 * Creates a new CResult_StringErrorZ in the error state.
15552 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
15555 * Checks if the given object is currently in the success state
15557 bool CResult_StringErrorZ_is_ok(const struct LDKCResult_StringErrorZ *NONNULL_PTR o);
15560 * Frees any resources used by the CResult_StringErrorZ.
15562 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
15565 * Creates a new CResult_StringErrorZ which has the same data as `orig`
15566 * but with all dynamically-allocated buffers duplicated in new buffers.
15568 struct LDKCResult_StringErrorZ CResult_StringErrorZ_clone(const struct LDKCResult_StringErrorZ *NONNULL_PTR orig);
15571 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
15573 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
15576 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
15578 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
15581 * Checks if the given object is currently in the success state
15583 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
15586 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
15588 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
15591 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
15592 * but with all dynamically-allocated buffers duplicated in new buffers.
15594 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
15597 * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
15599 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
15602 * Constructs a new COption_MonitorEventZ containing nothing
15604 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
15607 * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
15609 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
15612 * Creates a new COption_MonitorEventZ which has the same data as `orig`
15613 * but with all dynamically-allocated buffers duplicated in new buffers.
15615 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
15618 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
15620 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
15623 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
15625 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
15628 * Checks if the given object is currently in the success state
15630 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
15633 * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
15635 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
15638 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
15639 * but with all dynamically-allocated buffers duplicated in new buffers.
15641 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
15644 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
15646 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
15649 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
15651 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
15654 * Checks if the given object is currently in the success state
15656 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
15659 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
15661 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
15664 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
15665 * but with all dynamically-allocated buffers duplicated in new buffers.
15667 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
15670 * Creates a new tuple which has the same data as `orig`
15671 * but with all dynamically-allocated buffers duplicated in new buffers.
15673 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
15676 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
15678 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
15681 * Frees any resources used by the C2Tuple_OutPointScriptZ.
15683 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
15686 * Creates a new tuple which has the same data as `orig`
15687 * but with all dynamically-allocated buffers duplicated in new buffers.
15689 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
15692 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
15694 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
15697 * Frees any resources used by the C2Tuple_u32ScriptZ.
15699 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
15702 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15704 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
15707 * Creates a new tuple which has the same data as `orig`
15708 * but with all dynamically-allocated buffers duplicated in new buffers.
15710 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig);
15713 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
15715 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
15718 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
15720 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
15723 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15725 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
15728 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15730 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
15733 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15735 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
15738 * Creates a new tuple which has the same data as `orig`
15739 * but with all dynamically-allocated buffers duplicated in new buffers.
15741 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
15744 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
15746 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
15749 * Frees any resources used by the C2Tuple_u32TxOutZ.
15751 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
15754 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15756 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
15759 * Creates a new tuple which has the same data as `orig`
15760 * but with all dynamically-allocated buffers duplicated in new buffers.
15762 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
15765 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
15767 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
15770 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
15772 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
15775 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15777 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
15780 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15782 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
15785 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
15787 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
15790 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
15792 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
15795 * Checks if the given object is currently in the success state
15797 bool CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
15800 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
15802 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
15805 * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
15807 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
15810 * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
15812 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
15815 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15817 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
15820 * Constructs a new COption_NetAddressZ containing a crate::lightning::ln::msgs::NetAddress
15822 struct LDKCOption_NetAddressZ COption_NetAddressZ_some(struct LDKNetAddress o);
15825 * Constructs a new COption_NetAddressZ containing nothing
15827 struct LDKCOption_NetAddressZ COption_NetAddressZ_none(void);
15830 * Frees any resources associated with the crate::lightning::ln::msgs::NetAddress, if we are in the Some state
15832 void COption_NetAddressZ_free(struct LDKCOption_NetAddressZ _res);
15835 * Creates a new COption_NetAddressZ which has the same data as `orig`
15836 * but with all dynamically-allocated buffers duplicated in new buffers.
15838 struct LDKCOption_NetAddressZ COption_NetAddressZ_clone(const struct LDKCOption_NetAddressZ *NONNULL_PTR orig);
15841 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
15843 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
15846 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
15848 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
15851 * Checks if the given object is currently in the success state
15853 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
15856 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
15858 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
15861 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
15862 * but with all dynamically-allocated buffers duplicated in new buffers.
15864 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
15867 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
15869 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
15872 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
15874 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
15877 * Checks if the given object is currently in the success state
15879 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
15882 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
15884 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
15887 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
15888 * but with all dynamically-allocated buffers duplicated in new buffers.
15890 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
15893 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
15895 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
15898 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
15900 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
15903 * Checks if the given object is currently in the success state
15905 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
15908 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
15910 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
15913 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
15914 * but with all dynamically-allocated buffers duplicated in new buffers.
15916 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
15919 * Creates a new CResult_u32GraphSyncErrorZ in the success state.
15921 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
15924 * Creates a new CResult_u32GraphSyncErrorZ in the error state.
15926 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
15929 * Checks if the given object is currently in the success state
15931 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
15934 * Frees any resources used by the CResult_u32GraphSyncErrorZ.
15936 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
15939 * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
15941 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
15944 * Creates a new CResult_NetAddressDecodeErrorZ in the error state.
15946 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
15949 * Checks if the given object is currently in the success state
15951 bool CResult_NetAddressDecodeErrorZ_is_ok(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR o);
15954 * Frees any resources used by the CResult_NetAddressDecodeErrorZ.
15956 void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
15959 * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig`
15960 * but with all dynamically-allocated buffers duplicated in new buffers.
15962 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
15965 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15967 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
15970 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15972 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
15975 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15977 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
15980 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15982 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
15985 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
15987 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
15990 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
15992 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
15995 * Checks if the given object is currently in the success state
15997 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
16000 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
16002 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
16005 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
16006 * but with all dynamically-allocated buffers duplicated in new buffers.
16008 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
16011 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
16013 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
16016 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
16018 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
16021 * Checks if the given object is currently in the success state
16023 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
16026 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
16028 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
16031 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
16032 * but with all dynamically-allocated buffers duplicated in new buffers.
16034 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
16037 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
16039 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
16042 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
16044 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
16047 * Checks if the given object is currently in the success state
16049 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
16052 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
16054 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
16057 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
16058 * but with all dynamically-allocated buffers duplicated in new buffers.
16060 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
16063 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
16065 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
16068 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
16070 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
16073 * Checks if the given object is currently in the success state
16075 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
16078 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
16080 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
16083 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
16084 * but with all dynamically-allocated buffers duplicated in new buffers.
16086 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
16089 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
16091 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
16094 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
16096 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
16099 * Checks if the given object is currently in the success state
16101 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
16104 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
16106 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
16109 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
16110 * but with all dynamically-allocated buffers duplicated in new buffers.
16112 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
16115 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
16117 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
16120 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
16122 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
16125 * Checks if the given object is currently in the success state
16127 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
16130 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
16132 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
16135 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
16136 * but with all dynamically-allocated buffers duplicated in new buffers.
16138 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
16141 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
16143 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
16146 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
16148 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
16151 * Checks if the given object is currently in the success state
16153 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
16156 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
16158 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
16161 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
16162 * but with all dynamically-allocated buffers duplicated in new buffers.
16164 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
16167 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
16169 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
16172 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
16174 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
16177 * Checks if the given object is currently in the success state
16179 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
16182 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
16184 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
16187 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
16188 * but with all dynamically-allocated buffers duplicated in new buffers.
16190 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
16193 * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
16195 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
16198 * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
16200 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
16203 * Checks if the given object is currently in the success state
16205 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
16208 * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
16210 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
16213 * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
16214 * but with all dynamically-allocated buffers duplicated in new buffers.
16216 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
16219 * Creates a new CResult_InitDecodeErrorZ in the success state.
16221 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
16224 * Creates a new CResult_InitDecodeErrorZ in the error state.
16226 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
16229 * Checks if the given object is currently in the success state
16231 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
16234 * Frees any resources used by the CResult_InitDecodeErrorZ.
16236 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
16239 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
16240 * but with all dynamically-allocated buffers duplicated in new buffers.
16242 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
16245 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
16247 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
16250 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
16252 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
16255 * Checks if the given object is currently in the success state
16257 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
16260 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
16262 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
16265 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
16266 * but with all dynamically-allocated buffers duplicated in new buffers.
16268 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
16271 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
16273 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
16276 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
16278 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
16281 * Checks if the given object is currently in the success state
16283 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
16286 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
16288 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
16291 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
16292 * but with all dynamically-allocated buffers duplicated in new buffers.
16294 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
16297 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
16299 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
16302 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
16304 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
16307 * Checks if the given object is currently in the success state
16309 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
16312 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
16314 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
16317 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
16318 * but with all dynamically-allocated buffers duplicated in new buffers.
16320 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
16323 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
16325 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
16328 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
16330 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16333 * Checks if the given object is currently in the success state
16335 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
16338 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
16340 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
16343 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
16344 * but with all dynamically-allocated buffers duplicated in new buffers.
16346 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
16349 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
16351 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
16354 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
16356 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16359 * Checks if the given object is currently in the success state
16361 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
16364 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
16366 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
16369 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
16370 * but with all dynamically-allocated buffers duplicated in new buffers.
16372 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
16375 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
16377 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
16380 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
16382 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
16385 * Checks if the given object is currently in the success state
16387 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
16390 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
16392 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
16395 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
16396 * but with all dynamically-allocated buffers duplicated in new buffers.
16398 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
16401 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
16403 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
16406 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
16408 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16411 * Checks if the given object is currently in the success state
16413 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
16416 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
16418 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
16421 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
16422 * but with all dynamically-allocated buffers duplicated in new buffers.
16424 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
16427 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
16429 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
16432 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
16434 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16437 * Checks if the given object is currently in the success state
16439 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
16442 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
16444 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
16447 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
16448 * but with all dynamically-allocated buffers duplicated in new buffers.
16450 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
16453 * Creates a new CResult_PingDecodeErrorZ in the success state.
16455 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
16458 * Creates a new CResult_PingDecodeErrorZ in the error state.
16460 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
16463 * Checks if the given object is currently in the success state
16465 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
16468 * Frees any resources used by the CResult_PingDecodeErrorZ.
16470 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
16473 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
16474 * but with all dynamically-allocated buffers duplicated in new buffers.
16476 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
16479 * Creates a new CResult_PongDecodeErrorZ in the success state.
16481 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
16484 * Creates a new CResult_PongDecodeErrorZ in the error state.
16486 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
16489 * Checks if the given object is currently in the success state
16491 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
16494 * Frees any resources used by the CResult_PongDecodeErrorZ.
16496 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
16499 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
16500 * but with all dynamically-allocated buffers duplicated in new buffers.
16502 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
16505 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
16507 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
16510 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
16512 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
16515 * Checks if the given object is currently in the success state
16517 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
16520 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
16522 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
16525 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
16526 * but with all dynamically-allocated buffers duplicated in new buffers.
16528 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
16531 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
16533 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
16536 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
16538 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
16541 * Checks if the given object is currently in the success state
16543 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
16546 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
16548 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
16551 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
16552 * but with all dynamically-allocated buffers duplicated in new buffers.
16554 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
16557 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
16559 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
16562 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
16564 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
16567 * Checks if the given object is currently in the success state
16569 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
16572 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
16574 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
16577 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
16578 * but with all dynamically-allocated buffers duplicated in new buffers.
16580 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
16583 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
16585 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
16588 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
16590 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
16593 * Checks if the given object is currently in the success state
16595 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
16598 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
16600 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
16603 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
16604 * but with all dynamically-allocated buffers duplicated in new buffers.
16606 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
16609 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
16611 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
16614 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
16616 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
16619 * Checks if the given object is currently in the success state
16621 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
16624 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
16626 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
16629 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
16630 * but with all dynamically-allocated buffers duplicated in new buffers.
16632 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
16635 * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
16637 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
16640 * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
16642 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
16645 * Checks if the given object is currently in the success state
16647 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
16650 * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
16652 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
16655 * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
16656 * but with all dynamically-allocated buffers duplicated in new buffers.
16658 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
16661 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
16663 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
16666 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
16668 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
16671 * Checks if the given object is currently in the success state
16673 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
16676 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
16678 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
16681 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
16682 * but with all dynamically-allocated buffers duplicated in new buffers.
16684 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
16687 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
16689 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
16692 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
16694 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
16697 * Checks if the given object is currently in the success state
16699 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
16702 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
16704 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
16707 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
16708 * but with all dynamically-allocated buffers duplicated in new buffers.
16710 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
16713 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
16715 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
16718 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
16720 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
16723 * Checks if the given object is currently in the success state
16725 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
16728 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
16730 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
16733 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
16734 * but with all dynamically-allocated buffers duplicated in new buffers.
16736 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
16739 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
16741 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
16744 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
16746 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
16749 * Checks if the given object is currently in the success state
16751 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
16754 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
16756 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
16759 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
16760 * but with all dynamically-allocated buffers duplicated in new buffers.
16762 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
16765 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
16767 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
16770 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
16772 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
16775 * Checks if the given object is currently in the success state
16777 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
16780 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
16782 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
16785 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
16786 * but with all dynamically-allocated buffers duplicated in new buffers.
16788 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
16791 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
16793 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
16796 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
16798 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
16801 * Checks if the given object is currently in the success state
16803 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
16806 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
16808 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
16811 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
16812 * but with all dynamically-allocated buffers duplicated in new buffers.
16814 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
16817 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
16819 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
16822 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
16824 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
16827 * Checks if the given object is currently in the success state
16829 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
16832 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
16834 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
16837 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
16838 * but with all dynamically-allocated buffers duplicated in new buffers.
16840 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
16843 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16845 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
16848 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state.
16850 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o);
16853 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state.
16855 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
16858 * Checks if the given object is currently in the success state
16860 bool CResult_InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
16863 * Frees any resources used by the CResult_InvoiceSignOrCreationErrorZ.
16865 void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res);
16868 * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig`
16869 * but with all dynamically-allocated buffers duplicated in new buffers.
16871 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
16874 * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
16876 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
16879 * Constructs a new COption_FilterZ containing nothing
16881 struct LDKCOption_FilterZ COption_FilterZ_none(void);
16884 * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
16886 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
16889 * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
16891 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
16894 * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
16896 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
16899 * Checks if the given object is currently in the success state
16901 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
16904 * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
16906 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
16909 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16911 void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
16914 * Frees any resources used by the PaymentPurpose
16916 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
16919 * Creates a copy of the PaymentPurpose
16921 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
16924 * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
16926 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret);
16929 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
16931 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
16934 * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
16936 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
16939 * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
16941 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
16944 * Frees any resources used by the ClosureReason
16946 void ClosureReason_free(struct LDKClosureReason this_ptr);
16949 * Creates a copy of the ClosureReason
16951 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
16954 * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
16956 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKStr peer_msg);
16959 * Utility method to constructs a new HolderForceClosed-variant ClosureReason
16961 struct LDKClosureReason ClosureReason_holder_force_closed(void);
16964 * Utility method to constructs a new CooperativeClosure-variant ClosureReason
16966 struct LDKClosureReason ClosureReason_cooperative_closure(void);
16969 * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
16971 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
16974 * Utility method to constructs a new FundingTimedOut-variant ClosureReason
16976 struct LDKClosureReason ClosureReason_funding_timed_out(void);
16979 * Utility method to constructs a new ProcessingError-variant ClosureReason
16981 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
16984 * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
16986 struct LDKClosureReason ClosureReason_disconnected_peer(void);
16989 * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
16991 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
16994 * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
16996 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
16999 * Read a ClosureReason from a byte array, created by ClosureReason_write
17001 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
17004 * Frees any resources used by the Event
17006 void Event_free(struct LDKEvent this_ptr);
17009 * Creates a copy of the Event
17011 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
17014 * Utility method to constructs a new FundingGenerationReady-variant Event
17016 struct LDKEvent Event_funding_generation_ready(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, uint64_t user_channel_id);
17019 * Utility method to constructs a new PaymentReceived-variant Event
17021 struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose);
17024 * Utility method to constructs a new PaymentClaimed-variant Event
17026 struct LDKEvent Event_payment_claimed(struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose);
17029 * Utility method to constructs a new PaymentSent-variant Event
17031 struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
17034 * Utility method to constructs a new PaymentFailed-variant Event
17036 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
17039 * Utility method to constructs a new PaymentPathSuccessful-variant Event
17041 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
17044 * Utility method to constructs a new PaymentPathFailed-variant Event
17046 struct LDKEvent Event_payment_path_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, bool rejected_by_dest, struct LDKCOption_NetworkUpdateZ network_update, bool all_paths_failed, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id, struct LDKRouteParameters retry);
17049 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
17051 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
17054 * Utility method to constructs a new SpendableOutputs-variant Event
17056 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs);
17059 * Utility method to constructs a new PaymentForwarded-variant Event
17061 struct LDKEvent Event_payment_forwarded(struct LDKThirtyTwoBytes prev_channel_id, struct LDKThirtyTwoBytes next_channel_id, struct LDKCOption_u64Z fee_earned_msat, bool claim_from_onchain_tx);
17064 * Utility method to constructs a new ChannelClosed-variant Event
17066 struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, uint64_t user_channel_id, struct LDKClosureReason reason);
17069 * Utility method to constructs a new DiscardFunding-variant Event
17071 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
17074 * Utility method to constructs a new OpenChannelRequest-variant Event
17076 struct LDKEvent Event_open_channel_request(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t funding_satoshis, uint64_t push_msat, struct LDKChannelTypeFeatures channel_type);
17079 * Serialize the Event object into a byte array which can be read by Event_read
17081 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
17084 * Read a Event from a byte array, created by Event_write
17086 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
17089 * Frees any resources used by the MessageSendEvent
17091 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
17094 * Creates a copy of the MessageSendEvent
17096 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
17099 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
17101 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
17104 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
17106 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
17109 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
17111 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
17114 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
17116 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
17119 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
17121 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
17124 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
17126 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
17129 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
17131 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
17134 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
17136 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
17139 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
17141 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
17144 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
17146 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
17149 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
17151 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
17154 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
17156 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
17159 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
17161 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
17164 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
17166 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
17169 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
17171 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
17174 * Utility method to constructs a new HandleError-variant MessageSendEvent
17176 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
17179 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
17181 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
17184 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
17186 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
17189 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
17191 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
17194 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
17196 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
17199 * Calls the free function if one is set
17201 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
17204 * Calls the free function if one is set
17206 void EventsProvider_free(struct LDKEventsProvider this_ptr);
17209 * Calls the free function if one is set
17211 void EventHandler_free(struct LDKEventHandler this_ptr);
17214 * Frees any resources used by the APIError
17216 void APIError_free(struct LDKAPIError this_ptr);
17219 * Creates a copy of the APIError
17221 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
17224 * Utility method to constructs a new APIMisuseError-variant APIError
17226 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
17229 * Utility method to constructs a new FeeRateTooHigh-variant APIError
17231 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
17234 * Utility method to constructs a new RouteError-variant APIError
17236 struct LDKAPIError APIError_route_error(struct LDKStr err);
17239 * Utility method to constructs a new ChannelUnavailable-variant APIError
17241 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
17244 * Utility method to constructs a new MonitorUpdateFailed-variant APIError
17246 struct LDKAPIError APIError_monitor_update_failed(void);
17249 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
17251 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
17254 * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
17256 void BigSize_free(struct LDKBigSize this_obj);
17258 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
17260 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
17263 * Constructs a new BigSize given each field
17265 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
17268 * Creates a digital signature of a message given a SecretKey, like the node's secret.
17269 * 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.
17270 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
17272 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
17275 * Recovers the PublicKey of the signer of the message given the message and the signature.
17277 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
17280 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
17281 * and the PublicKey.
17283 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
17286 * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
17288 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z data_without_signature);
17291 * Calls the free function if one is set
17293 void Persister_free(struct LDKPersister this_ptr);
17296 * Creates a copy of the Level
17298 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
17301 * Utility method to constructs a new Gossip-variant Level
17303 enum LDKLevel Level_gossip(void);
17306 * Utility method to constructs a new Trace-variant Level
17308 enum LDKLevel Level_trace(void);
17311 * Utility method to constructs a new Debug-variant Level
17313 enum LDKLevel Level_debug(void);
17316 * Utility method to constructs a new Info-variant Level
17318 enum LDKLevel Level_info(void);
17321 * Utility method to constructs a new Warn-variant Level
17323 enum LDKLevel Level_warn(void);
17326 * Utility method to constructs a new Error-variant Level
17328 enum LDKLevel Level_error(void);
17331 * Checks if two Levels contain equal inner contents.
17332 * This ignores pointers and is_owned flags and looks at the values in fields.
17334 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
17337 * Checks if two Levels contain equal inner contents.
17339 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
17342 * Returns the most verbose logging level.
17344 MUST_USE_RES enum LDKLevel Level_max(void);
17347 * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
17349 void Record_free(struct LDKRecord this_obj);
17352 * The verbosity level of the message.
17354 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
17357 * The verbosity level of the message.
17359 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
17362 * The message body.
17364 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
17367 * The message body.
17369 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
17372 * The module path of the message.
17374 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
17377 * The module path of the message.
17379 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
17382 * The source file containing the message.
17384 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
17387 * The source file containing the message.
17389 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
17392 * The line containing the message.
17394 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
17397 * The line containing the message.
17399 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
17402 * Creates a copy of the Record
17404 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
17407 * Calls the free function if one is set
17409 void Logger_free(struct LDKLogger this_ptr);
17412 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
17414 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
17417 * Confirmations we will wait for before considering the channel locked in.
17418 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
17419 * equivalent limit applied to outbound channels).
17421 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
17422 * transaction before operation. If you wish to accept channels with zero confirmations, see
17423 * [`UserConfig::manually_accept_inbound_channels`] and
17424 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
17426 * Default value: 6.
17428 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
17429 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
17431 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17434 * Confirmations we will wait for before considering the channel locked in.
17435 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
17436 * equivalent limit applied to outbound channels).
17438 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
17439 * transaction before operation. If you wish to accept channels with zero confirmations, see
17440 * [`UserConfig::manually_accept_inbound_channels`] and
17441 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
17443 * Default value: 6.
17445 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
17446 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
17448 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
17451 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
17452 * the number of blocks we have to punish our counterparty if they broadcast a revoked
17455 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
17456 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
17457 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
17458 * possibly with time in between to RBF the spending transaction).
17460 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
17461 * case of an honest unilateral channel close, which implicitly decrease the economic value of
17464 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
17465 * can tweak config to ask for more security, not less.
17467 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17470 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
17471 * the number of blocks we have to punish our counterparty if they broadcast a revoked
17474 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
17475 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
17476 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
17477 * possibly with time in between to RBF the spending transaction).
17479 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
17480 * case of an honest unilateral channel close, which implicitly decrease the economic value of
17483 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
17484 * can tweak config to ask for more security, not less.
17486 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
17489 * Set to the smallest value HTLC we will accept to process.
17491 * This value is sent to our counterparty on channel-open and we close the channel any time
17492 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
17494 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
17497 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17500 * Set to the smallest value HTLC we will accept to process.
17502 * This value is sent to our counterparty on channel-open and we close the channel any time
17503 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
17505 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
17508 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
17511 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
17514 * This can be set to a value between 1-100, where the value corresponds to the percent of the
17515 * channel value in whole percentages.
17518 * * If configured to another value than the default value 10, any new channels created with
17519 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
17520 * `ChannelManager`.
17522 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
17523 * no way to configure the cap for the total value of outbound HTLCs in-flight.
17525 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
17526 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
17527 * restrict exposure to loss due to being offline for too long.
17528 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
17529 * for more information.
17531 * Default value: 10.
17532 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
17533 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
17535 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17538 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
17541 * This can be set to a value between 1-100, where the value corresponds to the percent of the
17542 * channel value in whole percentages.
17545 * * If configured to another value than the default value 10, any new channels created with
17546 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
17547 * `ChannelManager`.
17549 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
17550 * no way to configure the cap for the total value of outbound HTLCs in-flight.
17552 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
17553 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
17554 * restrict exposure to loss due to being offline for too long.
17555 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
17556 * for more information.
17558 * Default value: 10.
17559 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
17560 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
17562 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
17565 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
17566 * BOLTs) option for outbound private channels. This provides better privacy by not including
17567 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
17568 * relay HTLCs to us using the channel's SCID alias.
17570 * If this option is set, channels may be created that will not be readable by LDK versions
17571 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
17572 * [`DecodeError:InvalidValue`].
17574 * Note that setting this to true does *not* prevent us from opening channels with
17575 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
17576 * private channel without that option.
17578 * Ignored if the channel is negotiated to be announced, see
17579 * [`ChannelConfig::announced_channel`] and
17580 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
17582 * Default value: false. This value is likely to change to true in the future.
17584 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17585 * [`DecodeError:InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
17587 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17590 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
17591 * BOLTs) option for outbound private channels. This provides better privacy by not including
17592 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
17593 * relay HTLCs to us using the channel's SCID alias.
17595 * If this option is set, channels may be created that will not be readable by LDK versions
17596 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
17597 * [`DecodeError:InvalidValue`].
17599 * Note that setting this to true does *not* prevent us from opening channels with
17600 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
17601 * private channel without that option.
17603 * Ignored if the channel is negotiated to be announced, see
17604 * [`ChannelConfig::announced_channel`] and
17605 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
17607 * Default value: false. This value is likely to change to true in the future.
17609 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17610 * [`DecodeError:InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
17612 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
17615 * Constructs a new ChannelHandshakeConfig given each field
17617 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, uint8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool negotiate_scid_privacy_arg);
17620 * Creates a copy of the ChannelHandshakeConfig
17622 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
17625 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
17627 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
17630 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
17632 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
17635 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
17636 * only applies to inbound channels.
17638 * Default value: 0.
17640 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17643 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
17644 * only applies to inbound channels.
17646 * Default value: 0.
17648 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17651 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
17652 * only applies to inbound channels.
17654 * Default value: 2^24 - 1.
17656 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17659 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
17660 * only applies to inbound channels.
17662 * Default value: 2^24 - 1.
17664 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17667 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
17668 * you to limit the maximum minimum-size they can require.
17670 * Default value: u64::max_value.
17672 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17675 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
17676 * you to limit the maximum minimum-size they can require.
17678 * Default value: u64::max_value.
17680 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17683 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
17684 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
17686 * Default value: 0.
17688 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17691 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
17692 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
17694 * Default value: 0.
17696 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17699 * The remote node will require we keep a certain amount in direct payment to ourselves at all
17700 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
17701 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
17703 * Default value: u64::max_value.
17705 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17708 * The remote node will require we keep a certain amount in direct payment to ourselves at all
17709 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
17710 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
17712 * Default value: u64::max_value.
17714 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17717 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
17718 * time. This allows you to set a minimum such value.
17720 * Default value: 0.
17722 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17725 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
17726 * time. This allows you to set a minimum such value.
17728 * Default value: 0.
17730 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
17733 * Before a channel is usable the funding transaction will need to be confirmed by at least a
17734 * certain number of blocks, specified by the node which is not the funder (as the funder can
17735 * assume they aren't going to double-spend themselves).
17736 * This config allows you to set a limit on the maximum amount of time to wait.
17738 * Default value: 144, or roughly one day and only applies to outbound channels.
17740 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17743 * Before a channel is usable the funding transaction will need to be confirmed by at least a
17744 * certain number of blocks, specified by the node which is not the funder (as the funder can
17745 * assume they aren't going to double-spend themselves).
17746 * This config allows you to set a limit on the maximum amount of time to wait.
17748 * Default value: 144, or roughly one day and only applies to outbound channels.
17750 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
17753 * Whether we implicitly trust funding transactions generated by us for our own outbound
17754 * channels to not be double-spent.
17756 * If this is set, we assume that our own funding transactions are *never* double-spent, and
17757 * thus we can trust them without any confirmations. This is generally a reasonable
17758 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
17759 * control of the signing keys).
17761 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
17762 * double-spend the funding transaction to RBF with an alternative channel open.
17764 * This only applies if our counterparty set their confirmations-required value to 0, and we
17765 * always trust our own funding transaction at 1 confirmation irrespective of this value.
17766 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
17767 * `true` (0) and `false` (1).
17769 * Default value: true
17771 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17774 * Whether we implicitly trust funding transactions generated by us for our own outbound
17775 * channels to not be double-spent.
17777 * If this is set, we assume that our own funding transactions are *never* double-spent, and
17778 * thus we can trust them without any confirmations. This is generally a reasonable
17779 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
17780 * control of the signing keys).
17782 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
17783 * double-spend the funding transaction to RBF with an alternative channel open.
17785 * This only applies if our counterparty set their confirmations-required value to 0, and we
17786 * always trust our own funding transaction at 1 confirmation irrespective of this value.
17787 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
17788 * `true` (0) and `false` (1).
17790 * Default value: true
17792 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
17795 * Set to force an incoming channel to match our announced channel preference in
17796 * [`ChannelConfig::announced_channel`].
17798 * For a node which is not online reliably, this should be set to true and
17799 * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
17800 * channels will ever be opened.
17802 * Default value: true.
17804 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17807 * Set to force an incoming channel to match our announced channel preference in
17808 * [`ChannelConfig::announced_channel`].
17810 * For a node which is not online reliably, this should be set to true and
17811 * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
17812 * channels will ever be opened.
17814 * Default value: true.
17816 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
17819 * Set to the amount of time we're willing to wait to claim money back to us.
17821 * Not checking this value would be a security issue, as our peer would be able to set it to
17822 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
17824 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
17825 * reduce the loss of having useless locked funds (if your peer accepts)
17827 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17830 * Set to the amount of time we're willing to wait to claim money back to us.
17832 * Not checking this value would be a security issue, as our peer would be able to set it to
17833 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
17835 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
17836 * reduce the loss of having useless locked funds (if your peer accepts)
17838 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
17841 * Constructs a new ChannelHandshakeLimits given each field
17843 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_new(uint64_t min_funding_satoshis_arg, uint64_t max_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 trust_own_funding_0conf_arg, bool force_announced_channel_preference_arg, uint16_t their_to_self_delay_arg);
17846 * Creates a copy of the ChannelHandshakeLimits
17848 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
17851 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
17853 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
17856 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
17858 void ChannelConfig_free(struct LDKChannelConfig this_obj);
17861 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
17862 * over the channel.
17863 * This may be allowed to change at runtime in a later update, however doing so must result in
17864 * update messages sent to notify all nodes of our updated relay fee.
17866 * Default value: 0.
17868 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17871 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
17872 * over the channel.
17873 * This may be allowed to change at runtime in a later update, however doing so must result in
17874 * update messages sent to notify all nodes of our updated relay fee.
17876 * Default value: 0.
17878 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
17881 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
17882 * excess of [`forwarding_fee_proportional_millionths`].
17883 * This may be allowed to change at runtime in a later update, however doing so must result in
17884 * update messages sent to notify all nodes of our updated relay fee.
17886 * The default value of a single satoshi roughly matches the market rate on many routing nodes
17887 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
17890 * Default value: 1000.
17892 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
17894 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17897 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
17898 * excess of [`forwarding_fee_proportional_millionths`].
17899 * This may be allowed to change at runtime in a later update, however doing so must result in
17900 * update messages sent to notify all nodes of our updated relay fee.
17902 * The default value of a single satoshi roughly matches the market rate on many routing nodes
17903 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
17906 * Default value: 1000.
17908 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
17910 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
17913 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
17914 * the channel this config applies to.
17916 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
17917 * HTLC balance when a channel appears on-chain whereas
17918 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
17919 * (non-HTLC-encumbered) balance.
17921 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
17922 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
17923 * commitment transaction at least once per this many blocks (minus some margin to allow us
17924 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
17925 * the spending transaction).
17927 * Default value: 72 (12 hours at an average of 6 blocks/hour).
17928 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
17929 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
17931 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
17933 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17936 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
17937 * the channel this config applies to.
17939 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
17940 * HTLC balance when a channel appears on-chain whereas
17941 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
17942 * (non-HTLC-encumbered) balance.
17944 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
17945 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
17946 * commitment transaction at least once per this many blocks (minus some margin to allow us
17947 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
17948 * the spending transaction).
17950 * Default value: 72 (12 hours at an average of 6 blocks/hour).
17951 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
17952 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
17954 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
17956 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
17959 * Set to announce the channel publicly and notify all nodes that they can route via this
17962 * This should only be set to true for nodes which expect to be online reliably.
17964 * As the node which funds a channel picks this value this will only apply for new outbound
17965 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
17967 * This cannot be changed after the initial channel handshake.
17969 * Default value: false.
17971 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17974 * Set to announce the channel publicly and notify all nodes that they can route via this
17977 * This should only be set to true for nodes which expect to be online reliably.
17979 * As the node which funds a channel picks this value this will only apply for new outbound
17980 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
17982 * This cannot be changed after the initial channel handshake.
17984 * Default value: false.
17986 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
17989 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
17990 * supports it, they will then enforce the mutual-close output to us matches what we provided
17991 * at intialization, preventing us from closing to an alternate pubkey.
17993 * This is set to true by default to provide a slight increase in security, though ultimately
17994 * any attacker who is able to take control of a channel can just as easily send the funds via
17995 * lightning payments, so we never require that our counterparties support this option.
17997 * This cannot be changed after a channel has been initialized.
17999 * Default value: true.
18001 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18004 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
18005 * supports it, they will then enforce the mutual-close output to us matches what we provided
18006 * at intialization, preventing us from closing to an alternate pubkey.
18008 * This is set to true by default to provide a slight increase in security, though ultimately
18009 * any attacker who is able to take control of a channel can just as easily send the funds via
18010 * lightning payments, so we never require that our counterparties support this option.
18012 * This cannot be changed after a channel has been initialized.
18014 * Default value: true.
18016 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
18019 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
18020 * small to claim on-chain.
18022 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
18023 * not be claimable on-chain, instead being turned into additional miner fees if either
18024 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
18025 * to such payments may be sustantial if there are many dust HTLCs present when the
18026 * channel is force-closed.
18028 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
18029 * exposure across all three types per-channel. Setting this too low may prevent the
18030 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
18031 * important to prevent stealing of dust HTLCs by miners.
18033 * Default value: 5_000_000 msat.
18035 uint64_t ChannelConfig_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18038 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
18039 * small to claim on-chain.
18041 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
18042 * not be claimable on-chain, instead being turned into additional miner fees if either
18043 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
18044 * to such payments may be sustantial if there are many dust HTLCs present when the
18045 * channel is force-closed.
18047 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
18048 * exposure across all three types per-channel. Setting this too low may prevent the
18049 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
18050 * important to prevent stealing of dust HTLCs by miners.
18052 * Default value: 5_000_000 msat.
18054 void ChannelConfig_set_max_dust_htlc_exposure_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
18057 * The additional fee we're willing to pay to avoid waiting for the counterparty's
18058 * `to_self_delay` to reclaim funds.
18060 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
18061 * closing transaction which both sides find acceptable, ultimately paid by the channel
18062 * funder/initiator.
18064 * When we are the funder, because we have to pay the channel closing fee, we bound the
18065 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
18066 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
18067 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
18068 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
18071 * When we are not the funder, we require the closing transaction fee pay at least our
18072 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
18073 * Thus, this value is ignored when we are not the funder.
18075 * Default value: 1000 satoshis.
18077 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
18078 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
18080 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18083 * The additional fee we're willing to pay to avoid waiting for the counterparty's
18084 * `to_self_delay` to reclaim funds.
18086 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
18087 * closing transaction which both sides find acceptable, ultimately paid by the channel
18088 * funder/initiator.
18090 * When we are the funder, because we have to pay the channel closing fee, we bound the
18091 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
18092 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
18093 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
18094 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
18097 * When we are not the funder, we require the closing transaction fee pay at least our
18098 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
18099 * Thus, this value is ignored when we are not the funder.
18101 * Default value: 1000 satoshis.
18103 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
18104 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
18106 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
18109 * Constructs a new ChannelConfig given each field
18111 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, uint64_t max_dust_htlc_exposure_msat_arg, uint64_t force_close_avoidance_max_fee_satoshis_arg);
18114 * Creates a copy of the ChannelConfig
18116 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
18119 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
18121 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
18124 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
18126 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
18129 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
18131 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
18134 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
18136 void UserConfig_free(struct LDKUserConfig this_obj);
18139 * Channel config that we propose to our counterparty.
18141 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18144 * Channel config that we propose to our counterparty.
18146 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
18149 * Limits applied to our counterparty's proposed channel config settings.
18151 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18154 * Limits applied to our counterparty's proposed channel config settings.
18156 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
18159 * Channel config which affects behavior during channel lifetime.
18161 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18164 * Channel config which affects behavior during channel lifetime.
18166 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
18169 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
18170 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
18171 * node which is not online reliably.
18173 * For nodes which are not online reliably, you should set all channels to *not* be announced
18174 * (using [`ChannelConfig::announced_channel`] and
18175 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
18176 * ensure you are not exposed to any forwarding risk.
18178 * Note that because you cannot change a channel's announced state after creation, there is no
18179 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
18180 * from a publicly-announced forwarding node to a private non-forwarding node you must close
18181 * all your channels and open new ones. For privacy, you should also change your node_id
18182 * (swapping all private and public key material for new ones) at that time.
18184 * Default value: false.
18186 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18189 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
18190 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
18191 * node which is not online reliably.
18193 * For nodes which are not online reliably, you should set all channels to *not* be announced
18194 * (using [`ChannelConfig::announced_channel`] and
18195 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
18196 * ensure you are not exposed to any forwarding risk.
18198 * Note that because you cannot change a channel's announced state after creation, there is no
18199 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
18200 * from a publicly-announced forwarding node to a private non-forwarding node you must close
18201 * all your channels and open new ones. For privacy, you should also change your node_id
18202 * (swapping all private and public key material for new ones) at that time.
18204 * Default value: false.
18206 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
18209 * If this is set to false, we do not accept inbound requests to open a new channel.
18210 * Default value: true.
18212 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18215 * If this is set to false, we do not accept inbound requests to open a new channel.
18216 * Default value: true.
18218 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
18221 * If this is set to true, the user needs to manually accept inbound requests to open a new
18224 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
18225 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
18226 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
18227 * user explicitly chooses to accept the request.
18229 * Default value: false.
18231 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
18232 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
18233 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
18235 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18238 * If this is set to true, the user needs to manually accept inbound requests to open a new
18241 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
18242 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
18243 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
18244 * user explicitly chooses to accept the request.
18246 * Default value: false.
18248 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
18249 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
18250 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
18252 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
18255 * Constructs a new UserConfig given each field
18257 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, bool accept_inbound_channels_arg, bool manually_accept_inbound_channels_arg);
18260 * Creates a copy of the UserConfig
18262 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
18265 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
18267 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
18270 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
18272 void BestBlock_free(struct LDKBestBlock this_obj);
18275 * Creates a copy of the BestBlock
18277 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
18280 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
18283 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
18286 * Returns a `BestBlock` as identified by the given block hash and height.
18288 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
18291 * Returns the best block hash.
18293 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
18296 * Returns the best block height.
18298 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
18301 * Creates a copy of the AccessError
18303 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
18306 * Utility method to constructs a new UnknownChain-variant AccessError
18308 enum LDKAccessError AccessError_unknown_chain(void);
18311 * Utility method to constructs a new UnknownTx-variant AccessError
18313 enum LDKAccessError AccessError_unknown_tx(void);
18316 * Calls the free function if one is set
18318 void Access_free(struct LDKAccess this_ptr);
18321 * Calls the free function if one is set
18323 void Listen_free(struct LDKListen this_ptr);
18326 * Calls the free function if one is set
18328 void Confirm_free(struct LDKConfirm this_ptr);
18331 * Creates a copy of the ChannelMonitorUpdateErr
18333 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
18336 * Utility method to constructs a new TemporaryFailure-variant ChannelMonitorUpdateErr
18338 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_temporary_failure(void);
18341 * Utility method to constructs a new PermanentFailure-variant ChannelMonitorUpdateErr
18343 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_permanent_failure(void);
18346 * Calls the free function if one is set
18348 void Watch_free(struct LDKWatch this_ptr);
18351 * Calls the free function if one is set
18353 void Filter_free(struct LDKFilter this_ptr);
18356 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
18358 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
18361 * First block where the transaction output may have been spent.
18363 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18365 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
18368 * First block where the transaction output may have been spent.
18370 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
18372 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18375 * Outpoint identifying the transaction output.
18377 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
18380 * Outpoint identifying the transaction output.
18382 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
18385 * Spending condition of the transaction output.
18387 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
18390 * Spending condition of the transaction output.
18392 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
18395 * Constructs a new WatchedOutput given each field
18397 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
18400 * Creates a copy of the WatchedOutput
18402 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
18405 * Checks if two WatchedOutputs contain equal inner contents.
18407 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
18410 * Calls the free function if one is set
18412 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
18415 * Creates a copy of the ConfirmationTarget
18417 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
18420 * Utility method to constructs a new Background-variant ConfirmationTarget
18422 enum LDKConfirmationTarget ConfirmationTarget_background(void);
18425 * Utility method to constructs a new Normal-variant ConfirmationTarget
18427 enum LDKConfirmationTarget ConfirmationTarget_normal(void);
18430 * Utility method to constructs a new HighPriority-variant ConfirmationTarget
18432 enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
18435 * Checks if two ConfirmationTargets contain equal inner contents.
18436 * This ignores pointers and is_owned flags and looks at the values in fields.
18438 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
18441 * Calls the free function if one is set
18443 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
18446 * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
18448 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
18451 * Creates a copy of the MonitorUpdateId
18453 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
18456 * Checks if two MonitorUpdateIds contain equal inner contents.
18458 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
18461 * Checks if two MonitorUpdateIds contain equal inner contents.
18462 * This ignores pointers and is_owned flags and looks at the values in fields.
18463 * Two objects with NULL inner values will be considered "equal" here.
18465 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
18468 * Calls the free function if one is set
18470 void Persist_free(struct LDKPersist this_ptr);
18473 * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
18475 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
18478 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
18480 void ChainMonitor_free(struct LDKChainMonitor this_obj);
18483 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
18485 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
18486 * will call back to it indicating transactions and outputs of interest. This allows clients to
18487 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
18488 * always need to fetch full blocks absent another means for determining which blocks contain
18489 * transactions relevant to the watched channels.
18491 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
18494 * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
18495 * claims which are awaiting confirmation.
18497 * Includes the balances from each [`ChannelMonitor`] *except* those included in
18498 * `ignored_channels`, allowing you to filter out balances from channels which are still open
18499 * (and whose balance should likely be pulled from the [`ChannelDetails`]).
18501 * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
18502 * inclusion in the return value.
18504 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
18507 * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
18508 * such [`ChannelMonitor`] is currently being monitored for.
18510 * Note that the result holds a mutex over our monitor set, and should not be held
18513 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
18516 * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
18518 * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
18519 * monitoring for on-chain state resolutions.
18521 MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
18524 * Indicates the persistence of a [`ChannelMonitor`] has completed after
18525 * [`ChannelMonitorUpdateErr::TemporaryFailure`] was returned from an update operation.
18527 * Thus, the anticipated use is, at a high level:
18528 * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
18529 * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
18530 * returning [`ChannelMonitorUpdateErr::TemporaryFailure`],
18531 * 2) once all remote copies are updated, you call this function with the
18532 * `completed_update_id` that completed, and once all pending updates have completed the
18533 * channel will be re-enabled.
18535 * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
18536 * registered [`ChannelMonitor`]s.
18538 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChainMonitor_channel_monitor_updated(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKMonitorUpdateId completed_update_id);
18541 * Constructs a new Listen which calls the relevant methods on this_arg.
18542 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
18544 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
18547 * Constructs a new Confirm which calls the relevant methods on this_arg.
18548 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
18550 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
18553 * Constructs a new Watch which calls the relevant methods on this_arg.
18554 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
18556 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
18559 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
18560 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
18562 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
18565 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
18567 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
18570 * The sequence number of this update. Updates *must* be replayed in-order according to this
18571 * sequence number (and updates may panic if they are not). The update_id values are strictly
18572 * increasing and increase by one for each new update, with one exception specified below.
18574 * This sequence number is also used to track up to which points updates which returned
18575 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
18576 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
18578 * The only instance where update_id values are not strictly increasing is the case where we
18579 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
18580 * its docs for more details.
18582 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
18585 * The sequence number of this update. Updates *must* be replayed in-order according to this
18586 * sequence number (and updates may panic if they are not). The update_id values are strictly
18587 * increasing and increase by one for each new update, with one exception specified below.
18589 * This sequence number is also used to track up to which points updates which returned
18590 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
18591 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
18593 * The only instance where update_id values are not strictly increasing is the case where we
18594 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
18595 * its docs for more details.
18597 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
18600 * Creates a copy of the ChannelMonitorUpdate
18602 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
18605 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
18607 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
18610 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
18612 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
18615 * Frees any resources used by the MonitorEvent
18617 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
18620 * Creates a copy of the MonitorEvent
18622 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
18625 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
18627 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
18630 * Utility method to constructs a new CommitmentTxConfirmed-variant MonitorEvent
18632 struct LDKMonitorEvent MonitorEvent_commitment_tx_confirmed(struct LDKOutPoint a);
18635 * Utility method to constructs a new UpdateCompleted-variant MonitorEvent
18637 struct LDKMonitorEvent MonitorEvent_update_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
18640 * Utility method to constructs a new UpdateFailed-variant MonitorEvent
18642 struct LDKMonitorEvent MonitorEvent_update_failed(struct LDKOutPoint a);
18645 * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
18647 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
18650 * Read a MonitorEvent from a byte array, created by MonitorEvent_write
18652 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
18655 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
18657 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
18660 * Creates a copy of the HTLCUpdate
18662 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
18665 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
18667 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
18670 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
18672 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
18675 * Frees any resources used by the Balance
18677 void Balance_free(struct LDKBalance this_ptr);
18680 * Creates a copy of the Balance
18682 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
18685 * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
18687 struct LDKBalance Balance_claimable_on_channel_close(uint64_t claimable_amount_satoshis);
18690 * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
18692 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t claimable_amount_satoshis, uint32_t confirmation_height);
18695 * Utility method to constructs a new ContentiousClaimable-variant Balance
18697 struct LDKBalance Balance_contentious_claimable(uint64_t claimable_amount_satoshis, uint32_t timeout_height);
18700 * Utility method to constructs a new MaybeClaimableHTLCAwaitingTimeout-variant Balance
18702 struct LDKBalance Balance_maybe_claimable_htlcawaiting_timeout(uint64_t claimable_amount_satoshis, uint32_t claimable_height);
18705 * Checks if two Balances contain equal inner contents.
18706 * This ignores pointers and is_owned flags and looks at the values in fields.
18708 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
18711 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
18713 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
18716 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
18718 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
18721 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
18724 * panics if the given update is not the next update by update_id.
18726 MUST_USE_RES struct LDKCResult_NoneNoneZ 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);
18729 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
18732 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18735 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
18737 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18740 * Gets a list of txids, with their output scripts (in the order they appear in the
18741 * transaction), which we must learn about spends of via block_connected().
18743 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18746 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
18747 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
18748 * have been registered.
18750 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
18753 * Get the list of HTLCs who's status has been updated on chain. This should be called by
18754 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
18756 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18759 * Gets the list of pending events which were generated by previous actions, clearing the list
18762 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
18763 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
18764 * no internal locking in ChannelMonitors.
18766 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18769 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
18770 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
18771 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
18772 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
18773 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
18774 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
18775 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
18776 * out-of-band the other node operator to coordinate with him if option is available to you.
18777 * In any-case, choice is up to the user.
18779 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);
18782 * Processes transactions in a newly connected block, which may result in any of the following:
18783 * - update the monitor's state against resolved HTLCs
18784 * - punish the counterparty in the case of seeing a revoked commitment transaction
18785 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
18786 * - detect settled outputs for later spending
18787 * - schedule and bump any in-flight claims
18789 * Returns any new outputs to watch from `txdata`; after called, these are also included in
18790 * [`get_outputs_to_watch`].
18792 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
18794 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);
18797 * Determines if the disconnected block contained any transactions of interest and updates
18800 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);
18803 * Processes transactions confirmed in a block with the given header and height, returning new
18804 * outputs to watch. See [`block_connected`] for details.
18806 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
18807 * blocks. See [`chain::Confirm`] for calling expectations.
18809 * [`block_connected`]: Self::block_connected
18811 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);
18814 * Processes a transaction that was reorganized out of the chain.
18816 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
18817 * than blocks. See [`chain::Confirm`] for calling expectations.
18819 * [`block_disconnected`]: Self::block_disconnected
18821 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);
18824 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
18825 * [`block_connected`] for details.
18827 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
18828 * blocks. See [`chain::Confirm`] for calling expectations.
18830 * [`block_connected`]: Self::block_connected
18832 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);
18835 * Returns the set of txids that should be monitored for re-organization out of the chain.
18837 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18840 * Gets the latest best block which was connected either via the [`chain::Listen`] or
18841 * [`chain::Confirm`] interfaces.
18843 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18846 * Gets the balances in this channel which are either claimable by us if we were to
18847 * force-close the channel now or which are claimable on-chain (possibly awaiting
18850 * Any balances in the channel which are available on-chain (excluding on-chain fees) are
18851 * included here until an [`Event::SpendableOutputs`] event has been generated for the
18852 * balance, or until our counterparty has claimed the balance and accrued several
18853 * confirmations on the claim transaction.
18855 * Note that the balances available when you or your counterparty have broadcasted revoked
18856 * state(s) may not be fully captured here.
18858 * See [`Balance`] for additional details on the types of claimable balances which
18859 * may be returned here and their meanings.
18861 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18864 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
18866 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
18869 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
18871 void OutPoint_free(struct LDKOutPoint this_obj);
18874 * The referenced transaction's txid.
18876 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
18879 * The referenced transaction's txid.
18881 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18884 * The index of the referenced output in its transaction's vout.
18886 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
18889 * The index of the referenced output in its transaction's vout.
18891 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
18894 * Constructs a new OutPoint given each field
18896 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
18899 * Creates a copy of the OutPoint
18901 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
18904 * Checks if two OutPoints contain equal inner contents.
18905 * This ignores pointers and is_owned flags and looks at the values in fields.
18906 * Two objects with NULL inner values will be considered "equal" here.
18908 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
18911 * Checks if two OutPoints contain equal inner contents.
18913 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
18916 * Convert an `OutPoint` to a lightning channel id.
18918 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
18921 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
18923 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
18926 * Read a OutPoint from a byte array, created by OutPoint_write
18928 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
18931 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
18933 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
18936 * The outpoint which is spendable
18938 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
18941 * The outpoint which is spendable
18943 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
18946 * Per commitment point to derive delayed_payment_key by key holder
18948 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
18951 * Per commitment point to derive delayed_payment_key by key holder
18953 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
18956 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
18957 * the witness_script.
18959 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
18962 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
18963 * the witness_script.
18965 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
18968 * The output which is referenced by the given outpoint
18970 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
18973 * The revocation point specific to the commitment transaction which was broadcast. Used to
18974 * derive the witnessScript for this output.
18976 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
18979 * The revocation point specific to the commitment transaction which was broadcast. Used to
18980 * derive the witnessScript for this output.
18982 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
18985 * Arbitrary identification information returned by a call to
18986 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
18987 * the channel to spend the output.
18989 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
18992 * Arbitrary identification information returned by a call to
18993 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
18994 * the channel to spend the output.
18996 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18999 * The value of the channel which this output originated from, possibly indirectly.
19001 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19004 * The value of the channel which this output originated from, possibly indirectly.
19006 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
19009 * Constructs a new DelayedPaymentOutputDescriptor given each field
19011 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);
19014 * Creates a copy of the DelayedPaymentOutputDescriptor
19016 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
19019 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
19021 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
19024 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
19026 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
19029 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
19031 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
19034 * The outpoint which is spendable
19036 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19039 * The outpoint which is spendable
19041 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
19044 * The output which is referenced by the given outpoint
19046 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
19049 * Arbitrary identification information returned by a call to
19050 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
19051 * the channel to spend the output.
19053 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
19056 * Arbitrary identification information returned by a call to
19057 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
19058 * the channel to spend the output.
19060 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19063 * The value of the channel which this transactions spends.
19065 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19068 * The value of the channel which this transactions spends.
19070 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
19073 * Constructs a new StaticPaymentOutputDescriptor given each field
19075 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);
19078 * Creates a copy of the StaticPaymentOutputDescriptor
19080 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
19083 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
19085 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
19088 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
19090 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
19093 * Frees any resources used by the SpendableOutputDescriptor
19095 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
19098 * Creates a copy of the SpendableOutputDescriptor
19100 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
19103 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
19105 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
19108 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
19110 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
19113 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
19115 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
19118 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
19120 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
19123 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
19125 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
19128 * Calls the free function if one is set
19130 void BaseSign_free(struct LDKBaseSign this_ptr);
19133 * Creates a copy of a Sign
19135 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
19138 * Calls the free function if one is set
19140 void Sign_free(struct LDKSign this_ptr);
19143 * Creates a copy of the Recipient
19145 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
19148 * Utility method to constructs a new Node-variant Recipient
19150 enum LDKRecipient Recipient_node(void);
19153 * Utility method to constructs a new PhantomNode-variant Recipient
19155 enum LDKRecipient Recipient_phantom_node(void);
19158 * Calls the free function if one is set
19160 void KeysInterface_free(struct LDKKeysInterface this_ptr);
19163 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
19165 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
19168 * Private key of anchor tx
19170 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19173 * Private key of anchor tx
19175 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19178 * Holder secret key for blinded revocation pubkey
19180 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19183 * Holder secret key for blinded revocation pubkey
19185 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19188 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
19190 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19193 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
19195 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19198 * Holder secret key used in HTLC tx
19200 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19203 * Holder secret key used in HTLC tx
19205 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19208 * Holder htlc secret key used in commitment tx htlc outputs
19210 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19213 * Holder htlc secret key used in commitment tx htlc outputs
19215 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19220 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19225 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19228 * Creates a copy of the InMemorySigner
19230 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
19233 * Create a new InMemorySigner
19235 MUST_USE_RES struct LDKInMemorySigner InMemorySigner_new(struct LDKSecretKey node_secret, 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);
19238 * Counterparty pubkeys.
19239 * Will panic if ready_channel wasn't called.
19241 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19244 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
19245 * transactions, ie the amount of time that we have to wait to recover our funds if we
19246 * broadcast a transaction.
19247 * Will panic if ready_channel wasn't called.
19249 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19252 * The contest_delay value specified by us and applied on transactions broadcastable
19253 * by our counterparty, ie the amount of time that they have to wait to recover their funds
19254 * if they broadcast a transaction.
19255 * Will panic if ready_channel wasn't called.
19257 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19260 * Whether the holder is the initiator
19261 * Will panic if ready_channel wasn't called.
19263 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19267 * Will panic if ready_channel wasn't called.
19269 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19272 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
19273 * building transactions.
19275 * Will panic if ready_channel wasn't called.
19277 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19280 * Whether anchors should be used.
19281 * Will panic if ready_channel wasn't called.
19283 MUST_USE_RES bool InMemorySigner_opt_anchors(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19286 * Sign the single input of spend_tx at index `input_idx` which spends the output
19287 * described by descriptor, returning the witness stack for the input.
19289 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
19290 * is not spending the outpoint described by `descriptor.outpoint`,
19291 * or if an output descriptor script_pubkey does not match the one we can spend.
19293 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);
19296 * Sign the single input of spend_tx at index `input_idx` which spends the output
19297 * described by descriptor, returning the witness stack for the input.
19299 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
19300 * is not spending the outpoint described by `descriptor.outpoint`, does not have a
19301 * sequence set to `descriptor.to_self_delay`, or if an output descriptor
19302 * script_pubkey does not match the one we can spend.
19304 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);
19307 * Constructs a new BaseSign which calls the relevant methods on this_arg.
19308 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
19310 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19313 * Constructs a new Sign which calls the relevant methods on this_arg.
19314 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
19316 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19319 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
19321 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
19324 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
19326 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKSecretKey arg);
19329 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
19331 void KeysManager_free(struct LDKKeysManager this_obj);
19334 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
19335 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
19336 * starting_time isn't strictly required to actually be a time, but it must absolutely,
19337 * without a doubt, be unique to this instance. ie if you start multiple times with the same
19338 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
19339 * simply use the current time (with very high precision).
19341 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
19342 * obviously, starting_time should be unique every time you reload the library - it is only
19343 * used to generate new ephemeral key data (which will be stored by the individual channel if
19346 * Note that the seed is required to recover certain on-chain funds independent of
19347 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
19348 * channel, and some on-chain during-closing funds.
19350 * Note that until the 0.1 release there is no guarantee of backward compatibility between
19351 * versions. Once the library is more fully supported, the docs will be updated to include a
19352 * detailed description of the guarantee.
19354 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
19357 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
19359 * Key derivation parameters are accessible through a per-channel secrets
19360 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
19361 * onchain output detection for which a corresponding delayed_payment_key must be derived.
19363 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]);
19366 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
19367 * output to the given change destination (if sufficient change value remains). The
19368 * transaction will have a feerate, at least, of the given value.
19370 * Returns `Err(())` if the output value is greater than the input value minus required fee,
19371 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
19372 * does not match the one we can spend.
19374 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
19376 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
19377 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
19379 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);
19382 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
19383 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
19385 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
19388 * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
19390 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
19393 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
19394 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
19396 struct LDKKeysInterface PhantomKeysManager_as_KeysInterface(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
19399 * Constructs a `PhantomKeysManager` given a 32-byte seed and an additional `cross_node_seed`
19400 * that is shared across all nodes that intend to participate in [phantom node payments] together.
19402 * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
19403 * `starting_time_nanos`.
19405 * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
19406 * same across restarts, or else inbound payments may fail.
19408 * [phantom node payments]: PhantomKeysManager
19410 MUST_USE_RES struct LDKPhantomKeysManager PhantomKeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos, const uint8_t (*cross_node_seed)[32]);
19413 * See [`KeysManager::spend_spendable_outputs`] for documentation on this method.
19415 MUST_USE_RES struct LDKCResult_TransactionNoneZ PhantomKeysManager_spend_spendable_outputs(const struct LDKPhantomKeysManager *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);
19418 * See [`KeysManager::derive_channel_keys`] for documentation on this method.
19420 MUST_USE_RES struct LDKInMemorySigner PhantomKeysManager_derive_channel_keys(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, const uint8_t (*params)[32]);
19423 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
19425 void ChannelManager_free(struct LDKChannelManager this_obj);
19428 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
19430 void ChainParameters_free(struct LDKChainParameters this_obj);
19433 * The network for determining the `chain_hash` in Lightning messages.
19435 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
19438 * The network for determining the `chain_hash` in Lightning messages.
19440 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
19443 * The hash and height of the latest block successfully connected.
19445 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
19447 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
19450 * The hash and height of the latest block successfully connected.
19452 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
19454 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
19457 * Constructs a new ChainParameters given each field
19459 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
19462 * Creates a copy of the ChainParameters
19464 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
19467 * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
19469 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
19472 * Base routing fee in millisatoshis.
19474 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
19477 * Base routing fee in millisatoshis.
19479 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
19482 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
19484 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
19487 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
19489 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
19492 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
19493 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
19494 * `cltv_expiry_delta` for more details.
19496 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
19499 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
19500 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
19501 * `cltv_expiry_delta` for more details.
19503 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
19506 * Constructs a new CounterpartyForwardingInfo given each field
19508 MUST_USE_RES struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_new(uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg);
19511 * Creates a copy of the CounterpartyForwardingInfo
19513 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
19516 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
19518 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
19521 * The node_id of our counterparty
19523 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19526 * The node_id of our counterparty
19528 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19531 * The Features the channel counterparty provided upon last connection.
19532 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
19533 * many routing-relevant features are present in the init context.
19535 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19538 * The Features the channel counterparty provided upon last connection.
19539 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
19540 * many routing-relevant features are present in the init context.
19542 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
19545 * The value, in satoshis, that must always be held in the channel for our counterparty. This
19546 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
19547 * claiming at least this value on chain.
19549 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
19551 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
19553 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19556 * The value, in satoshis, that must always be held in the channel for our counterparty. This
19557 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
19558 * claiming at least this value on chain.
19560 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
19562 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
19564 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
19567 * Information on the fees and requirements that the counterparty requires when forwarding
19568 * payments to us through this channel.
19570 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19572 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19575 * Information on the fees and requirements that the counterparty requires when forwarding
19576 * payments to us through this channel.
19578 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
19580 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
19583 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
19584 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
19585 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
19587 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19590 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
19591 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
19592 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
19594 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
19597 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
19599 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19602 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
19604 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
19607 * Constructs a new ChannelCounterparty given each field
19609 MUST_USE_RES struct LDKChannelCounterparty ChannelCounterparty_new(struct LDKPublicKey node_id_arg, struct LDKInitFeatures features_arg, uint64_t unspendable_punishment_reserve_arg, struct LDKCounterpartyForwardingInfo forwarding_info_arg, struct LDKCOption_u64Z outbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z outbound_htlc_maximum_msat_arg);
19612 * Creates a copy of the ChannelCounterparty
19614 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
19617 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
19619 void ChannelDetails_free(struct LDKChannelDetails this_obj);
19622 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
19623 * thereafter this is the txid of the funding transaction xor the funding transaction output).
19624 * Note that this means this value is *not* persistent - it can change once during the
19625 * lifetime of the channel.
19627 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
19630 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
19631 * thereafter this is the txid of the funding transaction xor the funding transaction output).
19632 * Note that this means this value is *not* persistent - it can change once during the
19633 * lifetime of the channel.
19635 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19638 * Parameters which apply to our counterparty. See individual fields for more information.
19640 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19643 * Parameters which apply to our counterparty. See individual fields for more information.
19645 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
19648 * The Channel's funding transaction output, if we've negotiated the funding transaction with
19649 * our counterparty already.
19651 * Note that, if this has been set, `channel_id` will be equivalent to
19652 * `funding_txo.unwrap().to_channel_id()`.
19654 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19656 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19659 * The Channel's funding transaction output, if we've negotiated the funding transaction with
19660 * our counterparty already.
19662 * Note that, if this has been set, `channel_id` will be equivalent to
19663 * `funding_txo.unwrap().to_channel_id()`.
19665 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
19667 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
19670 * The features which this channel operates with. See individual features for more info.
19672 * `None` until negotiation completes and the channel type is finalized.
19674 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19676 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19679 * The features which this channel operates with. See individual features for more info.
19681 * `None` until negotiation completes and the channel type is finalized.
19683 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
19685 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
19688 * The position of the funding transaction in the chain. None if the funding transaction has
19689 * not yet been confirmed and the channel fully opened.
19691 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
19692 * payments instead of this. See [`get_inbound_payment_scid`].
19694 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
19695 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
19697 * [`inbound_scid_alias`]: Self::inbound_scid_alias
19698 * [`outbound_scid_alias`]: Self::outbound_scid_alias
19699 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
19700 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
19701 * [`confirmations_required`]: Self::confirmations_required
19703 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19706 * The position of the funding transaction in the chain. None if the funding transaction has
19707 * not yet been confirmed and the channel fully opened.
19709 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
19710 * payments instead of this. See [`get_inbound_payment_scid`].
19712 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
19713 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
19715 * [`inbound_scid_alias`]: Self::inbound_scid_alias
19716 * [`outbound_scid_alias`]: Self::outbound_scid_alias
19717 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
19718 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
19719 * [`confirmations_required`]: Self::confirmations_required
19721 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
19724 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
19725 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
19726 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
19729 * This will be `None` as long as the channel is not available for routing outbound payments.
19731 * [`short_channel_id`]: Self::short_channel_id
19732 * [`confirmations_required`]: Self::confirmations_required
19734 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19737 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
19738 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
19739 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
19742 * This will be `None` as long as the channel is not available for routing outbound payments.
19744 * [`short_channel_id`]: Self::short_channel_id
19745 * [`confirmations_required`]: Self::confirmations_required
19747 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
19750 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
19751 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
19752 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
19753 * when they see a payment to be routed to us.
19755 * Our counterparty may choose to rotate this value at any time, though will always recognize
19756 * previous values for inbound payment forwarding.
19758 * [`short_channel_id`]: Self::short_channel_id
19760 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19763 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
19764 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
19765 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
19766 * when they see a payment to be routed to us.
19768 * Our counterparty may choose to rotate this value at any time, though will always recognize
19769 * previous values for inbound payment forwarding.
19771 * [`short_channel_id`]: Self::short_channel_id
19773 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
19776 * The value, in satoshis, of this channel as appears in the funding output
19778 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19781 * The value, in satoshis, of this channel as appears in the funding output
19783 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19786 * The value, in satoshis, that must always be held in the channel for us. This value ensures
19787 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
19788 * this value on chain.
19790 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
19792 * This value will be `None` for outbound channels until the counterparty accepts the channel.
19794 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
19796 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19799 * The value, in satoshis, that must always be held in the channel for us. This value ensures
19800 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
19801 * this value on chain.
19803 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
19805 * This value will be `None` for outbound channels until the counterparty accepts the channel.
19807 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
19809 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
19812 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
19814 uint64_t ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19817 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
19819 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19822 * Our total balance. This is the amount we would get if we close the channel.
19823 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
19824 * amount is not likely to be recoverable on close.
19826 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
19827 * balance is not available for inclusion in new outbound HTLCs). This further does not include
19828 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
19829 * This does not consider any on-chain fees.
19831 * See also [`ChannelDetails::outbound_capacity_msat`]
19833 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19836 * Our total balance. This is the amount we would get if we close the channel.
19837 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
19838 * amount is not likely to be recoverable on close.
19840 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
19841 * balance is not available for inclusion in new outbound HTLCs). This further does not include
19842 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
19843 * This does not consider any on-chain fees.
19845 * See also [`ChannelDetails::outbound_capacity_msat`]
19847 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19850 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
19851 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
19852 * available for inclusion in new outbound HTLCs). This further does not include any pending
19853 * outgoing HTLCs which are awaiting some other resolution to be sent.
19855 * See also [`ChannelDetails::balance_msat`]
19857 * This value is not exact. Due to various in-flight changes, feerate changes, and our
19858 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
19859 * should be able to spend nearly this amount.
19861 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19864 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
19865 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
19866 * available for inclusion in new outbound HTLCs). This further does not include any pending
19867 * outgoing HTLCs which are awaiting some other resolution to be sent.
19869 * See also [`ChannelDetails::balance_msat`]
19871 * This value is not exact. Due to various in-flight changes, feerate changes, and our
19872 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
19873 * should be able to spend nearly this amount.
19875 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19878 * The available outbound capacity for sending a single HTLC to the remote peer. This is
19879 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
19880 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
19881 * to use a limit as close as possible to the HTLC limit we can currently send.
19883 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
19885 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19888 * The available outbound capacity for sending a single HTLC to the remote peer. This is
19889 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
19890 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
19891 * to use a limit as close as possible to the HTLC limit we can currently send.
19893 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
19895 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19898 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
19899 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
19900 * available for inclusion in new inbound HTLCs).
19901 * Note that there are some corner cases not fully handled here, so the actual available
19902 * inbound capacity may be slightly higher than this.
19904 * This value is not exact. Due to various in-flight changes, feerate changes, and our
19905 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
19906 * However, our counterparty should be able to spend nearly this amount.
19908 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19911 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
19912 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
19913 * available for inclusion in new inbound HTLCs).
19914 * Note that there are some corner cases not fully handled here, so the actual available
19915 * inbound capacity may be slightly higher than this.
19917 * This value is not exact. Due to various in-flight changes, feerate changes, and our
19918 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
19919 * However, our counterparty should be able to spend nearly this amount.
19921 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19924 * The number of required confirmations on the funding transaction before the funding will be
19925 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
19926 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
19927 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
19928 * [`ChannelHandshakeLimits::max_minimum_depth`].
19930 * This value will be `None` for outbound channels until the counterparty accepts the channel.
19932 * [`is_outbound`]: ChannelDetails::is_outbound
19933 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
19934 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
19936 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19939 * The number of required confirmations on the funding transaction before the funding will be
19940 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
19941 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
19942 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
19943 * [`ChannelHandshakeLimits::max_minimum_depth`].
19945 * This value will be `None` for outbound channels until the counterparty accepts the channel.
19947 * [`is_outbound`]: ChannelDetails::is_outbound
19948 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
19949 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
19951 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
19954 * The number of blocks (after our commitment transaction confirms) that we will need to wait
19955 * until we can claim our funds after we force-close the channel. During this time our
19956 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
19957 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
19958 * time to claim our non-HTLC-encumbered funds.
19960 * This value will be `None` for outbound channels until the counterparty accepts the channel.
19962 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19965 * The number of blocks (after our commitment transaction confirms) that we will need to wait
19966 * until we can claim our funds after we force-close the channel. During this time our
19967 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
19968 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
19969 * time to claim our non-HTLC-encumbered funds.
19971 * This value will be `None` for outbound channels until the counterparty accepts the channel.
19973 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
19976 * True if the channel was initiated (and thus funded) by us.
19978 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19981 * True if the channel was initiated (and thus funded) by us.
19983 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
19986 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
19987 * channel is not currently being shut down. `channel_ready` message exchange implies the
19988 * required confirmation count has been reached (and we were connected to the peer at some
19989 * point after the funding transaction received enough confirmations). The required
19990 * confirmation count is provided in [`confirmations_required`].
19992 * [`confirmations_required`]: ChannelDetails::confirmations_required
19994 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19997 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
19998 * channel is not currently being shut down. `channel_ready` message exchange implies the
19999 * required confirmation count has been reached (and we were connected to the peer at some
20000 * point after the funding transaction received enough confirmations). The required
20001 * confirmation count is provided in [`confirmations_required`].
20003 * [`confirmations_required`]: ChannelDetails::confirmations_required
20005 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
20008 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
20009 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
20011 * This is a strict superset of `is_channel_ready`.
20013 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20016 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
20017 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
20019 * This is a strict superset of `is_channel_ready`.
20021 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
20024 * True if this channel is (or will be) publicly-announced.
20026 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20029 * True if this channel is (or will be) publicly-announced.
20031 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
20034 * The smallest value HTLC (in msat) we will accept, for this channel. This field
20035 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
20037 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20040 * The smallest value HTLC (in msat) we will accept, for this channel. This field
20041 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
20043 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20046 * The largest value HTLC (in msat) we currently will accept, for this channel.
20048 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20051 * The largest value HTLC (in msat) we currently will accept, for this channel.
20053 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20056 * Constructs a new ChannelDetails given each field
20058 MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKChannelTypeFeatures channel_type_arg, struct LDKCOption_u64Z short_channel_id_arg, struct LDKCOption_u64Z outbound_scid_alias_arg, struct LDKCOption_u64Z inbound_scid_alias_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, uint64_t user_channel_id_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t next_outbound_htlc_limit_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_channel_ready_arg, bool is_usable_arg, bool is_public_arg, struct LDKCOption_u64Z inbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z inbound_htlc_maximum_msat_arg);
20061 * Creates a copy of the ChannelDetails
20063 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
20066 * Gets the current SCID which should be used to identify this channel for inbound payments.
20067 * This should be used for providing invoice hints or in any other context where our
20068 * counterparty will forward a payment to us.
20070 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
20071 * [`ChannelDetails::short_channel_id`]. See those for more information.
20073 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
20076 * Gets the current SCID which should be used to identify this channel for outbound payments.
20077 * This should be used in [`Route`]s to describe the first hop or in other contexts where
20078 * we're sending or forwarding a payment outbound over this channel.
20080 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
20081 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
20083 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
20086 * Frees any resources used by the PaymentSendFailure
20088 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
20091 * Creates a copy of the PaymentSendFailure
20093 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
20096 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
20098 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
20101 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
20103 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
20106 * Utility method to constructs a new AllFailedRetrySafe-variant PaymentSendFailure
20108 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_retry_safe(struct LDKCVec_APIErrorZ a);
20111 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
20113 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
20116 * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
20118 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
20121 * The list of channels to be included in the invoice route hints.
20123 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
20126 * The list of channels to be included in the invoice route hints.
20128 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
20131 * A fake scid used for representing the phantom node's fake channel in generating the invoice
20134 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
20137 * A fake scid used for representing the phantom node's fake channel in generating the invoice
20140 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
20143 * The pubkey of the real backing node that would ultimately receive the payment.
20145 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
20148 * The pubkey of the real backing node that would ultimately receive the payment.
20150 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20153 * Constructs a new PhantomRouteHints given each field
20155 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
20158 * Creates a copy of the PhantomRouteHints
20160 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
20163 * Constructs a new ChannelManager to hold several channels and route between them.
20165 * This is the main \"logic hub\" for all channel-related actions, and implements
20166 * ChannelMessageHandler.
20168 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
20170 * Users need to notify the new ChannelManager when a new block is connected or
20171 * disconnected using its `block_connected` and `block_disconnected` methods, starting
20172 * from after `params.latest_hash`.
20174 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);
20177 * Gets the current configuration applied to all new channels, as
20179 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
20182 * Creates a new outbound channel to the given remote node and with the given value.
20184 * `user_channel_id` will be provided back as in
20185 * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
20186 * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to 0
20187 * for inbound channels, so you may wish to avoid using 0 for `user_channel_id` here.
20188 * `user_channel_id` has no meaning inside of LDK, it is simply copied to events and otherwise
20191 * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
20192 * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
20194 * Note that we do not check if you are currently connected to the given peer. If no
20195 * connection is available, the outbound `open_channel` message may fail to send, resulting in
20196 * the channel eventually being silently forgotten (dropped on reload).
20198 * Returns the new Channel's temporary `channel_id`. This ID will appear as
20199 * [`Event::FundingGenerationReady::temporary_channel_id`] and in
20200 * [`ChannelDetails::channel_id`] until after
20201 * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
20202 * one derived from the funding transaction's TXID. If the counterparty rejects the channel
20203 * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
20205 * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
20206 * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
20207 * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
20209 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
20211 MUST_USE_RES struct LDKCResult__u832APIErrorZ 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_channel_id, struct LDKUserConfig override_config);
20214 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
20215 * more information.
20217 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
20220 * Gets the list of usable channels, in random order. Useful as an argument to [`find_route`]
20221 * to ensure non-announced channels are used.
20223 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
20224 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
20227 * [`find_route`]: crate::routing::router::find_route
20229 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
20232 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
20233 * will be accepted on the given channel, and after additional timeout/the closing of all
20234 * pending HTLCs, the channel will be closed on chain.
20236 * * If we are the channel initiator, we will pay between our [`Background`] and
20237 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
20239 * * If our counterparty is the channel initiator, we will require a channel closing
20240 * transaction feerate of at least our [`Background`] feerate or the feerate which
20241 * would appear on a force-closure transaction, whichever is lower. We will allow our
20242 * counterparty to pay as much fee as they'd like, however.
20244 * May generate a SendShutdown message event on success, which should be relayed.
20246 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
20247 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
20248 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
20250 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id);
20253 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
20254 * will be accepted on the given channel, and after additional timeout/the closing of all
20255 * pending HTLCs, the channel will be closed on chain.
20257 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
20258 * the channel being closed or not:
20259 * * If we are the channel initiator, we will pay at least this feerate on the closing
20260 * transaction. The upper-bound is set by
20261 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
20262 * estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
20263 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
20264 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
20265 * will appear on a force-closure transaction, whichever is lower).
20267 * May generate a SendShutdown message event on success, which should be relayed.
20269 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
20270 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
20271 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
20273 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_target_feerate(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id, uint32_t target_feerate_sats_per_1000_weight);
20276 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
20277 * the chain and rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
20278 * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
20281 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id);
20284 * Force close all channels, immediately broadcasting the latest local commitment transaction
20285 * for each to the chain and rejecting new HTLCs on each.
20287 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
20290 * Sends a payment along a given route.
20292 * Value parameters are provided via the last hop in route, see documentation for RouteHop
20293 * fields for more info.
20295 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
20296 * payment), we don't do anything to stop you! We always try to ensure that if the provided
20297 * next hop knows the preimage to payment_hash they can claim an additional amount as
20298 * specified in the last hop in the route! Thus, you should probably do your own
20299 * payment_preimage tracking (which you should already be doing as they represent \"proof of
20300 * payment\") and prevent double-sends yourself.
20302 * May generate SendHTLCs message(s) event on success, which should be relayed.
20304 * Each path may have a different return value, and PaymentSendValue may return a Vec with
20305 * each entry matching the corresponding-index entry in the route paths, see
20306 * PaymentSendFailure for more info.
20308 * In general, a path may raise:
20309 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
20310 * node public key) is specified.
20311 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
20312 * (including due to previous monitor update failure or new permanent monitor update
20314 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
20315 * relevant updates.
20317 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
20318 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
20319 * different route unless you intend to pay twice!
20321 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
20322 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
20323 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
20324 * must not contain multiple paths as multi-path payments require a recipient-provided
20326 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
20327 * bit set (either as required or as available). If multiple paths are present in the Route,
20328 * we assume the invoice had the basic_mpp feature set.
20330 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
20332 MUST_USE_RES struct LDKCResult_PaymentIdPaymentSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
20335 * Retries a payment along the given [`Route`].
20337 * Errors returned are a superset of those returned from [`send_payment`], so see
20338 * [`send_payment`] documentation for more details on errors. This method will also error if the
20339 * retry amount puts the payment more than 10% over the payment's total amount, if the payment
20340 * for the given `payment_id` cannot be found (likely due to timeout or success), or if
20341 * further retries have been disabled with [`abandon_payment`].
20343 * [`send_payment`]: [`ChannelManager::send_payment`]
20344 * [`abandon_payment`]: [`ChannelManager::abandon_payment`]
20346 MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_retry_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id);
20349 * Signals that no further retries for the given payment will occur.
20351 * After this method returns, any future calls to [`retry_payment`] for the given `payment_id`
20352 * will fail with [`PaymentSendFailure::ParameterError`]. If no such event has been generated,
20353 * an [`Event::PaymentFailed`] event will be generated as soon as there are no remaining
20354 * pending HTLCs for this payment.
20356 * Note that calling this method does *not* prevent a payment from succeeding. You must still
20357 * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
20358 * determine the ultimate status of a payment.
20360 * [`retry_payment`]: Self::retry_payment
20361 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
20362 * [`Event::PaymentSent`]: events::Event::PaymentSent
20364 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
20367 * Send a spontaneous payment, which is a payment that does not require the recipient to have
20368 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
20369 * the preimage, it must be a cryptographically secure random value that no intermediate node
20370 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
20371 * never reach the recipient.
20373 * See [`send_payment`] documentation for more details on the return value of this function.
20375 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
20376 * [`send_payment`] for more information about the risks of duplicate preimage usage.
20378 * Note that `route` must have exactly one path.
20380 * [`send_payment`]: Self::send_payment
20382 * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
20384 MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage);
20387 * Call this upon creation of a funding transaction for the given channel.
20389 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
20390 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
20392 * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
20393 * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
20395 * May panic if the output found in the funding transaction is duplicative with some other
20396 * channel (note that this should be trivially prevented by using unique funding transaction
20397 * keys per-channel).
20399 * Do NOT broadcast the funding transaction yourself. When we have safely received our
20400 * counterparty's signature the funding transaction will automatically be broadcast via the
20401 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
20403 * Note that this includes RBF or similar transaction replacement strategies - lightning does
20404 * not currently support replacing a funding transaction on an existing channel. Instead,
20405 * create a new channel with a conflicting funding transaction.
20407 * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
20408 * [`Event::ChannelClosed`]: crate::util::events::Event::ChannelClosed
20410 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 LDKPublicKey counterparty_node_id, struct LDKTransaction funding_transaction);
20413 * Regenerates channel_announcements and generates a signed node_announcement from the given
20414 * arguments, providing them in corresponding events via
20415 * [`get_and_clear_pending_msg_events`], if at least one public channel has been confirmed
20416 * on-chain. This effectively re-broadcasts all channel announcements and sends our node
20417 * announcement to ensure that the lightning P2P network is aware of the channels we have and
20418 * our network addresses.
20420 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
20421 * node to humans. They carry no in-protocol meaning.
20423 * `addresses` represent the set (possibly empty) of socket addresses on which this node
20424 * accepts incoming connections. These will be included in the node_announcement, publicly
20425 * tying these addresses together and to this node. If you wish to preserve user privacy,
20426 * addresses should likely contain only Tor Onion addresses.
20428 * Panics if `addresses` is absurdly large (more than 500).
20430 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
20432 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
20435 * Processes HTLCs which are pending waiting on random forward delay.
20437 * Should only really ever be called in response to a PendingHTLCsForwardable event.
20438 * Will likely generate further events.
20440 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
20443 * Performs actions which should happen on startup and roughly once per minute thereafter.
20445 * This currently includes:
20446 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
20447 * * Broadcasting `ChannelUpdate` messages if we've been disconnected from our peer for more
20448 * than a minute, informing the network that they should no longer attempt to route over
20451 * Note that this may cause reentrancy through `chain::Watch::update_channel` calls or feerate
20452 * estimate fetches.
20454 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
20457 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
20458 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
20459 * along the path (including in our own channel on which we received it).
20461 * Note that in some cases around unclean shutdown, it is possible the payment may have
20462 * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
20463 * second copy of) the [`events::Event::PaymentReceived`] event. Alternatively, the payment
20464 * may have already been failed automatically by LDK if it was nearing its expiration time.
20466 * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
20467 * [`ChannelManager::claim_funds`]), you should still monitor for
20468 * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
20469 * startup during which time claims that were in-progress at shutdown may be replayed.
20471 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
20474 * Provides a payment preimage in response to [`Event::PaymentReceived`], generating any
20475 * [`MessageSendEvent`]s needed to claim the payment.
20477 * Note that calling this method does *not* guarantee that the payment has been claimed. You
20478 * *must* wait for an [`Event::PaymentClaimed`] event which upon a successful claim will be
20479 * provided to your [`EventHandler`] when [`process_pending_events`] is next called.
20481 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
20482 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
20483 * event matches your expectation. If you fail to do so and call this method, you may provide
20484 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
20486 * [`Event::PaymentReceived`]: crate::util::events::Event::PaymentReceived
20487 * [`Event::PaymentClaimed`]: crate::util::events::Event::PaymentClaimed
20488 * [`process_pending_events`]: EventsProvider::process_pending_events
20489 * [`create_inbound_payment`]: Self::create_inbound_payment
20490 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
20491 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
20493 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
20496 * Gets the node_id held by this ChannelManager
20498 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
20501 * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
20503 * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
20504 * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
20507 * The `user_channel_id` parameter will be provided back in
20508 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
20509 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
20511 * Note that this method will return an error and reject the channel, if it requires support
20512 * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
20513 * used to accept such channels.
20515 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
20516 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
20518 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, uint64_t user_channel_id);
20521 * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
20522 * it as confirmed immediately.
20524 * The `user_channel_id` parameter will be provided back in
20525 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
20526 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
20528 * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
20529 * and (if the counterparty agrees), enables forwarding of payments immediately.
20531 * This fully trusts that the counterparty has honestly and correctly constructed the funding
20532 * transaction and blindly assumes that it will eventually confirm.
20534 * If it does not confirm before we decide to close the channel, or if the funding transaction
20535 * does not pay to the correct script the correct amount, *you will lose funds*.
20537 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
20538 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
20540 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, uint64_t user_channel_id);
20543 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
20546 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
20547 * [`PaymentHash`] and [`PaymentPreimage`] for you.
20549 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
20550 * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
20551 * passed directly to [`claim_funds`].
20553 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
20555 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
20556 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
20560 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
20561 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
20563 * Errors if `min_value_msat` is greater than total bitcoin supply.
20565 * [`claim_funds`]: Self::claim_funds
20566 * [`PaymentReceived`]: events::Event::PaymentReceived
20567 * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
20568 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
20570 MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
20573 * Legacy version of [`create_inbound_payment`]. Use this method if you wish to share
20574 * serialized state with LDK node(s) running 0.0.103 and earlier.
20576 * May panic if `invoice_expiry_delta_secs` is greater than one year.
20579 * This method is deprecated and will be removed soon.
20581 * [`create_inbound_payment`]: Self::create_inbound_payment
20583 MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ChannelManager_create_inbound_payment_legacy(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
20586 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
20587 * stored external to LDK.
20589 * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a
20590 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
20591 * the `min_value_msat` provided here, if one is provided.
20593 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
20594 * note that LDK will not stop you from registering duplicate payment hashes for inbound
20597 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
20598 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
20599 * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the
20600 * sender \"proof-of-payment\" unless they have paid the required amount.
20602 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
20603 * in excess of the current time. This should roughly match the expiry time set in the invoice.
20604 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
20605 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
20606 * invoices when no timeout is set.
20608 * Note that we use block header time to time-out pending inbound payments (with some margin
20609 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
20610 * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry.
20611 * If you need exact expiry semantics, you should enforce them upon receipt of
20612 * [`PaymentReceived`].
20614 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
20615 * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
20617 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
20618 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
20622 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
20623 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
20625 * Errors if `min_value_msat` is greater than total bitcoin supply.
20627 * [`create_inbound_payment`]: Self::create_inbound_payment
20628 * [`PaymentReceived`]: events::Event::PaymentReceived
20630 MUST_USE_RES struct LDKCResult_PaymentSecretNoneZ 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);
20633 * Legacy version of [`create_inbound_payment_for_hash`]. Use this method if you wish to share
20634 * serialized state with LDK node(s) running 0.0.103 and earlier.
20636 * May panic if `invoice_expiry_delta_secs` is greater than one year.
20639 * This method is deprecated and will be removed soon.
20641 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
20643 MUST_USE_RES struct LDKCResult_PaymentSecretAPIErrorZ ChannelManager_create_inbound_payment_for_hash_legacy(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
20646 * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
20647 * previously returned from [`create_inbound_payment`].
20649 * [`create_inbound_payment`]: Self::create_inbound_payment
20651 MUST_USE_RES struct LDKCResult_PaymentPreimageAPIErrorZ ChannelManager_get_payment_preimage(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
20654 * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
20655 * are used when constructing the phantom invoice's route hints.
20657 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
20659 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
20662 * Gets route hints for use in receiving [phantom node payments].
20664 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
20666 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
20669 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
20670 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
20672 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
20675 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
20676 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
20678 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
20681 * Constructs a new Listen which calls the relevant methods on this_arg.
20682 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
20684 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
20687 * Constructs a new Confirm which calls the relevant methods on this_arg.
20688 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
20690 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
20693 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
20694 * indicating whether persistence is necessary. Only one listener on
20695 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
20698 * Note that this method is not available with the `no-std` feature.
20700 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
20703 * Blocks until ChannelManager needs to be persisted. Only one listener on
20704 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
20707 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
20710 * Gets the latest best block which was connected either via the [`chain::Listen`] or
20711 * [`chain::Confirm`] interfaces.
20713 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
20716 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
20717 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
20719 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
20722 * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
20724 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
20727 * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
20729 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
20732 * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
20734 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
20737 * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
20739 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
20742 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
20744 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
20747 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
20749 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
20752 * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
20754 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
20757 * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
20759 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
20762 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
20764 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
20767 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
20769 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
20772 * The keys provider which will give us relevant keys. Some keys will be loaded during
20773 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
20776 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
20779 * The keys provider which will give us relevant keys. Some keys will be loaded during
20780 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
20783 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
20786 * The fee_estimator for use in the ChannelManager in the future.
20788 * No calls to the FeeEstimator will be made during deserialization.
20790 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
20793 * The fee_estimator for use in the ChannelManager in the future.
20795 * No calls to the FeeEstimator will be made during deserialization.
20797 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
20800 * The chain::Watch for use in the ChannelManager in the future.
20802 * No calls to the chain::Watch will be made during deserialization. It is assumed that
20803 * you have deserialized ChannelMonitors separately and will add them to your
20804 * chain::Watch after deserializing this ChannelManager.
20806 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
20809 * The chain::Watch for use in the ChannelManager in the future.
20811 * No calls to the chain::Watch will be made during deserialization. It is assumed that
20812 * you have deserialized ChannelMonitors separately and will add them to your
20813 * chain::Watch after deserializing this ChannelManager.
20815 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
20818 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
20819 * used to broadcast the latest local commitment transactions of channels which must be
20820 * force-closed during deserialization.
20822 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
20825 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
20826 * used to broadcast the latest local commitment transactions of channels which must be
20827 * force-closed during deserialization.
20829 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
20832 * The Logger for use in the ChannelManager and which may be used to log information during
20835 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
20838 * The Logger for use in the ChannelManager and which may be used to log information during
20841 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
20844 * Default settings used for new channels. Any existing channels will continue to use the
20845 * runtime settings which were stored when the ChannelManager was serialized.
20847 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
20850 * Default settings used for new channels. Any existing channels will continue to use the
20851 * runtime settings which were stored when the ChannelManager was serialized.
20853 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
20856 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
20857 * HashMap for you. This is primarily useful for C bindings where it is not practical to
20858 * populate a HashMap directly from C.
20860 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);
20863 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
20865 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
20868 * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
20870 void ExpandedKey_free(struct LDKExpandedKey this_obj);
20873 * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret.
20875 * It is recommended to cache this value and not regenerate it for each new inbound payment.
20877 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
20880 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
20881 * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
20882 * a `ChannelManager`.
20884 * `keys` is generated by calling [`KeysInterface::get_inbound_payment_key_material`] and then
20885 * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
20886 * regenerate it for each new inbound payment.
20888 * `current_time` is a Unix timestamp representing the current time.
20890 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
20892 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ create(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, const struct LDKKeysInterface *NONNULL_PTR keys_manager, uint64_t current_time);
20895 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
20896 * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
20897 * without a `ChannelManager`.
20899 * See [`create`] for information on the `keys` and `current_time` parameters.
20901 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
20903 struct LDKCResult_PaymentSecretNoneZ create_from_hash(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, struct LDKThirtyTwoBytes payment_hash, uint32_t invoice_expiry_delta_secs, uint64_t current_time);
20906 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
20908 void DecodeError_free(struct LDKDecodeError this_obj);
20911 * Creates a copy of the DecodeError
20913 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
20916 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
20918 void Init_free(struct LDKInit this_obj);
20921 * The relevant features which the sender supports
20923 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
20926 * The relevant features which the sender supports
20928 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
20931 * The receipient's network address. This adds the option to report a remote IP address
20932 * back to a connecting peer using the init message. A node can decide to use that information
20933 * to discover a potential update to its public IPv4 address (NAT) and use
20934 * that for a node_announcement update message containing the new address.
20936 struct LDKCOption_NetAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
20939 * The receipient's network address. This adds the option to report a remote IP address
20940 * back to a connecting peer using the init message. A node can decide to use that information
20941 * to discover a potential update to its public IPv4 address (NAT) and use
20942 * that for a node_announcement update message containing the new address.
20944 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_NetAddressZ val);
20947 * Constructs a new Init given each field
20949 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_NetAddressZ remote_network_address_arg);
20952 * Creates a copy of the Init
20954 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
20957 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
20959 void ErrorMessage_free(struct LDKErrorMessage this_obj);
20962 * The channel ID involved in the error.
20964 * All-0s indicates a general error unrelated to a specific channel, after which all channels
20965 * with the sending peer should be closed.
20967 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
20970 * The channel ID involved in the error.
20972 * All-0s indicates a general error unrelated to a specific channel, after which all channels
20973 * with the sending peer should be closed.
20975 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20978 * A possibly human-readable error description.
20979 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
20980 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
20981 * the terminal emulator or the logging subsystem.
20983 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
20986 * A possibly human-readable error description.
20987 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
20988 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
20989 * the terminal emulator or the logging subsystem.
20991 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
20994 * Constructs a new ErrorMessage given each field
20996 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
20999 * Creates a copy of the ErrorMessage
21001 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
21004 * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
21006 void WarningMessage_free(struct LDKWarningMessage this_obj);
21009 * The channel ID involved in the warning.
21011 * All-0s indicates a warning unrelated to a specific channel.
21013 const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32];
21016 * The channel ID involved in the warning.
21018 * All-0s indicates a warning unrelated to a specific channel.
21020 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21023 * A possibly human-readable warning description.
21024 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
21025 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
21026 * the terminal emulator or the logging subsystem.
21028 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
21031 * A possibly human-readable warning description.
21032 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
21033 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
21034 * the terminal emulator or the logging subsystem.
21036 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
21039 * Constructs a new WarningMessage given each field
21041 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
21044 * Creates a copy of the WarningMessage
21046 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
21049 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
21051 void Ping_free(struct LDKPing this_obj);
21054 * The desired response length
21056 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
21059 * The desired response length
21061 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
21064 * The ping packet size.
21065 * This field is not sent on the wire. byteslen zeros are sent.
21067 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
21070 * The ping packet size.
21071 * This field is not sent on the wire. byteslen zeros are sent.
21073 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
21076 * Constructs a new Ping given each field
21078 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
21081 * Creates a copy of the Ping
21083 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
21086 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
21088 void Pong_free(struct LDKPong this_obj);
21091 * The pong packet size.
21092 * This field is not sent on the wire. byteslen zeros are sent.
21094 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
21097 * The pong packet size.
21098 * This field is not sent on the wire. byteslen zeros are sent.
21100 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
21103 * Constructs a new Pong given each field
21105 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
21108 * Creates a copy of the Pong
21110 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
21113 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
21115 void OpenChannel_free(struct LDKOpenChannel this_obj);
21118 * The genesis hash of the blockchain where the channel is to be opened
21120 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
21123 * The genesis hash of the blockchain where the channel is to be opened
21125 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21128 * A temporary channel ID, until the funding outpoint is announced
21130 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
21133 * A temporary channel ID, until the funding outpoint is announced
21135 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21138 * The channel value
21140 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21143 * The channel value
21145 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21148 * The amount to push to the counterparty as part of the open, in milli-satoshi
21150 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21153 * The amount to push to the counterparty as part of the open, in milli-satoshi
21155 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21158 * The threshold below which outputs on transactions broadcast by sender will be omitted
21160 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21163 * The threshold below which outputs on transactions broadcast by sender will be omitted
21165 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21168 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
21170 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21173 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
21175 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21178 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
21180 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21183 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
21185 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21188 * The minimum HTLC size incoming to sender, in milli-satoshi
21190 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21193 * The minimum HTLC size incoming to sender, in milli-satoshi
21195 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21198 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
21200 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21203 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
21205 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
21208 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
21210 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21213 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
21215 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
21218 * The maximum number of inbound HTLCs towards sender
21220 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21223 * The maximum number of inbound HTLCs towards sender
21225 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
21228 * The sender's key controlling the funding transaction
21230 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21233 * The sender's key controlling the funding transaction
21235 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21238 * Used to derive a revocation key for transactions broadcast by counterparty
21240 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21243 * Used to derive a revocation key for transactions broadcast by counterparty
21245 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21248 * A payment key to sender for transactions broadcast by counterparty
21250 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21253 * A payment key to sender for transactions broadcast by counterparty
21255 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21258 * Used to derive a payment key to sender for transactions broadcast by sender
21260 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21263 * Used to derive a payment key to sender for transactions broadcast by sender
21265 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21268 * Used to derive an HTLC payment key to sender
21270 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21273 * Used to derive an HTLC payment key to sender
21275 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21278 * The first to-be-broadcast-by-sender transaction's per commitment point
21280 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21283 * The first to-be-broadcast-by-sender transaction's per commitment point
21285 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21290 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21295 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
21298 * The channel type that this channel will represent. If none is set, we derive the channel
21299 * type from the intersection of our feature bits with our counterparty's feature bits from
21300 * the Init message.
21302 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21304 struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21307 * The channel type that this channel will represent. If none is set, we derive the channel
21308 * type from the intersection of our feature bits with our counterparty's feature bits from
21309 * the Init message.
21311 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21313 void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
21316 * Creates a copy of the OpenChannel
21318 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
21321 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
21323 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
21326 * A temporary channel ID, until the funding outpoint is announced
21328 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
21331 * A temporary channel ID, until the funding outpoint is announced
21333 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21336 * The threshold below which outputs on transactions broadcast by sender will be omitted
21338 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21341 * The threshold below which outputs on transactions broadcast by sender will be omitted
21343 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
21346 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
21348 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21351 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
21353 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
21356 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
21358 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21361 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
21363 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
21366 * The minimum HTLC size incoming to sender, in milli-satoshi
21368 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21371 * The minimum HTLC size incoming to sender, in milli-satoshi
21373 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
21376 * Minimum depth of the funding transaction before the channel is considered open
21378 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21381 * Minimum depth of the funding transaction before the channel is considered open
21383 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
21386 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
21388 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21391 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
21393 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
21396 * The maximum number of inbound HTLCs towards sender
21398 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21401 * The maximum number of inbound HTLCs towards sender
21403 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
21406 * The sender's key controlling the funding transaction
21408 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21411 * The sender's key controlling the funding transaction
21413 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21416 * Used to derive a revocation key for transactions broadcast by counterparty
21418 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21421 * Used to derive a revocation key for transactions broadcast by counterparty
21423 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21426 * A payment key to sender for transactions broadcast by counterparty
21428 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21431 * A payment key to sender for transactions broadcast by counterparty
21433 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21436 * Used to derive a payment key to sender for transactions broadcast by sender
21438 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21441 * Used to derive a payment key to sender for transactions broadcast by sender
21443 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21446 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
21448 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21451 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
21453 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21456 * The first to-be-broadcast-by-sender transaction's per commitment point
21458 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21461 * The first to-be-broadcast-by-sender transaction's per commitment point
21463 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21466 * The channel type that this channel will represent. If none is set, we derive the channel
21467 * type from the intersection of our feature bits with our counterparty's feature bits from
21468 * the Init message.
21470 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
21472 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21474 struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21477 * The channel type that this channel will represent. If none is set, we derive the channel
21478 * type from the intersection of our feature bits with our counterparty's feature bits from
21479 * the Init message.
21481 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
21483 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21485 void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
21488 * Creates a copy of the AcceptChannel
21490 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
21493 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
21495 void FundingCreated_free(struct LDKFundingCreated this_obj);
21498 * A temporary channel ID, until the funding is established
21500 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
21503 * A temporary channel ID, until the funding is established
21505 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21508 * The funding transaction ID
21510 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
21513 * The funding transaction ID
21515 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21518 * The specific output index funding this channel
21520 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
21523 * The specific output index funding this channel
21525 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
21528 * The signature of the channel initiator (funder) on the initial commitment transaction
21530 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
21533 * The signature of the channel initiator (funder) on the initial commitment transaction
21535 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
21538 * Constructs a new FundingCreated given each field
21540 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);
21543 * Creates a copy of the FundingCreated
21545 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
21548 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
21550 void FundingSigned_free(struct LDKFundingSigned this_obj);
21555 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
21560 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21563 * The signature of the channel acceptor (fundee) on the initial commitment transaction
21565 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
21568 * The signature of the channel acceptor (fundee) on the initial commitment transaction
21570 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
21573 * Constructs a new FundingSigned given each field
21575 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
21578 * Creates a copy of the FundingSigned
21580 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
21583 * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
21585 void ChannelReady_free(struct LDKChannelReady this_obj);
21590 const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32];
21595 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21598 * The per-commitment point of the second commitment transaction
21600 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
21603 * The per-commitment point of the second commitment transaction
21605 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21608 * If set, provides a short_channel_id alias for this channel. The sender will accept payments
21609 * to be forwarded over this SCID and forward them to this messages' recipient.
21611 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
21614 * If set, provides a short_channel_id alias for this channel. The sender will accept payments
21615 * to be forwarded over this SCID and forward them to this messages' recipient.
21617 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
21620 * Constructs a new ChannelReady given each field
21622 MUST_USE_RES struct LDKChannelReady ChannelReady_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg, struct LDKCOption_u64Z short_channel_id_alias_arg);
21625 * Creates a copy of the ChannelReady
21627 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
21630 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
21632 void Shutdown_free(struct LDKShutdown this_obj);
21637 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
21642 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21645 * The destination of this peer's funds on closing.
21646 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
21648 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
21651 * The destination of this peer's funds on closing.
21652 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
21654 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
21657 * Constructs a new Shutdown given each field
21659 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
21662 * Creates a copy of the Shutdown
21664 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
21667 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
21669 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
21672 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
21675 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
21678 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
21681 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
21684 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
21687 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
21690 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
21693 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
21696 * Constructs a new ClosingSignedFeeRange given each field
21698 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
21701 * Creates a copy of the ClosingSignedFeeRange
21703 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
21706 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
21708 void ClosingSigned_free(struct LDKClosingSigned this_obj);
21713 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
21718 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21721 * The proposed total fee for the closing transaction
21723 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
21726 * The proposed total fee for the closing transaction
21728 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
21731 * A signature on the closing transaction
21733 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
21736 * A signature on the closing transaction
21738 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
21741 * The minimum and maximum fees which the sender is willing to accept, provided only by new
21744 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21746 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
21749 * The minimum and maximum fees which the sender is willing to accept, provided only by new
21752 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21754 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
21757 * Constructs a new ClosingSigned given each field
21759 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg, struct LDKClosingSignedFeeRange fee_range_arg);
21762 * Creates a copy of the ClosingSigned
21764 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
21767 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
21769 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
21774 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
21779 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21784 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
21789 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
21792 * The HTLC value in milli-satoshi
21794 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
21797 * The HTLC value in milli-satoshi
21799 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
21802 * The payment hash, the pre-image of which controls HTLC redemption
21804 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
21807 * The payment hash, the pre-image of which controls HTLC redemption
21809 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21812 * The expiry height of the HTLC
21814 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
21817 * The expiry height of the HTLC
21819 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
21822 * Creates a copy of the UpdateAddHTLC
21824 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
21827 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
21829 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
21834 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
21839 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21844 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
21849 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
21852 * The pre-image of the payment hash, allowing HTLC redemption
21854 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
21857 * The pre-image of the payment hash, allowing HTLC redemption
21859 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21862 * Constructs a new UpdateFulfillHTLC given each field
21864 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
21867 * Creates a copy of the UpdateFulfillHTLC
21869 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
21872 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
21874 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
21879 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
21884 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21889 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
21894 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
21897 * Creates a copy of the UpdateFailHTLC
21899 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
21902 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
21904 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
21909 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
21914 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21919 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
21924 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
21929 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
21934 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
21937 * Creates a copy of the UpdateFailMalformedHTLC
21939 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
21942 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
21944 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
21949 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
21954 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21957 * A signature on the commitment transaction
21959 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
21962 * A signature on the commitment transaction
21964 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
21967 * Signatures on the HTLC transactions
21969 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
21972 * Constructs a new CommitmentSigned given each field
21974 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
21977 * Creates a copy of the CommitmentSigned
21979 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
21982 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
21984 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
21989 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
21994 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21997 * The secret corresponding to the per-commitment point
21999 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
22002 * The secret corresponding to the per-commitment point
22004 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22007 * The next sender-broadcast commitment transaction's per-commitment point
22009 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
22012 * The next sender-broadcast commitment transaction's per-commitment point
22014 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22017 * Constructs a new RevokeAndACK given each field
22019 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);
22022 * Creates a copy of the RevokeAndACK
22024 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
22027 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
22029 void UpdateFee_free(struct LDKUpdateFee this_obj);
22034 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
22039 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22042 * Fee rate per 1000-weight of the transaction
22044 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
22047 * Fee rate per 1000-weight of the transaction
22049 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
22052 * Constructs a new UpdateFee given each field
22054 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
22057 * Creates a copy of the UpdateFee
22059 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
22062 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
22064 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
22067 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
22068 * belonging to the recipient
22070 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
22073 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
22074 * belonging to the recipient
22076 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22079 * The sender's per-commitment point for their current commitment transaction
22081 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
22084 * The sender's per-commitment point for their current commitment transaction
22086 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22089 * Constructs a new DataLossProtect given each field
22091 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
22094 * Creates a copy of the DataLossProtect
22096 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
22099 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
22101 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
22106 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
22111 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22114 * The next commitment number for the sender
22116 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
22119 * The next commitment number for the sender
22121 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
22124 * The next commitment number for the recipient
22126 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
22129 * The next commitment number for the recipient
22131 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
22134 * Creates a copy of the ChannelReestablish
22136 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
22139 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
22141 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
22146 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
22151 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22154 * The short channel ID
22156 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
22159 * The short channel ID
22161 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
22164 * A signature by the node key
22166 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
22169 * A signature by the node key
22171 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
22174 * A signature by the funding key
22176 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
22179 * A signature by the funding key
22181 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
22184 * Constructs a new AnnouncementSignatures given each field
22186 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);
22189 * Creates a copy of the AnnouncementSignatures
22191 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
22194 * Frees any resources used by the NetAddress
22196 void NetAddress_free(struct LDKNetAddress this_ptr);
22199 * Creates a copy of the NetAddress
22201 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
22204 * Utility method to constructs a new IPv4-variant NetAddress
22206 struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port);
22209 * Utility method to constructs a new IPv6-variant NetAddress
22211 struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port);
22214 * Utility method to constructs a new OnionV2-variant NetAddress
22216 struct LDKNetAddress NetAddress_onion_v2(struct LDKTwelveBytes a);
22219 * Utility method to constructs a new OnionV3-variant NetAddress
22221 struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
22224 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
22226 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
22229 * Read a NetAddress from a byte array, created by NetAddress_write
22231 struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
22234 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
22236 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
22239 * The advertised features
22241 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
22244 * The advertised features
22246 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
22249 * A strictly monotonic announcement counter, with gaps allowed
22251 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
22254 * A strictly monotonic announcement counter, with gaps allowed
22256 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
22259 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
22262 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
22265 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
22268 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22271 * An RGB color for UI purposes
22273 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
22276 * An RGB color for UI purposes
22278 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
22281 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
22284 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
22287 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
22290 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22293 * List of addresses on which this node is reachable
22295 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
22298 * Creates a copy of the UnsignedNodeAnnouncement
22300 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
22303 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
22305 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
22308 * The signature by the node key
22310 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
22313 * The signature by the node key
22315 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
22318 * The actual content of the announcement
22320 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
22323 * The actual content of the announcement
22325 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
22328 * Constructs a new NodeAnnouncement given each field
22330 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
22333 * Creates a copy of the NodeAnnouncement
22335 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
22338 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
22340 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
22343 * The advertised channel features
22345 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
22348 * The advertised channel features
22350 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
22353 * The genesis hash of the blockchain where the channel is to be opened
22355 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
22358 * The genesis hash of the blockchain where the channel is to be opened
22360 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22363 * The short channel ID
22365 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
22368 * The short channel ID
22370 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
22373 * One of the two node_ids which are endpoints of this channel
22375 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
22378 * One of the two node_ids which are endpoints of this channel
22380 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22383 * The other of the two node_ids which are endpoints of this channel
22385 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
22388 * The other of the two node_ids which are endpoints of this channel
22390 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22393 * The funding key for the first node
22395 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
22398 * The funding key for the first node
22400 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22403 * The funding key for the second node
22405 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
22408 * The funding key for the second node
22410 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22413 * Creates a copy of the UnsignedChannelAnnouncement
22415 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
22418 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
22420 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
22423 * Authentication of the announcement by the first public node
22425 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
22428 * Authentication of the announcement by the first public node
22430 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
22433 * Authentication of the announcement by the second public node
22435 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
22438 * Authentication of the announcement by the second public node
22440 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
22443 * Proof of funding UTXO ownership by the first public node
22445 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
22448 * Proof of funding UTXO ownership by the first public node
22450 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
22453 * Proof of funding UTXO ownership by the second public node
22455 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
22458 * Proof of funding UTXO ownership by the second public node
22460 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
22463 * The actual announcement
22465 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
22468 * The actual announcement
22470 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
22473 * Constructs a new ChannelAnnouncement given each field
22475 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);
22478 * Creates a copy of the ChannelAnnouncement
22480 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
22483 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
22485 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
22488 * The genesis hash of the blockchain where the channel is to be opened
22490 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
22493 * The genesis hash of the blockchain where the channel is to be opened
22495 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22498 * The short channel ID
22500 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22503 * The short channel ID
22505 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
22508 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
22510 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22513 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
22515 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
22520 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22525 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
22528 * The number of blocks such that if:
22529 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
22530 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
22531 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
22532 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
22533 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
22534 * forwarding. Note that the HTLC sender is the one who originally sets this value when
22535 * constructing the route.
22537 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22540 * The number of blocks such that if:
22541 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
22542 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
22543 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
22544 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
22545 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
22546 * forwarding. Note that the HTLC sender is the one who originally sets this value when
22547 * constructing the route.
22549 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
22552 * The minimum HTLC size incoming to sender, in milli-satoshi
22554 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22557 * The minimum HTLC size incoming to sender, in milli-satoshi
22559 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
22562 * The base HTLC fee charged by sender, in milli-satoshi
22564 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22567 * The base HTLC fee charged by sender, in milli-satoshi
22569 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
22572 * The amount to fee multiplier, in micro-satoshi
22574 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22577 * The amount to fee multiplier, in micro-satoshi
22579 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
22582 * Excess data which was signed as a part of the message which we do not (yet) understand how
22583 * to decode. This is stored to ensure forward-compatibility as new fields are added to the
22586 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
22589 * Creates a copy of the UnsignedChannelUpdate
22591 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
22594 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
22596 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
22599 * A signature of the channel update
22601 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
22604 * A signature of the channel update
22606 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
22609 * The actual channel update
22611 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
22614 * The actual channel update
22616 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
22619 * Constructs a new ChannelUpdate given each field
22621 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
22624 * Creates a copy of the ChannelUpdate
22626 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
22629 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
22631 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
22634 * The genesis hash of the blockchain being queried
22636 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
22639 * The genesis hash of the blockchain being queried
22641 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22644 * The height of the first block for the channel UTXOs being queried
22646 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
22649 * The height of the first block for the channel UTXOs being queried
22651 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
22654 * The number of blocks to include in the query results
22656 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
22659 * The number of blocks to include in the query results
22661 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
22664 * Constructs a new QueryChannelRange given each field
22666 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
22669 * Creates a copy of the QueryChannelRange
22671 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
22674 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
22676 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
22679 * The genesis hash of the blockchain being queried
22681 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
22684 * The genesis hash of the blockchain being queried
22686 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22689 * The height of the first block in the range of the reply
22691 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
22694 * The height of the first block in the range of the reply
22696 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
22699 * The number of blocks included in the range of the reply
22701 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
22704 * The number of blocks included in the range of the reply
22706 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
22709 * True when this is the final reply for a query
22711 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
22714 * True when this is the final reply for a query
22716 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
22719 * The short_channel_ids in the channel range
22721 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
22724 * Constructs a new ReplyChannelRange given each field
22726 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);
22729 * Creates a copy of the ReplyChannelRange
22731 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
22734 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
22736 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
22739 * The genesis hash of the blockchain being queried
22741 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
22744 * The genesis hash of the blockchain being queried
22746 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22749 * The short_channel_ids that are being queried
22751 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
22754 * Constructs a new QueryShortChannelIds given each field
22756 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
22759 * Creates a copy of the QueryShortChannelIds
22761 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
22764 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
22766 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
22769 * The genesis hash of the blockchain that was queried
22771 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
22774 * The genesis hash of the blockchain that was queried
22776 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22779 * Indicates if the query recipient maintains up-to-date channel
22780 * information for the chain_hash
22782 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
22785 * Indicates if the query recipient maintains up-to-date channel
22786 * information for the chain_hash
22788 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
22791 * Constructs a new ReplyShortChannelIdsEnd given each field
22793 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
22796 * Creates a copy of the ReplyShortChannelIdsEnd
22798 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
22801 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
22803 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
22806 * The genesis hash of the blockchain for channel and node information
22808 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
22811 * The genesis hash of the blockchain for channel and node information
22813 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22816 * The starting unix timestamp
22818 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
22821 * The starting unix timestamp
22823 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
22826 * The range of information in seconds
22828 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
22831 * The range of information in seconds
22833 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
22836 * Constructs a new GossipTimestampFilter given each field
22838 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
22841 * Creates a copy of the GossipTimestampFilter
22843 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
22846 * Frees any resources used by the ErrorAction
22848 void ErrorAction_free(struct LDKErrorAction this_ptr);
22851 * Creates a copy of the ErrorAction
22853 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
22856 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
22858 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
22861 * Utility method to constructs a new IgnoreError-variant ErrorAction
22863 struct LDKErrorAction ErrorAction_ignore_error(void);
22866 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
22868 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
22871 * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
22873 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
22876 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
22878 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
22881 * Utility method to constructs a new SendWarningMessage-variant ErrorAction
22883 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
22886 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
22888 void LightningError_free(struct LDKLightningError this_obj);
22891 * A human-readable message describing the error
22893 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
22896 * A human-readable message describing the error
22898 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
22901 * The action which should be taken against the offending peer.
22903 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
22906 * The action which should be taken against the offending peer.
22908 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
22911 * Constructs a new LightningError given each field
22913 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
22916 * Creates a copy of the LightningError
22918 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
22921 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
22923 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
22926 * update_add_htlc messages which should be sent
22928 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
22931 * update_add_htlc messages which should be sent
22933 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
22936 * update_fulfill_htlc messages which should be sent
22938 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
22941 * update_fulfill_htlc messages which should be sent
22943 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
22946 * update_fail_htlc messages which should be sent
22948 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
22951 * update_fail_htlc messages which should be sent
22953 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
22956 * update_fail_malformed_htlc messages which should be sent
22958 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
22961 * update_fail_malformed_htlc messages which should be sent
22963 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
22966 * An update_fee message which should be sent
22968 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22970 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
22973 * An update_fee message which should be sent
22975 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22977 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
22980 * Finally, the commitment_signed message which should be sent
22982 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
22985 * Finally, the commitment_signed message which should be sent
22987 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
22990 * Constructs a new CommitmentUpdate given each field
22992 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);
22995 * Creates a copy of the CommitmentUpdate
22997 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
23000 * Calls the free function if one is set
23002 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
23005 * Calls the free function if one is set
23007 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
23010 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
23012 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
23015 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
23017 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
23020 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
23022 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
23025 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
23027 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
23030 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
23032 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
23035 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
23037 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
23040 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
23042 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
23045 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
23047 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
23050 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
23052 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
23055 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
23057 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
23060 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
23062 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
23065 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
23067 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
23070 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
23072 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
23075 * Read a FundingCreated from a byte array, created by FundingCreated_write
23077 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
23080 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
23082 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
23085 * Read a FundingSigned from a byte array, created by FundingSigned_write
23087 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
23090 * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
23092 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
23095 * Read a ChannelReady from a byte array, created by ChannelReady_write
23097 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
23100 * Serialize the Init object into a byte array which can be read by Init_read
23102 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
23105 * Read a Init from a byte array, created by Init_write
23107 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
23110 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
23112 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
23115 * Read a OpenChannel from a byte array, created by OpenChannel_write
23117 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
23120 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
23122 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
23125 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
23127 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
23130 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
23132 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
23135 * Read a Shutdown from a byte array, created by Shutdown_write
23137 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
23140 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
23142 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
23145 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
23147 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
23150 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
23152 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
23155 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
23157 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
23160 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
23162 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
23165 * Read a UpdateFee from a byte array, created by UpdateFee_write
23167 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
23170 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
23172 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
23175 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
23177 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
23180 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
23182 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
23185 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
23187 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
23190 * Serialize the Ping object into a byte array which can be read by Ping_read
23192 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
23195 * Read a Ping from a byte array, created by Ping_write
23197 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
23200 * Serialize the Pong object into a byte array which can be read by Pong_read
23202 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
23205 * Read a Pong from a byte array, created by Pong_write
23207 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
23210 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
23212 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
23215 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
23217 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
23220 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
23222 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
23225 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
23227 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
23230 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
23232 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
23235 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
23237 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
23240 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
23242 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
23245 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
23247 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
23250 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
23252 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
23255 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
23257 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
23260 * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
23262 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
23265 * Read a WarningMessage from a byte array, created by WarningMessage_write
23267 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
23270 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
23272 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
23275 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
23277 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
23280 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
23282 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
23285 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
23287 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
23290 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
23292 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
23295 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
23297 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
23300 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
23302 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
23305 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
23307 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
23310 *\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
23312 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
23315 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
23317 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
23320 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
23322 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
23325 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
23327 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
23330 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
23332 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
23335 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
23337 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
23340 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
23342 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
23345 * Calls the free function if one is set
23347 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
23350 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
23352 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
23355 * Constructs a new IgnoringMessageHandler given each field
23357 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
23360 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
23361 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
23363 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
23366 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
23367 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
23369 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
23372 * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
23373 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
23375 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
23378 * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
23379 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
23381 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
23384 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
23386 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
23389 * Constructs a new ErroringMessageHandler
23391 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
23394 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
23395 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
23397 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
23400 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
23401 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
23403 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
23406 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
23408 void MessageHandler_free(struct LDKMessageHandler this_obj);
23411 * A message handler which handles messages specific to channels. Usually this is just a
23412 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
23414 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
23416 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
23419 * A message handler which handles messages specific to channels. Usually this is just a
23420 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
23422 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
23424 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
23427 * A message handler which handles messages updating our knowledge of the network channel
23428 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
23430 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
23432 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
23435 * A message handler which handles messages updating our knowledge of the network channel
23436 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
23438 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
23440 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
23443 * Constructs a new MessageHandler given each field
23445 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
23448 * Creates a copy of a SocketDescriptor
23450 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
23453 * Calls the free function if one is set
23455 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
23458 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
23460 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
23463 * Used to indicate that we probably can't make any future connections to this peer (e.g.
23464 * because we required features that our peer was missing, or vice versa).
23466 * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close
23467 * any channels with this peer or check for new versions of LDK.
23469 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
23471 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
23474 * Used to indicate that we probably can't make any future connections to this peer (e.g.
23475 * because we required features that our peer was missing, or vice versa).
23477 * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close
23478 * any channels with this peer or check for new versions of LDK.
23480 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
23482 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
23485 * Constructs a new PeerHandleError given each field
23487 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
23490 * Creates a copy of the PeerHandleError
23492 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
23495 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
23497 void PeerManager_free(struct LDKPeerManager this_obj);
23500 * Constructs a new PeerManager with the given message handlers and node_id secret key
23501 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
23502 * cryptographically secure random bytes.
23504 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, struct LDKCustomMessageHandler custom_message_handler);
23507 * Get the list of node ids for peers which have completed the initial handshake.
23509 * For outbound connections, this will be the same as the their_node_id parameter passed in to
23510 * new_outbound_connection, however entries will only appear once the initial handshake has
23511 * completed and we are sure the remote peer has the private key for the given node_id.
23513 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
23516 * Indicates a new outbound connection has been established to a node with the given node_id
23517 * and an optional remote network address.
23519 * The remote network address adds the option to report a remote IP address back to a connecting
23520 * peer using the init message.
23521 * The user should pass the remote network address of the host they are connected to.
23523 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
23524 * descriptor but must disconnect the connection immediately.
23526 * Returns a small number of bytes to send to the remote node (currently always 50).
23528 * Panics if descriptor is duplicative with some other descriptor which has not yet been
23529 * [`socket_disconnected()`].
23531 * [`socket_disconnected()`]: PeerManager::socket_disconnected
23533 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, struct LDKCOption_NetAddressZ remote_network_address);
23536 * Indicates a new inbound connection has been established to a node with an optional remote
23539 * The remote network address adds the option to report a remote IP address back to a connecting
23540 * peer using the init message.
23541 * The user should pass the remote network address of the host they are connected to.
23543 * May refuse the connection by returning an Err, but will never write bytes to the remote end
23544 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
23545 * call socket_disconnected for the new descriptor but must disconnect the connection
23548 * Panics if descriptor is duplicative with some other descriptor which has not yet been
23549 * [`socket_disconnected()`].
23551 * [`socket_disconnected()`]: PeerManager::socket_disconnected
23553 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor, struct LDKCOption_NetAddressZ remote_network_address);
23556 * Indicates that there is room to write data to the given socket descriptor.
23558 * May return an Err to indicate that the connection should be closed.
23560 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
23561 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
23562 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
23563 * ready to call `[write_buffer_space_avail`] again if a write call generated here isn't
23566 * [`send_data`]: SocketDescriptor::send_data
23567 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
23569 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
23572 * Indicates that data was read from the given socket descriptor.
23574 * May return an Err to indicate that the connection should be closed.
23576 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
23577 * Thus, however, you should call [`process_events`] after any `read_event` to generate
23578 * [`send_data`] calls to handle responses.
23580 * If `Ok(true)` is returned, further read_events should not be triggered until a
23581 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
23584 * [`send_data`]: SocketDescriptor::send_data
23585 * [`process_events`]: PeerManager::process_events
23587 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);
23590 * Checks for any events generated by our handlers and processes them. Includes sending most
23591 * response messages as well as messages generated by calls to handler functions directly (eg
23592 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
23594 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
23597 * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
23598 * or one of the other clients provided in our language bindings.
23600 * Note that if there are any other calls to this function waiting on lock(s) this may return
23601 * without doing any work. All available events that need handling will be handled before the
23602 * other calls return.
23604 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
23605 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
23606 * [`send_data`]: SocketDescriptor::send_data
23608 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
23611 * Indicates that the given socket descriptor's connection is now closed.
23613 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
23616 * Disconnect a peer given its node id.
23618 * Set `no_connection_possible` to true to prevent any further connection with this peer,
23619 * force-closing any channels we have with it.
23621 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
23622 * peer. Thus, be very careful about reentrancy issues.
23624 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
23626 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
23629 * Disconnects all currently-connected peers. This is useful on platforms where there may be
23630 * an indication that TCP sockets have stalled even if we weren't around to time them out
23631 * using regular ping/pongs.
23633 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
23636 * Send pings to each peer and disconnect those which did not respond to the last round of
23639 * This may be called on any timescale you want, however, roughly once every ten seconds is
23640 * preferred. The call rate determines both how often we send a ping to our peers and how much
23641 * time they have to respond before we disconnect them.
23643 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
23646 * [`send_data`]: SocketDescriptor::send_data
23648 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
23651 * Gets the weight for an HTLC-Success transaction.
23653 uint64_t htlc_success_tx_weight(bool opt_anchors);
23656 * Gets the weight for an HTLC-Timeout transaction.
23658 uint64_t htlc_timeout_tx_weight(bool opt_anchors);
23661 * Build the commitment secret from the seed and the commitment number
23663 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
23666 * Build a closing transaction
23668 struct LDKTransaction build_closing_transaction(uint64_t to_holder_value_sat, uint64_t to_counterparty_value_sat, struct LDKCVec_u8Z to_holder_script, struct LDKCVec_u8Z to_counterparty_script, struct LDKOutPoint funding_outpoint);
23671 * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
23673 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
23676 * Creates a copy of the CounterpartyCommitmentSecrets
23678 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
23681 * Creates a new empty `CounterpartyCommitmentSecrets` structure.
23683 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
23686 * Returns the minimum index of all stored secrets. Note that indexes start
23687 * at 1 << 48 and get decremented by one for each new secret.
23689 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
23692 * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
23693 * was generated in accordance with BOLT 3 and is consistent with previous secrets.
23695 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
23698 * Returns the secret at `idx`.
23699 * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
23701 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23703 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
23706 * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
23708 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
23711 * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
23713 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
23716 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
23717 * from the base secret and the per_commitment_point.
23719 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
23720 * generated (ie our own).
23722 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
23725 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
23726 * from the base point and the per_commitment_key. This is the public equivalent of
23727 * derive_private_key - using only public keys to derive a public key instead of private keys.
23729 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
23730 * generated (ie our own).
23732 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
23735 * Derives a per-commitment-transaction revocation key from its constituent parts.
23737 * Only the cheating participant owns a valid witness to propagate a revoked
23738 * commitment transaction, thus per_commitment_secret always come from cheater
23739 * and revocation_base_secret always come from punisher, which is the broadcaster
23740 * of the transaction spending with this key knowledge.
23742 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
23743 * generated (ie our own).
23745 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
23748 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
23749 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
23750 * public key instead of private keys.
23752 * Only the cheating participant owns a valid witness to propagate a revoked
23753 * commitment transaction, thus per_commitment_point always come from cheater
23754 * and revocation_base_point always come from punisher, which is the broadcaster
23755 * of the transaction spending with this key knowledge.
23757 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
23758 * generated (ie our own).
23760 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
23763 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
23765 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
23768 * The broadcaster's per-commitment public key which was used to derive the other keys.
23770 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
23773 * The broadcaster's per-commitment public key which was used to derive the other keys.
23775 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23778 * The revocation key which is used to allow the broadcaster of the commitment
23779 * transaction to provide their counterparty the ability to punish them if they broadcast
23782 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
23785 * The revocation key which is used to allow the broadcaster of the commitment
23786 * transaction to provide their counterparty the ability to punish them if they broadcast
23789 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23792 * Broadcaster's HTLC Key
23794 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
23797 * Broadcaster's HTLC Key
23799 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23802 * Countersignatory's HTLC Key
23804 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
23807 * Countersignatory's HTLC Key
23809 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23812 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
23814 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
23817 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
23819 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23822 * Constructs a new TxCreationKeys given each field
23824 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);
23827 * Creates a copy of the TxCreationKeys
23829 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
23832 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
23834 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
23837 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
23839 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
23842 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
23844 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
23847 * The public key which is used to sign all commitment transactions, as it appears in the
23848 * on-chain channel lock-in 2-of-2 multisig output.
23850 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
23853 * The public key which is used to sign all commitment transactions, as it appears in the
23854 * on-chain channel lock-in 2-of-2 multisig output.
23856 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23859 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
23860 * revocation keys. This is combined with the per-commitment-secret generated by the
23861 * counterparty to create a secret which the counterparty can reveal to revoke previous
23864 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
23867 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
23868 * revocation keys. This is combined with the per-commitment-secret generated by the
23869 * counterparty to create a secret which the counterparty can reveal to revoke previous
23872 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23875 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
23876 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
23877 * static across every commitment transaction.
23879 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
23882 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
23883 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
23884 * static across every commitment transaction.
23886 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23889 * The base point which is used (with derive_public_key) to derive a per-commitment payment
23890 * public key which receives non-HTLC-encumbered funds which are only available for spending
23891 * after some delay (or can be claimed via the revocation path).
23893 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
23896 * The base point which is used (with derive_public_key) to derive a per-commitment payment
23897 * public key which receives non-HTLC-encumbered funds which are only available for spending
23898 * after some delay (or can be claimed via the revocation path).
23900 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23903 * The base point which is used (with derive_public_key) to derive a per-commitment public key
23904 * which is used to encumber HTLC-in-flight outputs.
23906 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
23909 * The base point which is used (with derive_public_key) to derive a per-commitment public key
23910 * which is used to encumber HTLC-in-flight outputs.
23912 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23915 * Constructs a new ChannelPublicKeys given each field
23917 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);
23920 * Creates a copy of the ChannelPublicKeys
23922 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
23925 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
23927 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
23930 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
23932 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
23935 * Create per-state keys from channel base points and the per-commitment point.
23936 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
23938 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);
23941 * Generate per-state keys from channel static keys.
23942 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
23944 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);
23947 * A script either spendable by the revocation
23948 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
23949 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
23951 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
23954 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
23956 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
23959 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
23960 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
23961 * need to compare this value to whether the commitment transaction in question is that of
23962 * the counterparty or our own.
23964 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
23967 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
23968 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
23969 * need to compare this value to whether the commitment transaction in question is that of
23970 * the counterparty or our own.
23972 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
23975 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
23976 * this divided by 1000.
23978 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
23981 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
23982 * this divided by 1000.
23984 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
23987 * The CLTV lock-time at which this HTLC expires.
23989 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
23992 * The CLTV lock-time at which this HTLC expires.
23994 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
23997 * The hash of the preimage which unlocks this HTLC.
23999 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
24002 * The hash of the preimage which unlocks this HTLC.
24004 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24007 * The position within the commitment transactions' outputs. This may be None if the value is
24008 * below the dust limit (in which case no output appears in the commitment transaction and the
24009 * value is spent to additional transaction fees).
24011 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
24014 * The position within the commitment transactions' outputs. This may be None if the value is
24015 * below the dust limit (in which case no output appears in the commitment transaction and the
24016 * value is spent to additional transaction fees).
24018 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
24021 * Constructs a new HTLCOutputInCommitment given each field
24023 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);
24026 * Creates a copy of the HTLCOutputInCommitment
24028 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
24031 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
24033 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
24036 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
24038 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
24041 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
24042 * does not need to have its previous_output_index filled.
24044 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, const struct LDKTxCreationKeys *NONNULL_PTR keys);
24047 * Gets the redeemscript for a funding output from the two funding public keys.
24048 * Note that the order of funding public keys does not matter.
24050 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
24053 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
24054 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
24055 * transaction which needs signing, and can be used to construct an HTLC transaction which is
24056 * broadcastable given a counterparty HTLC signature.
24058 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
24059 * commitment transaction).
24061 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, bool opt_anchors, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
24064 * Gets the witnessScript for an anchor output from the funding public key.
24065 * The witness in the spending input must be:
24066 * <BIP 143 funding_signature>
24067 * After 16 blocks of confirmation, an alternative satisfying witness could be:
24069 * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
24071 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
24074 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
24076 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
24079 * Holder public keys
24081 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24084 * Holder public keys
24086 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
24089 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
24091 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24094 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
24096 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
24099 * Whether the holder is the initiator of this channel.
24100 * This is an input to the commitment number obscure factor computation.
24102 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24105 * Whether the holder is the initiator of this channel.
24106 * This is an input to the commitment number obscure factor computation.
24108 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
24111 * The late-bound counterparty channel transaction parameters.
24112 * These parameters are populated at the point in the protocol where the counterparty provides them.
24114 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24116 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24119 * The late-bound counterparty channel transaction parameters.
24120 * These parameters are populated at the point in the protocol where the counterparty provides them.
24122 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24124 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
24127 * The late-bound funding outpoint
24129 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24131 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24134 * The late-bound funding outpoint
24136 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24138 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
24141 * Are anchors used for this channel. Boolean is serialization backwards-compatible
24143 enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24146 * Are anchors used for this channel. Boolean is serialization backwards-compatible
24148 void ChannelTransactionParameters_set_opt_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
24151 * Constructs a new ChannelTransactionParameters given each field
24153 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, enum LDKCOption_NoneZ opt_anchors_arg);
24156 * Creates a copy of the ChannelTransactionParameters
24158 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
24161 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
24163 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
24166 * Counter-party public keys
24168 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
24171 * Counter-party public keys
24173 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
24176 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
24178 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
24181 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
24183 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
24186 * Constructs a new CounterpartyChannelTransactionParameters given each field
24188 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
24191 * Creates a copy of the CounterpartyChannelTransactionParameters
24193 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
24196 * Whether the late bound parameters are populated.
24198 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
24201 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
24202 * given that the holder is the broadcaster.
24204 * self.is_populated() must be true before calling this function.
24206 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
24209 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
24210 * given that the counterparty is the broadcaster.
24212 * self.is_populated() must be true before calling this function.
24214 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
24217 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
24219 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
24222 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
24224 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
24227 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
24229 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
24232 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
24234 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
24237 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
24239 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
24242 * Get the channel pubkeys for the broadcaster
24244 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24247 * Get the channel pubkeys for the countersignatory
24249 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24252 * Get the contest delay applicable to the transactions.
24253 * Note that the contest delay was selected by the countersignatory.
24255 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24258 * Whether the channel is outbound from the broadcaster.
24260 * The boolean representing the side that initiated the channel is
24261 * an input to the commitment number obscure factor computation.
24263 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24266 * The funding outpoint
24268 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24271 * Whether to use anchors for this channel
24273 MUST_USE_RES bool DirectedChannelTransactionParameters_opt_anchors(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24276 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
24278 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
24281 * Our counterparty's signature for the transaction
24283 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
24286 * Our counterparty's signature for the transaction
24288 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
24291 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
24293 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
24296 * Creates a copy of the HolderCommitmentTransaction
24298 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
24301 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
24303 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
24306 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
24308 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
24311 * Create a new holder transaction with the given counterparty signatures.
24312 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
24314 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);
24317 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
24319 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
24322 * The commitment transaction
24324 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
24327 * The commitment transaction
24329 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
24332 * The txid for the commitment transaction.
24334 * This is provided as a performance optimization, instead of calling transaction.txid()
24337 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
24340 * The txid for the commitment transaction.
24342 * This is provided as a performance optimization, instead of calling transaction.txid()
24345 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24348 * Constructs a new BuiltCommitmentTransaction given each field
24350 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
24353 * Creates a copy of the BuiltCommitmentTransaction
24355 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
24358 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
24360 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
24363 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
24365 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
24368 * Get the SIGHASH_ALL sighash value of the transaction.
24370 * This can be used to verify a signature.
24372 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);
24375 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
24376 * because we are about to broadcast a holder transaction.
24378 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);
24381 * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
24383 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
24386 * Creates a copy of the ClosingTransaction
24388 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
24391 * Checks if two ClosingTransactions contain equal inner contents.
24393 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
24396 * Construct an object of the class
24398 MUST_USE_RES struct LDKClosingTransaction ClosingTransaction_new(uint64_t to_holder_value_sat, uint64_t to_counterparty_value_sat, struct LDKCVec_u8Z to_holder_script, struct LDKCVec_u8Z to_counterparty_script, struct LDKOutPoint funding_outpoint);
24401 * Trust our pre-built transaction.
24403 * Applies a wrapper which allows access to the transaction.
24405 * This should only be used if you fully trust the builder of this object. It should not
24406 * be used by an external signer - instead use the verify function.
24408 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
24411 * Verify our pre-built transaction.
24413 * Applies a wrapper which allows access to the transaction.
24415 * An external validating signer must call this method before signing
24416 * or using the built transaction.
24418 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
24421 * The value to be sent to the holder, or zero if the output will be omitted
24423 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
24426 * The value to be sent to the counterparty, or zero if the output will be omitted
24428 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
24431 * The destination of the holder's output
24433 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
24436 * The destination of the counterparty's output
24438 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
24441 * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
24443 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
24446 * The pre-built Bitcoin commitment transaction
24448 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
24451 * Get the SIGHASH_ALL sighash value of the transaction.
24453 * This can be used to verify a signature.
24455 MUST_USE_RES struct LDKThirtyTwoBytes TrustedClosingTransaction_get_sighash_all(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg, struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
24458 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
24459 * because we are about to broadcast a holder transaction.
24461 MUST_USE_RES struct LDKSignature TrustedClosingTransaction_sign(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
24464 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
24466 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
24469 * Creates a copy of the CommitmentTransaction
24471 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
24474 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
24476 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
24479 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
24481 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
24484 * The backwards-counting commitment number
24486 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
24489 * The value to be sent to the broadcaster
24491 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
24494 * The value to be sent to the counterparty
24496 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
24499 * The feerate paid per 1000-weight-unit in this commitment transaction.
24501 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
24504 * Trust our pre-built transaction and derived transaction creation public keys.
24506 * Applies a wrapper which allows access to these fields.
24508 * This should only be used if you fully trust the builder of this object. It should not
24509 * be used by an external signer - instead use the verify function.
24511 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
24514 * Verify our pre-built transaction and derived transaction creation public keys.
24516 * Applies a wrapper which allows access to these fields.
24518 * An external validating signer must call this method before signing
24519 * or using the built transaction.
24521 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);
24524 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
24526 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
24529 * The transaction ID of the built Bitcoin transaction
24531 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
24534 * The pre-built Bitcoin commitment transaction
24536 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
24539 * The pre-calculated transaction creation public keys.
24541 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
24544 * Should anchors be used.
24546 MUST_USE_RES bool TrustedCommitmentTransaction_opt_anchors(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
24549 * Get a signature for each HTLC which was included in the commitment transaction (ie for
24550 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
24552 * The returned Vec has one entry for each HTLC, and in the same order.
24554 * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
24556 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);
24559 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
24560 * shared secret first. This prevents on-chain observers from discovering how many commitment
24561 * transactions occurred in a channel before it was closed.
24563 * This function gets the shared secret from relevant channel public keys and can be used to
24564 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
24566 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
24569 * Checks if two InitFeaturess contain equal inner contents.
24570 * This ignores pointers and is_owned flags and looks at the values in fields.
24571 * Two objects with NULL inner values will be considered "equal" here.
24573 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
24576 * Checks if two NodeFeaturess contain equal inner contents.
24577 * This ignores pointers and is_owned flags and looks at the values in fields.
24578 * Two objects with NULL inner values will be considered "equal" here.
24580 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
24583 * Checks if two ChannelFeaturess contain equal inner contents.
24584 * This ignores pointers and is_owned flags and looks at the values in fields.
24585 * Two objects with NULL inner values will be considered "equal" here.
24587 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
24590 * Checks if two InvoiceFeaturess contain equal inner contents.
24591 * This ignores pointers and is_owned flags and looks at the values in fields.
24592 * Two objects with NULL inner values will be considered "equal" here.
24594 bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
24597 * Checks if two ChannelTypeFeaturess contain equal inner contents.
24598 * This ignores pointers and is_owned flags and looks at the values in fields.
24599 * Two objects with NULL inner values will be considered "equal" here.
24601 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
24604 * Creates a copy of the InitFeatures
24606 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
24609 * Creates a copy of the NodeFeatures
24611 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
24614 * Creates a copy of the ChannelFeatures
24616 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
24619 * Creates a copy of the InvoiceFeatures
24621 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
24624 * Creates a copy of the ChannelTypeFeatures
24626 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
24629 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
24631 void InitFeatures_free(struct LDKInitFeatures this_obj);
24634 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
24636 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
24639 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
24641 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
24644 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
24646 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
24649 * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
24651 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
24654 * Create a blank Features with no features set
24656 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
24659 * Creates a Features with the bits set which are known by the implementation
24661 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
24664 * Returns true if this `Features` object contains unknown feature flags which are set as
24667 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24670 * Create a blank Features with no features set
24672 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
24675 * Creates a Features with the bits set which are known by the implementation
24677 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
24680 * Returns true if this `Features` object contains unknown feature flags which are set as
24683 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
24686 * Create a blank Features with no features set
24688 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
24691 * Creates a Features with the bits set which are known by the implementation
24693 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
24696 * Returns true if this `Features` object contains unknown feature flags which are set as
24699 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
24702 * Create a blank Features with no features set
24704 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
24707 * Creates a Features with the bits set which are known by the implementation
24709 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
24712 * Returns true if this `Features` object contains unknown feature flags which are set as
24715 MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
24718 * Create a blank Features with no features set
24720 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
24723 * Creates a Features with the bits set which are known by the implementation
24725 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_known(void);
24728 * Returns true if this `Features` object contains unknown feature flags which are set as
24731 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
24734 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
24736 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
24739 * Read a InitFeatures from a byte array, created by InitFeatures_write
24741 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
24744 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
24746 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
24749 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
24751 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
24754 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
24756 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
24759 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
24761 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
24764 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
24766 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
24769 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
24771 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
24774 * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
24776 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
24779 * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
24781 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
24784 * Set this feature as optional.
24786 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
24789 * Set this feature as required.
24791 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
24794 * Checks if this feature is supported.
24796 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24799 * Set this feature as optional.
24801 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
24804 * Set this feature as required.
24806 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
24809 * Checks if this feature is supported.
24811 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
24814 * Checks if this feature is required.
24816 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24819 * Checks if this feature is required.
24821 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
24824 * Set this feature as optional.
24826 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
24829 * Set this feature as required.
24831 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
24834 * Checks if this feature is supported.
24836 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24839 * Set this feature as optional.
24841 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
24844 * Set this feature as required.
24846 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
24849 * Checks if this feature is supported.
24851 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24854 * Set this feature as optional.
24856 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
24859 * Set this feature as required.
24861 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
24864 * Checks if this feature is supported.
24866 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
24869 * Checks if this feature is required.
24871 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24874 * Checks if this feature is required.
24876 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
24879 * Set this feature as optional.
24881 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
24884 * Set this feature as required.
24886 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
24889 * Checks if this feature is supported.
24891 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24894 * Set this feature as optional.
24896 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
24899 * Set this feature as required.
24901 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
24904 * Checks if this feature is supported.
24906 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
24909 * Checks if this feature is required.
24911 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24914 * Checks if this feature is required.
24916 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
24919 * Set this feature as optional.
24921 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
24924 * Set this feature as required.
24926 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
24929 * Checks if this feature is supported.
24931 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24934 * Set this feature as optional.
24936 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
24939 * Set this feature as required.
24941 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
24944 * Checks if this feature is supported.
24946 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
24949 * Set this feature as optional.
24951 void InvoiceFeatures_set_variable_length_onion_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
24954 * Set this feature as required.
24956 void InvoiceFeatures_set_variable_length_onion_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
24959 * Checks if this feature is supported.
24961 MUST_USE_RES bool InvoiceFeatures_supports_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
24964 * Checks if this feature is required.
24966 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24969 * Checks if this feature is required.
24971 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
24974 * Checks if this feature is required.
24976 MUST_USE_RES bool InvoiceFeatures_requires_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
24979 * Set this feature as optional.
24981 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
24984 * Set this feature as required.
24986 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
24989 * Checks if this feature is supported.
24991 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24994 * Set this feature as optional.
24996 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
24999 * Set this feature as required.
25001 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25004 * Checks if this feature is supported.
25006 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25009 * Set this feature as optional.
25011 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25014 * Set this feature as required.
25016 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25019 * Checks if this feature is supported.
25021 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25024 * Checks if this feature is required.
25026 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25029 * Checks if this feature is required.
25031 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25034 * Checks if this feature is required.
25036 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25039 * Set this feature as optional.
25041 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25044 * Set this feature as required.
25046 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25049 * Checks if this feature is supported.
25051 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25054 * Set this feature as optional.
25056 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25059 * Set this feature as required.
25061 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25064 * Checks if this feature is supported.
25066 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25069 * Set this feature as optional.
25071 void InvoiceFeatures_set_payment_secret_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25074 * Set this feature as required.
25076 void InvoiceFeatures_set_payment_secret_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25079 * Checks if this feature is supported.
25081 MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25084 * Checks if this feature is required.
25086 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25089 * Checks if this feature is required.
25091 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25094 * Checks if this feature is required.
25096 MUST_USE_RES bool InvoiceFeatures_requires_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25099 * Set this feature as optional.
25101 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25104 * Set this feature as required.
25106 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25109 * Checks if this feature is supported.
25111 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25114 * Set this feature as optional.
25116 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25119 * Set this feature as required.
25121 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25124 * Checks if this feature is supported.
25126 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25129 * Set this feature as optional.
25131 void InvoiceFeatures_set_basic_mpp_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25134 * Set this feature as required.
25136 void InvoiceFeatures_set_basic_mpp_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25139 * Checks if this feature is supported.
25141 MUST_USE_RES bool InvoiceFeatures_supports_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25144 * Checks if this feature is required.
25146 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25149 * Checks if this feature is required.
25151 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25154 * Checks if this feature is required.
25156 MUST_USE_RES bool InvoiceFeatures_requires_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25159 * Set this feature as optional.
25161 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25164 * Set this feature as required.
25166 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25169 * Checks if this feature is supported.
25171 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25174 * Set this feature as optional.
25176 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25179 * Set this feature as required.
25181 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25184 * Checks if this feature is supported.
25186 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25189 * Checks if this feature is required.
25191 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25194 * Checks if this feature is required.
25196 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25199 * Set this feature as optional.
25201 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25204 * Set this feature as required.
25206 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25209 * Checks if this feature is supported.
25211 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25214 * Set this feature as optional.
25216 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25219 * Set this feature as required.
25221 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25224 * Checks if this feature is supported.
25226 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25229 * Checks if this feature is required.
25231 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25234 * Checks if this feature is required.
25236 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25239 * Set this feature as optional.
25241 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25244 * Set this feature as required.
25246 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25249 * Checks if this feature is supported.
25251 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25254 * Set this feature as optional.
25256 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25259 * Set this feature as required.
25261 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25264 * Checks if this feature is supported.
25266 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25269 * Checks if this feature is required.
25271 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25274 * Checks if this feature is required.
25276 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25279 * Set this feature as optional.
25281 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25284 * Set this feature as required.
25286 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25289 * Checks if this feature is supported.
25291 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25294 * Set this feature as optional.
25296 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25299 * Set this feature as required.
25301 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25304 * Checks if this feature is supported.
25306 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25309 * Set this feature as optional.
25311 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25314 * Set this feature as required.
25316 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25319 * Checks if this feature is supported.
25321 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25324 * Checks if this feature is required.
25326 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25329 * Checks if this feature is required.
25331 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25334 * Checks if this feature is required.
25336 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25339 * Set this feature as optional.
25341 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25344 * Set this feature as required.
25346 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25349 * Checks if this feature is supported.
25351 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25354 * Set this feature as optional.
25356 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25359 * Set this feature as required.
25361 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25364 * Checks if this feature is supported.
25366 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25369 * Set this feature as optional.
25371 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25374 * Set this feature as required.
25376 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25379 * Checks if this feature is supported.
25381 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25384 * Checks if this feature is required.
25386 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25389 * Checks if this feature is required.
25391 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25394 * Checks if this feature is required.
25396 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25399 * Set this feature as optional.
25401 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25404 * Set this feature as required.
25406 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25409 * Checks if this feature is supported.
25411 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25414 * Checks if this feature is required.
25416 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25419 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
25421 void ShutdownScript_free(struct LDKShutdownScript this_obj);
25424 * Creates a copy of the ShutdownScript
25426 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
25429 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
25431 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
25434 * The script that did not meet the requirements from [BOLT #2].
25436 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
25438 struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
25441 * The script that did not meet the requirements from [BOLT #2].
25443 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
25445 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
25448 * Constructs a new InvalidShutdownScript given each field
25450 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
25453 * Creates a copy of the InvalidShutdownScript
25455 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
25458 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
25460 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
25463 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
25465 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
25468 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
25470 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
25473 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
25475 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
25478 * Generates a witness script pubkey from the given segwit version and program.
25480 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
25481 * [`ShutdownScript::new_p2wsh`] instead.
25485 * This function may return an error if `program` is invalid for the segwit `version`.
25487 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessVersion version, struct LDKu8slice program);
25490 * Converts the shutdown script into the underlying [`Script`].
25492 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
25495 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
25497 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25499 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
25502 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
25504 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
25506 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
25509 * Calls the free function if one is set
25511 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
25514 * Calls the free function if one is set
25516 void Type_free(struct LDKType this_ptr);
25519 * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
25521 void NodeId_free(struct LDKNodeId this_obj);
25524 * Creates a copy of the NodeId
25526 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
25529 * Create a new NodeId from a public key
25531 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
25534 * Get the public key slice from this NodeId
25536 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
25539 * Checks if two NodeIds contain equal inner contents.
25541 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
25544 * Serialize the NodeId object into a byte array which can be read by NodeId_read
25546 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
25549 * Read a NodeId from a byte array, created by NodeId_write
25551 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
25554 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
25556 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
25559 * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
25561 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
25564 * Frees any resources used by the NetworkUpdate
25566 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
25569 * Creates a copy of the NetworkUpdate
25571 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
25574 * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
25576 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
25579 * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
25581 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
25584 * Utility method to constructs a new NodeFailure-variant NetworkUpdate
25586 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
25589 * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
25591 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
25594 * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
25596 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
25599 * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
25601 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
25604 * Creates a new tracker of the actual state of the network of channels and nodes,
25605 * assuming an existing Network Graph.
25606 * Chain monitor is used to make sure announced channels exist on-chain,
25607 * channel data is correct, and that the announcement is signed with
25608 * channel owners' keys.
25610 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger);
25613 * Adds a provider used to check new announcements. Does not affect
25614 * existing announcements unless they are updated.
25615 * Add, update or remove the provider would replace the current one.
25617 void P2PGossipSync_add_chain_access(struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_AccessZ chain_access);
25620 * Constructs a new EventHandler which calls the relevant methods on this_arg.
25621 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
25623 struct LDKEventHandler NetworkGraph_as_EventHandler(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
25626 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
25627 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
25629 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
25632 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
25633 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
25635 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
25638 * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
25640 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
25643 * When the last update to the channel direction was issued.
25644 * Value is opaque, as set in the announcement.
25646 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25649 * When the last update to the channel direction was issued.
25650 * Value is opaque, as set in the announcement.
25652 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
25655 * Whether the channel can be currently used for payments (in this one direction).
25657 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25660 * Whether the channel can be currently used for payments (in this one direction).
25662 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
25665 * The difference in CLTV values that you must have when routing through this channel.
25667 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25670 * The difference in CLTV values that you must have when routing through this channel.
25672 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
25675 * The minimum value, which must be relayed to the next hop via the channel
25677 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25680 * The minimum value, which must be relayed to the next hop via the channel
25682 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
25685 * The maximum value which may be relayed to the next hop via the channel.
25687 struct LDKCOption_u64Z ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25690 * The maximum value which may be relayed to the next hop via the channel.
25692 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
25695 * Fees charged when the channel is used for routing
25697 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25700 * Fees charged when the channel is used for routing
25702 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
25705 * Most recent update for the channel received from the network
25706 * Mostly redundant with the data we store in fields explicitly.
25707 * Everything else is useful only for sending out for initial routing sync.
25708 * Not stored if contains excess data to prevent DoS.
25710 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25712 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25715 * Most recent update for the channel received from the network
25716 * Mostly redundant with the data we store in fields explicitly.
25717 * Everything else is useful only for sending out for initial routing sync.
25718 * Not stored if contains excess data to prevent DoS.
25720 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
25722 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
25725 * Constructs a new ChannelUpdateInfo given each field
25727 MUST_USE_RES struct LDKChannelUpdateInfo ChannelUpdateInfo_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);
25730 * Creates a copy of the ChannelUpdateInfo
25732 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
25735 * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
25737 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
25740 * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
25742 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
25745 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
25747 void ChannelInfo_free(struct LDKChannelInfo this_obj);
25750 * Protocol features of a channel communicated during its announcement
25752 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
25755 * Protocol features of a channel communicated during its announcement
25757 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
25760 * Source node of the first direction of a channel
25762 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
25765 * Source node of the first direction of a channel
25767 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
25770 * Details about the first direction of a channel
25772 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25774 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
25777 * Details about the first direction of a channel
25779 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
25781 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
25784 * Source node of the second direction of a channel
25786 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
25789 * Source node of the second direction of a channel
25791 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
25794 * Details about the second direction of a channel
25796 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25798 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
25801 * Details about the second direction of a channel
25803 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
25805 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
25808 * The channel capacity as seen on-chain, if chain lookup is available.
25810 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
25813 * The channel capacity as seen on-chain, if chain lookup is available.
25815 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
25818 * An initial announcement of the channel
25819 * Mostly redundant with the data we store in fields explicitly.
25820 * Everything else is useful only for sending out for initial routing sync.
25821 * Not stored if contains excess data to prevent DoS.
25823 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25825 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
25828 * An initial announcement of the channel
25829 * Mostly redundant with the data we store in fields explicitly.
25830 * Everything else is useful only for sending out for initial routing sync.
25831 * Not stored if contains excess data to prevent DoS.
25833 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
25835 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
25838 * Creates a copy of the ChannelInfo
25840 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
25843 * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
25845 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25847 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
25850 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
25852 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
25855 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
25857 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
25860 * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
25862 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
25865 * Creates a copy of the DirectedChannelInfo
25867 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
25870 * Returns information for the channel.
25872 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
25875 * Returns information for the direction.
25877 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25879 MUST_USE_RES struct LDKChannelUpdateInfo DirectedChannelInfo_direction(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
25882 * Returns the maximum HTLC amount allowed over the channel in the direction.
25884 MUST_USE_RES uint64_t DirectedChannelInfo_htlc_maximum_msat(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
25887 * Returns the [`EffectiveCapacity`] of the channel in the direction.
25889 * This is either the total capacity from the funding transaction, if known, or the
25890 * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
25893 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
25896 * Frees any resources used by the EffectiveCapacity
25898 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
25901 * Creates a copy of the EffectiveCapacity
25903 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
25906 * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
25908 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
25911 * Utility method to constructs a new MaximumHTLC-variant EffectiveCapacity
25913 struct LDKEffectiveCapacity EffectiveCapacity_maximum_htlc(uint64_t amount_msat);
25916 * Utility method to constructs a new Total-variant EffectiveCapacity
25918 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat);
25921 * Utility method to constructs a new Infinite-variant EffectiveCapacity
25923 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
25926 * Utility method to constructs a new Unknown-variant EffectiveCapacity
25928 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
25931 * Returns the effective capacity denominated in millisatoshi.
25933 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
25936 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
25938 void RoutingFees_free(struct LDKRoutingFees this_obj);
25941 * Flat routing fee in satoshis
25943 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
25946 * Flat routing fee in satoshis
25948 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
25951 * Liquidity-based routing fee in millionths of a routed amount.
25952 * In other words, 10000 is 1%.
25954 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
25957 * Liquidity-based routing fee in millionths of a routed amount.
25958 * In other words, 10000 is 1%.
25960 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
25963 * Constructs a new RoutingFees given each field
25965 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
25968 * Checks if two RoutingFeess contain equal inner contents.
25969 * This ignores pointers and is_owned flags and looks at the values in fields.
25970 * Two objects with NULL inner values will be considered "equal" here.
25972 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
25975 * Creates a copy of the RoutingFees
25977 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
25980 * Checks if two RoutingFeess contain equal inner contents.
25982 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
25985 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
25987 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
25990 * Read a RoutingFees from a byte array, created by RoutingFees_write
25992 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
25995 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
25997 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
26000 * Protocol features the node announced support for
26002 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
26005 * Protocol features the node announced support for
26007 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
26010 * When the last known update to the node state was issued.
26011 * Value is opaque, as set in the announcement.
26013 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
26016 * When the last known update to the node state was issued.
26017 * Value is opaque, as set in the announcement.
26019 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
26022 * Color assigned to the node
26024 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
26027 * Color assigned to the node
26029 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
26032 * Moniker assigned to the node.
26033 * May be invalid or malicious (eg control chars),
26034 * should not be exposed to the user.
26036 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
26039 * Moniker assigned to the node.
26040 * May be invalid or malicious (eg control chars),
26041 * should not be exposed to the user.
26043 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26046 * Internet-level addresses via which one can connect to the node
26048 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
26051 * An initial announcement of the node
26052 * Mostly redundant with the data we store in fields explicitly.
26053 * Everything else is useful only for sending out for initial routing sync.
26054 * Not stored if contains excess data to prevent DoS.
26056 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26058 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
26061 * An initial announcement of the node
26062 * Mostly redundant with the data we store in fields explicitly.
26063 * Everything else is useful only for sending out for initial routing sync.
26064 * Not stored if contains excess data to prevent DoS.
26066 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26068 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
26071 * Constructs a new NodeAnnouncementInfo given each field
26073 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);
26076 * Creates a copy of the NodeAnnouncementInfo
26078 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
26081 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
26083 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
26086 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
26088 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
26091 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
26093 void NodeInfo_free(struct LDKNodeInfo this_obj);
26096 * All valid channels a node has announced
26098 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
26101 * Lowest fees enabling routing via any of the enabled, known channels to a node.
26102 * The two fields (flat and proportional fee) are independent,
26103 * meaning they don't have to refer to the same channel.
26105 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26107 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
26110 * Lowest fees enabling routing via any of the enabled, known channels to a node.
26111 * The two fields (flat and proportional fee) are independent,
26112 * meaning they don't have to refer to the same channel.
26114 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26116 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
26119 * More information about a node from node_announcement.
26120 * Optional because we store a Node entry after learning about it from
26121 * a channel announcement, but before receiving a node announcement.
26123 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26125 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
26128 * More information about a node from node_announcement.
26129 * Optional because we store a Node entry after learning about it from
26130 * a channel announcement, but before receiving a node announcement.
26132 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26134 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
26137 * Constructs a new NodeInfo given each field
26139 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
26142 * Creates a copy of the NodeInfo
26144 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
26147 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
26149 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
26152 * Read a NodeInfo from a byte array, created by NodeInfo_write
26154 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
26157 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
26159 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
26162 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
26164 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
26167 * Creates a new, empty, network graph.
26169 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKLogger logger);
26172 * Returns a read-only view of the network graph.
26174 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
26177 * The unix timestamp provided by the most recent rapid gossip sync.
26178 * It will be set by the rapid sync process after every sync completion.
26180 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
26183 * Update the unix timestamp provided by the most recent rapid gossip sync.
26184 * This should be done automatically by the rapid sync process after every sync completion.
26186 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
26189 * For an already known node (from channel announcements), update its stored properties from a
26190 * given node announcement.
26192 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
26193 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
26194 * routing messages from a source using a protocol other than the lightning P2P protocol.
26196 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
26199 * For an already known node (from channel announcements), update its stored properties from a
26200 * given node announcement without verifying the associated signatures. Because we aren't
26201 * given the associated signatures here we cannot relay the node announcement to any of our
26204 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
26207 * Store or update channel info from a channel announcement.
26209 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
26210 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
26211 * routing messages from a source using a protocol other than the lightning P2P protocol.
26213 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
26214 * the corresponding UTXO exists on chain and is correctly-formatted.
26216 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_AccessZ chain_access);
26219 * Store or update channel info from a channel announcement without verifying the associated
26220 * signatures. Because we aren't given the associated signatures here we cannot relay the
26221 * channel announcement to any of our peers.
26223 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
26224 * the corresponding UTXO exists on chain and is correctly-formatted.
26226 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_unsigned_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_AccessZ chain_access);
26229 * Update channel from partial announcement data received via rapid gossip sync
26231 * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
26232 * rapid gossip sync server)
26234 * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
26236 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_add_channel_from_partial_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, uint64_t timestamp, struct LDKChannelFeatures features, struct LDKPublicKey node_id_1, struct LDKPublicKey node_id_2);
26239 * Marks a channel in the graph as failed if a corresponding HTLC fail was sent.
26240 * If permanent, removes a channel from the local storage.
26241 * May cause the removal of nodes too, if this was their last channel.
26242 * If not permanent, makes channels unavailable for routing.
26244 void NetworkGraph_channel_failed(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
26247 * Marks a node in the graph as failed.
26249 void NetworkGraph_node_failed(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey _node_id, bool is_permanent);
26252 * Removes information about channels that we haven't heard any updates about in some time.
26253 * This can be used regularly to prune the network graph of channels that likely no longer
26256 * While there is no formal requirement that nodes regularly re-broadcast their channel
26257 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
26258 * pruning occur for updates which are at least two weeks old, which we implement here.
26260 * Note that for users of the `lightning-background-processor` crate this method may be
26261 * automatically called regularly for you.
26263 * This method is only available with the `std` feature. See
26264 * [`NetworkGraph::remove_stale_channels_with_time`] for `no-std` use.
26266 void NetworkGraph_remove_stale_channels(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
26269 * Removes information about channels that we haven't heard any updates about in some time.
26270 * This can be used regularly to prune the network graph of channels that likely no longer
26273 * While there is no formal requirement that nodes regularly re-broadcast their channel
26274 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
26275 * pruning occur for updates which are at least two weeks old, which we implement here.
26277 * This function takes the current unix time as an argument. For users with the `std` feature
26278 * enabled, [`NetworkGraph::remove_stale_channels`] may be preferable.
26280 void NetworkGraph_remove_stale_channels_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
26283 * For an already known (from announcement) channel, update info about one of the directions
26286 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
26287 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
26288 * routing messages from a source using a protocol other than the lightning P2P protocol.
26290 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
26291 * materially in the future will be rejected.
26293 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
26296 * For an already known (from announcement) channel, update info about one of the directions
26297 * of the channel without verifying the associated signatures. Because we aren't given the
26298 * associated signatures here we cannot relay the channel update to any of our peers.
26300 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
26301 * materially in the future will be rejected.
26303 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
26306 * Get network addresses by node id.
26307 * Returns None if the requested node is completely unknown,
26308 * or if node announcement for the node was never received.
26310 MUST_USE_RES struct LDKCOption_CVec_NetAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
26313 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
26315 void RouteHop_free(struct LDKRouteHop this_obj);
26318 * The node_id of the node at this hop.
26320 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
26323 * The node_id of the node at this hop.
26325 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26328 * The node_announcement features of the node at this hop. For the last hop, these may be
26329 * amended to match the features present in the invoice this node generated.
26331 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
26334 * The node_announcement features of the node at this hop. For the last hop, these may be
26335 * amended to match the features present in the invoice this node generated.
26337 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
26340 * The channel that should be used from the previous hop to reach this node.
26342 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
26345 * The channel that should be used from the previous hop to reach this node.
26347 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
26350 * The channel_announcement features of the channel that should be used from the previous hop
26351 * to reach this node.
26353 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
26356 * The channel_announcement features of the channel that should be used from the previous hop
26357 * to reach this node.
26359 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
26362 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
26363 * For the last hop, this should be the full value of the payment (might be more than
26364 * requested if we had to match htlc_minimum_msat).
26366 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
26369 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
26370 * For the last hop, this should be the full value of the payment (might be more than
26371 * requested if we had to match htlc_minimum_msat).
26373 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
26376 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
26377 * expected at the destination, in excess of the current block height.
26379 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
26382 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
26383 * expected at the destination, in excess of the current block height.
26385 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
26388 * Constructs a new RouteHop given each field
26390 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);
26393 * Creates a copy of the RouteHop
26395 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
26398 * Checks if two RouteHops contain equal inner contents.
26400 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
26403 * Checks if two RouteHops contain equal inner contents.
26404 * This ignores pointers and is_owned flags and looks at the values in fields.
26405 * Two objects with NULL inner values will be considered "equal" here.
26407 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
26410 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
26412 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
26415 * Read a RouteHop from a byte array, created by RouteHop_write
26417 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
26420 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
26422 void Route_free(struct LDKRoute this_obj);
26425 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
26426 * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT
26427 * INCLUDING our own, where the last hop is the destination. Thus, this must always be at
26428 * least length one. While the maximum length of any given path is variable, keeping the length
26429 * of any path less or equal to 19 should currently ensure it is viable.
26431 struct LDKCVec_CVec_RouteHopZZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
26434 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
26435 * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT
26436 * INCLUDING our own, where the last hop is the destination. Thus, this must always be at
26437 * least length one. While the maximum length of any given path is variable, keeping the length
26438 * of any path less or equal to 19 should currently ensure it is viable.
26440 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
26443 * The `payment_params` parameter passed to [`find_route`].
26444 * This is used by `ChannelManager` to track information which may be required for retries,
26445 * provided back to you via [`Event::PaymentPathFailed`].
26447 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
26449 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26451 struct LDKPaymentParameters Route_get_payment_params(const struct LDKRoute *NONNULL_PTR this_ptr);
26454 * The `payment_params` parameter passed to [`find_route`].
26455 * This is used by `ChannelManager` to track information which may be required for retries,
26456 * provided back to you via [`Event::PaymentPathFailed`].
26458 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
26460 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26462 void Route_set_payment_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
26465 * Constructs a new Route given each field
26467 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg, struct LDKPaymentParameters payment_params_arg);
26470 * Creates a copy of the Route
26472 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
26475 * Checks if two Routes contain equal inner contents.
26477 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
26480 * Checks if two Routes contain equal inner contents.
26481 * This ignores pointers and is_owned flags and looks at the values in fields.
26482 * Two objects with NULL inner values will be considered "equal" here.
26484 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
26487 * Returns the total amount of fees paid on this [`Route`].
26489 * This doesn't include any extra payment made to the recipient, which can happen in excess of
26490 * the amount passed to [`find_route`]'s `params.final_value_msat`.
26492 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
26495 * Returns the total amount paid on this [`Route`], excluding the fees.
26497 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
26500 * Serialize the Route object into a byte array which can be read by Route_read
26502 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
26505 * Read a Route from a byte array, created by Route_write
26507 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
26510 * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
26512 void RouteParameters_free(struct LDKRouteParameters this_obj);
26515 * The parameters of the failed payment path.
26517 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
26520 * The parameters of the failed payment path.
26522 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
26525 * The amount in msats sent on the failed payment path.
26527 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
26530 * The amount in msats sent on the failed payment path.
26532 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
26535 * The CLTV on the final hop of the failed payment path.
26537 uint32_t RouteParameters_get_final_cltv_expiry_delta(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
26540 * The CLTV on the final hop of the failed payment path.
26542 void RouteParameters_set_final_cltv_expiry_delta(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint32_t val);
26545 * Constructs a new RouteParameters given each field
26547 MUST_USE_RES struct LDKRouteParameters RouteParameters_new(struct LDKPaymentParameters payment_params_arg, uint64_t final_value_msat_arg, uint32_t final_cltv_expiry_delta_arg);
26550 * Creates a copy of the RouteParameters
26552 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
26555 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
26557 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
26560 * Read a RouteParameters from a byte array, created by RouteParameters_write
26562 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
26565 * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
26567 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
26570 * The node id of the payee.
26572 struct LDKPublicKey PaymentParameters_get_payee_pubkey(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
26575 * The node id of the payee.
26577 void PaymentParameters_set_payee_pubkey(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26580 * Features supported by the payee.
26582 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
26583 * does not contain any features.
26585 * [`for_keysend`]: Self::for_keysend
26587 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26589 struct LDKInvoiceFeatures PaymentParameters_get_features(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
26592 * Features supported by the payee.
26594 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
26595 * does not contain any features.
26597 * [`for_keysend`]: Self::for_keysend
26599 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26601 void PaymentParameters_set_features(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKInvoiceFeatures val);
26604 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
26606 struct LDKCVec_RouteHintZ PaymentParameters_get_route_hints(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
26609 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
26611 void PaymentParameters_set_route_hints(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintZ val);
26614 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
26616 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
26619 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
26621 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
26624 * The maximum total CLTV delta we accept for the route.
26626 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
26629 * The maximum total CLTV delta we accept for the route.
26631 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
26634 * Constructs a new PaymentParameters given each field
26636 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_new(struct LDKPublicKey payee_pubkey_arg, struct LDKInvoiceFeatures features_arg, struct LDKCVec_RouteHintZ route_hints_arg, struct LDKCOption_u64Z expiry_time_arg, uint32_t max_total_cltv_expiry_delta_arg);
26639 * Creates a copy of the PaymentParameters
26641 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
26644 * Checks if two PaymentParameterss contain equal inner contents.
26646 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
26649 * Checks if two PaymentParameterss contain equal inner contents.
26650 * This ignores pointers and is_owned flags and looks at the values in fields.
26651 * Two objects with NULL inner values will be considered "equal" here.
26653 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
26656 * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
26658 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
26661 * Read a PaymentParameters from a byte array, created by PaymentParameters_write
26663 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser);
26666 * Creates a payee with the node id of the given `pubkey`.
26668 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey);
26671 * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
26673 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey);
26676 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
26678 void RouteHint_free(struct LDKRouteHint this_obj);
26680 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
26682 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
26685 * Constructs a new RouteHint given each field
26687 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
26690 * Creates a copy of the RouteHint
26692 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
26695 * Checks if two RouteHints contain equal inner contents.
26697 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
26700 * Checks if two RouteHints contain equal inner contents.
26701 * This ignores pointers and is_owned flags and looks at the values in fields.
26702 * Two objects with NULL inner values will be considered "equal" here.
26704 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
26707 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
26709 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
26712 * Read a RouteHint from a byte array, created by RouteHint_write
26714 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
26717 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
26719 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
26722 * The node_id of the non-target end of the route
26724 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
26727 * The node_id of the non-target end of the route
26729 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26732 * The short_channel_id of this channel
26734 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
26737 * The short_channel_id of this channel
26739 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
26742 * The fees which must be paid to use this channel
26744 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
26747 * The fees which must be paid to use this channel
26749 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
26752 * The difference in CLTV values between this node and the next node.
26754 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
26757 * The difference in CLTV values between this node and the next node.
26759 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
26762 * The minimum value, in msat, which must be relayed to the next hop.
26764 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
26767 * The minimum value, in msat, which must be relayed to the next hop.
26769 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
26772 * The maximum value in msat available for routing with a single HTLC.
26774 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
26777 * The maximum value in msat available for routing with a single HTLC.
26779 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
26782 * Constructs a new RouteHintHop given each field
26784 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);
26787 * Creates a copy of the RouteHintHop
26789 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
26792 * Checks if two RouteHintHops contain equal inner contents.
26794 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
26797 * Checks if two RouteHintHops contain equal inner contents.
26798 * This ignores pointers and is_owned flags and looks at the values in fields.
26799 * Two objects with NULL inner values will be considered "equal" here.
26801 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
26804 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
26806 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
26809 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
26811 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
26814 * Finds a route from us (payer) to the given target node (payee).
26816 * If the payee provided features in their invoice, they should be provided via `params.payee`.
26817 * Without this, MPP will only be used if the payee's features are available in the network graph.
26819 * Private routing paths between a public node and the target may be included in `params.payee`.
26821 * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
26822 * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
26823 * from `network_graph` will be ignored, and only those in `first_hops` will be used.
26825 * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
26826 * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
26827 * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
26831 * May be used to re-compute a [`Route`] when handling a [`Event::PaymentPathFailed`]. Any
26832 * adjustments to the [`NetworkGraph`] and channel scores should be made prior to calling this
26837 * Panics if first_hops contains channels without short_channel_ids;
26838 * [`ChannelManager::list_usable_channels`] will never include such channels.
26840 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
26841 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
26842 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
26844 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
26846 struct LDKCResult_RouteLightningErrorZ find_route(struct LDKPublicKey our_node_pubkey, const struct LDKRouteParameters *NONNULL_PTR route_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKLogger logger, const struct LDKScore *NONNULL_PTR scorer, const uint8_t (*random_seed_bytes)[32]);
26849 * Construct a route from us (payer) to the target node (payee) via the given hops (which should
26850 * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
26852 * Re-uses logic from `find_route`, so the restrictions described there also apply here.
26854 struct LDKCResult_RouteLightningErrorZ build_route_from_hops(struct LDKPublicKey our_node_pubkey, struct LDKCVec_PublicKeyZ hops, const struct LDKRouteParameters *NONNULL_PTR route_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, const uint8_t (*random_seed_bytes)[32]);
26857 * Calls the free function if one is set
26859 void Score_free(struct LDKScore this_ptr);
26862 * Calls the free function if one is set
26864 void LockableScore_free(struct LDKLockableScore this_ptr);
26867 * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
26869 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
26872 * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
26874 struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
26877 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
26879 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
26882 * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
26884 void ChannelUsage_free(struct LDKChannelUsage this_obj);
26887 * The amount to send through the channel, denominated in millisatoshis.
26889 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
26892 * The amount to send through the channel, denominated in millisatoshis.
26894 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
26897 * Total amount, denominated in millisatoshis, already allocated to send through the channel
26898 * as part of a multi-path payment.
26900 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
26903 * Total amount, denominated in millisatoshis, already allocated to send through the channel
26904 * as part of a multi-path payment.
26906 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
26909 * The effective capacity of the channel.
26911 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
26914 * The effective capacity of the channel.
26916 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
26919 * Constructs a new ChannelUsage given each field
26921 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
26924 * Creates a copy of the ChannelUsage
26926 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
26929 * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
26931 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
26934 * Creates a copy of the FixedPenaltyScorer
26936 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
26939 * Creates a new scorer using `penalty_msat`.
26941 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
26944 * Constructs a new Score which calls the relevant methods on this_arg.
26945 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
26947 struct LDKScore FixedPenaltyScorer_as_Score(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
26950 * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
26952 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
26955 * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
26957 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
26960 * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
26962 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
26965 * Frees any resources used by the ProbabilisticScoringParameters, if is_owned is set and inner is non-NULL.
26967 void ProbabilisticScoringParameters_free(struct LDKProbabilisticScoringParameters this_obj);
26970 * A fixed penalty in msats to apply to each channel.
26972 * Default value: 500 msat
26974 uint64_t ProbabilisticScoringParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
26977 * A fixed penalty in msats to apply to each channel.
26979 * Default value: 500 msat
26981 void ProbabilisticScoringParameters_set_base_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
26984 * A multiplier used in conjunction with the negative `log10` of the channel's success
26985 * probability for a payment to determine the liquidity penalty.
26987 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
26988 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
26989 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
26990 * lower bounding the success probability to `0.01`) when the amount falls within the
26991 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
26992 * result in a `u64::max_value` penalty, however.
26994 * Default value: 40,000 msat
26996 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
26998 uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27001 * A multiplier used in conjunction with the negative `log10` of the channel's success
27002 * probability for a payment to determine the liquidity penalty.
27004 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
27005 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
27006 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
27007 * lower bounding the success probability to `0.01`) when the amount falls within the
27008 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
27009 * result in a `u64::max_value` penalty, however.
27011 * Default value: 40,000 msat
27013 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
27015 void ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27018 * The time required to elapse before any knowledge learned about channel liquidity balances is
27021 * The bounds are defined in terms of offsets and are initially zero. Increasing the offsets
27022 * gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases
27023 * the certainty of the channel liquidity balance.
27025 * Default value: 1 hour
27029 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
27030 * liquidity knowledge will never decay except when the bounds cross.
27032 uint64_t ProbabilisticScoringParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27035 * The time required to elapse before any knowledge learned about channel liquidity balances is
27038 * The bounds are defined in terms of offsets and are initially zero. Increasing the offsets
27039 * gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases
27040 * the certainty of the channel liquidity balance.
27042 * Default value: 1 hour
27046 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
27047 * liquidity knowledge will never decay except when the bounds cross.
27049 void ProbabilisticScoringParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27052 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
27053 * channel's success probability for the payment to determine the amount penalty.
27055 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
27056 * fees plus penalty) for large payments. The penalty is computed as the product of this
27057 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
27058 * success probability.
27060 * `-log10(success_probability) * amount_penalty_multiplier_msat * amount_msat / 2^20`
27062 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
27063 * the amount will result in a penalty of the multiplier. And, as the success probability
27064 * decreases, the negative `log10` weighting will increase dramatically. For higher success
27065 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
27068 * Default value: 256 msat
27070 uint64_t ProbabilisticScoringParameters_get_amount_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27073 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
27074 * channel's success probability for the payment to determine the amount penalty.
27076 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
27077 * fees plus penalty) for large payments. The penalty is computed as the product of this
27078 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
27079 * success probability.
27081 * `-log10(success_probability) * amount_penalty_multiplier_msat * amount_msat / 2^20`
27083 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
27084 * the amount will result in a penalty of the multiplier. And, as the success probability
27085 * decreases, the negative `log10` weighting will increase dramatically. For higher success
27086 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
27089 * Default value: 256 msat
27091 void ProbabilisticScoringParameters_set_amount_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27094 * Constructs a new ProbabilisticScoringParameters given each field
27096 MUST_USE_RES struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_new(uint64_t base_penalty_msat_arg, uint64_t liquidity_penalty_multiplier_msat_arg, uint64_t liquidity_offset_half_life_arg, uint64_t amount_penalty_multiplier_msat_arg);
27099 * Creates a copy of the ProbabilisticScoringParameters
27101 struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_clone(const struct LDKProbabilisticScoringParameters *NONNULL_PTR orig);
27104 * Creates a new scorer using the given scoring parameters for sending payments from a node
27105 * through a network graph.
27107 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringParameters params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
27110 * Dump the contents of this scorer into the configured logger.
27112 * Note that this writes roughly one line per channel for which we have a liquidity estimate,
27113 * which may be a substantial amount of log output.
27115 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
27118 * Creates a "default" ProbabilisticScoringParameters. See struct and individual field documentaiton for details on which values are used.
27120 MUST_USE_RES struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_default(void);
27123 * Constructs a new Score which calls the relevant methods on this_arg.
27124 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
27126 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
27129 * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
27131 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
27134 * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
27136 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
27139 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
27141 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
27144 * Initialize a new FilesystemPersister and set the path to the individual channels'
27147 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
27150 * Get the directory which was provided when this persister was initialized.
27152 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
27155 * Read `ChannelMonitor`s from disk.
27157 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
27160 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
27162 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
27165 * Frees any resources used by the GossipSync
27167 void GossipSync_free(struct LDKGossipSync this_ptr);
27170 * Utility method to constructs a new P2P-variant GossipSync
27172 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
27175 * Utility method to constructs a new Rapid-variant GossipSync
27177 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
27180 * Utility method to constructs a new None-variant GossipSync
27182 struct LDKGossipSync GossipSync_none(void);
27185 * Start a background thread that takes care of responsibilities enumerated in the [top-level
27188 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
27189 * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
27190 * either [`join`] or [`stop`].
27192 * # Data Persistence
27194 * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
27195 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
27196 * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
27197 * provided implementation.
27199 * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
27200 * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
27201 * See the `lightning-persister` crate for LDK's provided implementation.
27203 * Typically, users should either implement [`Persister::persist_manager`] to never return an
27204 * error or call [`join`] and handle any error that may arise. For the latter case,
27205 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
27209 * `event_handler` is responsible for handling events that users should be notified of (e.g.,
27210 * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
27211 * functionality implemented by other handlers.
27212 * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
27214 * # Rapid Gossip Sync
27216 * If rapid gossip sync is meant to run at startup, pass a [`RapidGossipSync`] to `gossip_sync`
27217 * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
27218 * until the [`RapidGossipSync`] instance completes its first sync.
27220 * [top-level documentation]: BackgroundProcessor
27221 * [`join`]: Self::join
27222 * [`stop`]: Self::stop
27223 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
27224 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
27225 * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
27226 * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
27227 * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
27228 * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
27230 * Note that scorer (or a relevant inner pointer) may be NULL or all-0s to represent None
27232 MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, struct LDKGossipSync gossip_sync, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger, struct LDKMultiThreadedLockableScore scorer);
27235 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
27236 * [`ChannelManager`].
27240 * This function panics if the background thread has panicked such as while persisting or
27243 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
27245 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
27248 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
27249 * [`ChannelManager`].
27253 * This function panics if the background thread has panicked such as while persisting or
27256 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
27258 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
27261 * Frees any resources used by the ParseError
27263 void ParseError_free(struct LDKParseError this_ptr);
27266 * Creates a copy of the ParseError
27268 struct LDKParseError ParseError_clone(const struct LDKParseError *NONNULL_PTR orig);
27271 * Utility method to constructs a new Bech32Error-variant ParseError
27273 struct LDKParseError ParseError_bech32_error(struct LDKBech32Error a);
27276 * Utility method to constructs a new ParseAmountError-variant ParseError
27278 struct LDKParseError ParseError_parse_amount_error(struct LDKError a);
27281 * Utility method to constructs a new MalformedSignature-variant ParseError
27283 struct LDKParseError ParseError_malformed_signature(enum LDKSecp256k1Error a);
27286 * Utility method to constructs a new BadPrefix-variant ParseError
27288 struct LDKParseError ParseError_bad_prefix(void);
27291 * Utility method to constructs a new UnknownCurrency-variant ParseError
27293 struct LDKParseError ParseError_unknown_currency(void);
27296 * Utility method to constructs a new UnknownSiPrefix-variant ParseError
27298 struct LDKParseError ParseError_unknown_si_prefix(void);
27301 * Utility method to constructs a new MalformedHRP-variant ParseError
27303 struct LDKParseError ParseError_malformed_hrp(void);
27306 * Utility method to constructs a new TooShortDataPart-variant ParseError
27308 struct LDKParseError ParseError_too_short_data_part(void);
27311 * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant ParseError
27313 struct LDKParseError ParseError_unexpected_end_of_tagged_fields(void);
27316 * Utility method to constructs a new DescriptionDecodeError-variant ParseError
27318 struct LDKParseError ParseError_description_decode_error(struct LDKError a);
27321 * Utility method to constructs a new PaddingError-variant ParseError
27323 struct LDKParseError ParseError_padding_error(void);
27326 * Utility method to constructs a new IntegerOverflowError-variant ParseError
27328 struct LDKParseError ParseError_integer_overflow_error(void);
27331 * Utility method to constructs a new InvalidSegWitProgramLength-variant ParseError
27333 struct LDKParseError ParseError_invalid_seg_wit_program_length(void);
27336 * Utility method to constructs a new InvalidPubKeyHashLength-variant ParseError
27338 struct LDKParseError ParseError_invalid_pub_key_hash_length(void);
27341 * Utility method to constructs a new InvalidScriptHashLength-variant ParseError
27343 struct LDKParseError ParseError_invalid_script_hash_length(void);
27346 * Utility method to constructs a new InvalidRecoveryId-variant ParseError
27348 struct LDKParseError ParseError_invalid_recovery_id(void);
27351 * Utility method to constructs a new InvalidSliceLength-variant ParseError
27353 struct LDKParseError ParseError_invalid_slice_length(struct LDKStr a);
27356 * Utility method to constructs a new Skip-variant ParseError
27358 struct LDKParseError ParseError_skip(void);
27361 * Frees any resources used by the ParseOrSemanticError
27363 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
27366 * Creates a copy of the ParseOrSemanticError
27368 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
27371 * Utility method to constructs a new ParseError-variant ParseOrSemanticError
27373 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKParseError a);
27376 * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
27378 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKSemanticError a);
27381 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
27383 void Invoice_free(struct LDKInvoice this_obj);
27386 * Checks if two Invoices contain equal inner contents.
27387 * This ignores pointers and is_owned flags and looks at the values in fields.
27388 * Two objects with NULL inner values will be considered "equal" here.
27390 bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
27393 * Creates a copy of the Invoice
27395 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
27398 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
27400 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
27403 * Checks if two SignedRawInvoices contain equal inner contents.
27404 * This ignores pointers and is_owned flags and looks at the values in fields.
27405 * Two objects with NULL inner values will be considered "equal" here.
27407 bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
27410 * Creates a copy of the SignedRawInvoice
27412 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
27415 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
27417 void RawInvoice_free(struct LDKRawInvoice this_obj);
27422 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
27427 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
27430 * Checks if two RawInvoices contain equal inner contents.
27431 * This ignores pointers and is_owned flags and looks at the values in fields.
27432 * Two objects with NULL inner values will be considered "equal" here.
27434 bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
27437 * Creates a copy of the RawInvoice
27439 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
27442 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
27444 void RawDataPart_free(struct LDKRawDataPart this_obj);
27447 * generation time of the invoice
27449 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
27452 * generation time of the invoice
27454 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
27457 * Checks if two RawDataParts contain equal inner contents.
27458 * This ignores pointers and is_owned flags and looks at the values in fields.
27459 * Two objects with NULL inner values will be considered "equal" here.
27461 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
27464 * Creates a copy of the RawDataPart
27466 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
27469 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
27471 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
27474 * Checks if two PositiveTimestamps contain equal inner contents.
27475 * This ignores pointers and is_owned flags and looks at the values in fields.
27476 * Two objects with NULL inner values will be considered "equal" here.
27478 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
27481 * Creates a copy of the PositiveTimestamp
27483 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
27486 * Creates a copy of the SiPrefix
27488 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
27491 * Utility method to constructs a new Milli-variant SiPrefix
27493 enum LDKSiPrefix SiPrefix_milli(void);
27496 * Utility method to constructs a new Micro-variant SiPrefix
27498 enum LDKSiPrefix SiPrefix_micro(void);
27501 * Utility method to constructs a new Nano-variant SiPrefix
27503 enum LDKSiPrefix SiPrefix_nano(void);
27506 * Utility method to constructs a new Pico-variant SiPrefix
27508 enum LDKSiPrefix SiPrefix_pico(void);
27511 * Checks if two SiPrefixs contain equal inner contents.
27512 * This ignores pointers and is_owned flags and looks at the values in fields.
27514 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
27517 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
27518 * This is effectively 10^12 * the prefix multiplier
27520 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
27523 * Creates a copy of the Currency
27525 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
27528 * Utility method to constructs a new Bitcoin-variant Currency
27530 enum LDKCurrency Currency_bitcoin(void);
27533 * Utility method to constructs a new BitcoinTestnet-variant Currency
27535 enum LDKCurrency Currency_bitcoin_testnet(void);
27538 * Utility method to constructs a new Regtest-variant Currency
27540 enum LDKCurrency Currency_regtest(void);
27543 * Utility method to constructs a new Simnet-variant Currency
27545 enum LDKCurrency Currency_simnet(void);
27548 * Utility method to constructs a new Signet-variant Currency
27550 enum LDKCurrency Currency_signet(void);
27553 * Checks if two Currencys contain equal inner contents.
27555 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
27558 * Checks if two Currencys contain equal inner contents.
27559 * This ignores pointers and is_owned flags and looks at the values in fields.
27561 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
27564 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
27566 void Sha256_free(struct LDKSha256 this_obj);
27569 * Creates a copy of the Sha256
27571 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
27574 * Checks if two Sha256s contain equal inner contents.
27576 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
27579 * Checks if two Sha256s contain equal inner contents.
27580 * This ignores pointers and is_owned flags and looks at the values in fields.
27581 * Two objects with NULL inner values will be considered "equal" here.
27583 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
27586 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
27588 void Description_free(struct LDKDescription this_obj);
27591 * Creates a copy of the Description
27593 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
27596 * Checks if two Descriptions contain equal inner contents.
27598 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
27601 * Checks if two Descriptions contain equal inner contents.
27602 * This ignores pointers and is_owned flags and looks at the values in fields.
27603 * Two objects with NULL inner values will be considered "equal" here.
27605 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
27608 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
27610 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
27612 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
27614 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27617 * Constructs a new PayeePubKey given each field
27619 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
27622 * Creates a copy of the PayeePubKey
27624 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
27627 * Checks if two PayeePubKeys contain equal inner contents.
27629 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
27632 * Checks if two PayeePubKeys contain equal inner contents.
27633 * This ignores pointers and is_owned flags and looks at the values in fields.
27634 * Two objects with NULL inner values will be considered "equal" here.
27636 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
27639 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
27641 void ExpiryTime_free(struct LDKExpiryTime this_obj);
27644 * Creates a copy of the ExpiryTime
27646 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
27649 * Checks if two ExpiryTimes contain equal inner contents.
27651 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
27654 * Checks if two ExpiryTimes contain equal inner contents.
27655 * This ignores pointers and is_owned flags and looks at the values in fields.
27656 * Two objects with NULL inner values will be considered "equal" here.
27658 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
27661 * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
27663 void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
27665 uint64_t MinFinalCltvExpiry_get_a(const struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr);
27667 void MinFinalCltvExpiry_set_a(struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr, uint64_t val);
27670 * Constructs a new MinFinalCltvExpiry given each field
27672 MUST_USE_RES struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_new(uint64_t a_arg);
27675 * Creates a copy of the MinFinalCltvExpiry
27677 struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
27680 * Checks if two MinFinalCltvExpirys contain equal inner contents.
27682 uint64_t MinFinalCltvExpiry_hash(const struct LDKMinFinalCltvExpiry *NONNULL_PTR o);
27685 * Checks if two MinFinalCltvExpirys contain equal inner contents.
27686 * This ignores pointers and is_owned flags and looks at the values in fields.
27687 * Two objects with NULL inner values will be considered "equal" here.
27689 bool MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b);
27692 * Frees any resources used by the Fallback
27694 void Fallback_free(struct LDKFallback this_ptr);
27697 * Creates a copy of the Fallback
27699 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
27702 * Utility method to constructs a new SegWitProgram-variant Fallback
27704 struct LDKFallback Fallback_seg_wit_program(struct LDKu5 version, struct LDKCVec_u8Z program);
27707 * Utility method to constructs a new PubKeyHash-variant Fallback
27709 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
27712 * Utility method to constructs a new ScriptHash-variant Fallback
27714 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
27717 * Checks if two Fallbacks contain equal inner contents.
27719 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
27722 * Checks if two Fallbacks contain equal inner contents.
27723 * This ignores pointers and is_owned flags and looks at the values in fields.
27725 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
27728 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
27730 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
27733 * Creates a copy of the InvoiceSignature
27735 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
27738 * Checks if two InvoiceSignatures contain equal inner contents.
27739 * This ignores pointers and is_owned flags and looks at the values in fields.
27740 * Two objects with NULL inner values will be considered "equal" here.
27742 bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b);
27745 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
27747 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
27750 * Creates a copy of the PrivateRoute
27752 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
27755 * Checks if two PrivateRoutes contain equal inner contents.
27757 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
27760 * Checks if two PrivateRoutes contain equal inner contents.
27761 * This ignores pointers and is_owned flags and looks at the values in fields.
27762 * Two objects with NULL inner values will be considered "equal" here.
27764 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
27767 * Disassembles the `SignedRawInvoice` into its three parts:
27769 * 2. hash of the raw invoice
27772 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
27775 * The `RawInvoice` which was signed.
27777 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
27780 * The hash of the `RawInvoice` that was signed.
27782 MUST_USE_RES const uint8_t (*SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
27785 * InvoiceSignature for the invoice.
27787 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
27790 * Recovers the public key used for signing the invoice from the recoverable signature.
27792 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
27795 * Checks if the signature is valid for the included payee public key or if none exists if it's
27796 * valid for the recovered signature (which should always be true?).
27798 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
27801 * Calculate the hash of the encoded `RawInvoice`
27803 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27807 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27809 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27813 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27815 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27819 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27821 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27825 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27827 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27831 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27833 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27837 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27839 MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27843 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27845 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27849 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27851 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27853 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawInvoice_private_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27855 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27857 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27860 * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
27862 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
27864 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
27867 * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
27868 * the range `0..=MAX_TIMESTAMP`.
27870 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
27872 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
27875 * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
27876 * `0..=MAX_TIMESTAMP`.
27878 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
27880 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
27883 * Returns the Unix timestamp representing the stored time
27885 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
27888 * Returns the duration of the stored time since the Unix epoch
27890 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
27893 * Returns the [`SystemTime`] representing the stored time
27895 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
27898 * Transform the `Invoice` into it's unchecked version
27900 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
27903 * Check that the invoice is signed correctly and that key recovery works
27905 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
27908 * Constructs an `Invoice` from a `SignedRawInvoice` by checking all its invariants.
27910 * use lightning_invoice::*;
27912 * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
27913 * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
27914 * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
27915 * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
27916 * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
27917 * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
27918 * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
27919 * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
27920 * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
27921 * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
27922 * j5r6drg6k6zcqj0fcwg\";
27924 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
27926 * assert!(Invoice::from_signed(signed).is_ok());
27929 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
27932 * Returns the `Invoice`'s timestamp (should equal its creation time)
27934 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
27937 * Returns the `Invoice`'s timestamp as a duration since the Unix epoch
27939 MUST_USE_RES uint64_t Invoice_duration_since_epoch(const struct LDKInvoice *NONNULL_PTR this_arg);
27942 * Returns the hash to which we will receive the preimage on completion of the payment
27944 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
27947 * Get the payee's public key if one was included in the invoice
27949 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27951 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
27954 * Get the payment secret if one was included in the invoice
27956 MUST_USE_RES const uint8_t (*Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
27959 * Get the invoice features if they were included in the invoice
27961 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27963 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
27966 * Recover the payee's public key (only to be used if none was included in the invoice)
27968 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
27971 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
27973 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
27976 * Returns whether the invoice has expired.
27978 MUST_USE_RES bool Invoice_is_expired(const struct LDKInvoice *NONNULL_PTR this_arg);
27981 * Returns whether the expiry time would pass at the given point in time.
27982 * `at_time` is the timestamp as a duration since the Unix epoch.
27984 MUST_USE_RES bool Invoice_would_expire(const struct LDKInvoice *NONNULL_PTR this_arg, uint64_t at_time);
27987 * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
27988 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
27990 MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
27993 * Returns a list of all routes included in the invoice
27995 MUST_USE_RES struct LDKCVec_PrivateRouteZ Invoice_private_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
27998 * Returns a list of all routes included in the invoice as the underlying hints
28000 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_route_hints(const struct LDKInvoice *NONNULL_PTR this_arg);
28003 * Returns the currency for which the invoice was issued
28005 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
28008 * Returns the amount if specified in the invoice as millisatoshis.
28010 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_milli_satoshis(const struct LDKInvoice *NONNULL_PTR this_arg);
28013 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
28014 * returns `CreationError::DescriptionTooLong` otherwise
28016 * Please note that single characters may use more than one byte due to UTF8 encoding.
28018 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
28021 * Returns the underlying description `String`
28023 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
28026 * Construct an `ExpiryTime` from seconds.
28028 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
28031 * Construct an `ExpiryTime` from a `Duration`.
28033 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
28036 * Returns the expiry time in seconds
28038 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
28041 * Returns a reference to the underlying `Duration` (=expiry time)
28043 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
28046 * Creates a new (partial) route from a list of hops
28048 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
28051 * Returns the underlying list of hops
28053 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
28056 * Creates a copy of the CreationError
28058 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
28061 * Utility method to constructs a new DescriptionTooLong-variant CreationError
28063 enum LDKCreationError CreationError_description_too_long(void);
28066 * Utility method to constructs a new RouteTooLong-variant CreationError
28068 enum LDKCreationError CreationError_route_too_long(void);
28071 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
28073 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
28076 * Utility method to constructs a new InvalidAmount-variant CreationError
28078 enum LDKCreationError CreationError_invalid_amount(void);
28081 * Utility method to constructs a new MissingRouteHints-variant CreationError
28083 enum LDKCreationError CreationError_missing_route_hints(void);
28086 * Checks if two CreationErrors contain equal inner contents.
28087 * This ignores pointers and is_owned flags and looks at the values in fields.
28089 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
28092 * Get the string representation of a CreationError object
28094 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
28097 * Creates a copy of the SemanticError
28099 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
28102 * Utility method to constructs a new NoPaymentHash-variant SemanticError
28104 enum LDKSemanticError SemanticError_no_payment_hash(void);
28107 * Utility method to constructs a new MultiplePaymentHashes-variant SemanticError
28109 enum LDKSemanticError SemanticError_multiple_payment_hashes(void);
28112 * Utility method to constructs a new NoDescription-variant SemanticError
28114 enum LDKSemanticError SemanticError_no_description(void);
28117 * Utility method to constructs a new MultipleDescriptions-variant SemanticError
28119 enum LDKSemanticError SemanticError_multiple_descriptions(void);
28122 * Utility method to constructs a new NoPaymentSecret-variant SemanticError
28124 enum LDKSemanticError SemanticError_no_payment_secret(void);
28127 * Utility method to constructs a new MultiplePaymentSecrets-variant SemanticError
28129 enum LDKSemanticError SemanticError_multiple_payment_secrets(void);
28132 * Utility method to constructs a new InvalidFeatures-variant SemanticError
28134 enum LDKSemanticError SemanticError_invalid_features(void);
28137 * Utility method to constructs a new InvalidRecoveryId-variant SemanticError
28139 enum LDKSemanticError SemanticError_invalid_recovery_id(void);
28142 * Utility method to constructs a new InvalidSignature-variant SemanticError
28144 enum LDKSemanticError SemanticError_invalid_signature(void);
28147 * Utility method to constructs a new ImpreciseAmount-variant SemanticError
28149 enum LDKSemanticError SemanticError_imprecise_amount(void);
28152 * Checks if two SemanticErrors contain equal inner contents.
28153 * This ignores pointers and is_owned flags and looks at the values in fields.
28155 bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
28158 * Get the string representation of a SemanticError object
28160 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
28163 * Frees any resources used by the SignOrCreationError
28165 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
28168 * Creates a copy of the SignOrCreationError
28170 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
28173 * Utility method to constructs a new SignError-variant SignOrCreationError
28175 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
28178 * Utility method to constructs a new CreationError-variant SignOrCreationError
28180 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
28183 * Checks if two SignOrCreationErrors contain equal inner contents.
28184 * This ignores pointers and is_owned flags and looks at the values in fields.
28186 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
28189 * Get the string representation of a SignOrCreationError object
28191 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
28194 * Frees any resources used by the InvoicePayer, if is_owned is set and inner is non-NULL.
28196 void InvoicePayer_free(struct LDKInvoicePayer this_obj);
28199 * Calls the free function if one is set
28201 void Payer_free(struct LDKPayer this_ptr);
28204 * Calls the free function if one is set
28206 void Router_free(struct LDKRouter this_ptr);
28209 * Frees any resources used by the Retry
28211 void Retry_free(struct LDKRetry this_ptr);
28214 * Creates a copy of the Retry
28216 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
28219 * Utility method to constructs a new Attempts-variant Retry
28221 struct LDKRetry Retry_attempts(uintptr_t a);
28224 * Utility method to constructs a new Timeout-variant Retry
28226 struct LDKRetry Retry_timeout(uint64_t a);
28229 * Checks if two Retrys contain equal inner contents.
28230 * This ignores pointers and is_owned flags and looks at the values in fields.
28232 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
28235 * Checks if two Retrys contain equal inner contents.
28237 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
28240 * Frees any resources used by the PaymentError
28242 void PaymentError_free(struct LDKPaymentError this_ptr);
28245 * Creates a copy of the PaymentError
28247 struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
28250 * Utility method to constructs a new Invoice-variant PaymentError
28252 struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
28255 * Utility method to constructs a new Routing-variant PaymentError
28257 struct LDKPaymentError PaymentError_routing(struct LDKLightningError a);
28260 * Utility method to constructs a new Sending-variant PaymentError
28262 struct LDKPaymentError PaymentError_sending(struct LDKPaymentSendFailure a);
28265 * Creates an invoice payer that retries failed payment paths.
28267 * Will forward any [`Event::PaymentPathFailed`] events to the decorated `event_handler` once
28268 * `retry` has been exceeded for a given [`Invoice`].
28270 MUST_USE_RES struct LDKInvoicePayer InvoicePayer_new(struct LDKPayer payer, struct LDKRouter router, const struct LDKMultiThreadedLockableScore *NONNULL_PTR scorer, struct LDKLogger logger, struct LDKEventHandler event_handler, struct LDKRetry retry);
28273 * Pays the given [`Invoice`], caching it for later use in case a retry is needed.
28275 * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
28276 * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
28279 MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice);
28282 * Pays the given zero-value [`Invoice`] using the given amount, caching it for later use in
28283 * case a retry is needed.
28285 * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
28286 * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
28289 MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_zero_value_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice, uint64_t amount_msats);
28292 * Pays `pubkey` an amount using the hash of the given preimage, caching it for later use in
28293 * case a retry is needed.
28295 * You should ensure that `payment_preimage` is unique and that its `payment_hash` has never
28296 * been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so for you.
28298 MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_pubkey(const struct LDKInvoicePayer *NONNULL_PTR this_arg, struct LDKPublicKey pubkey, struct LDKThirtyTwoBytes payment_preimage, uint64_t amount_msats, uint32_t final_cltv_expiry_delta);
28301 * Removes the payment cached by the given payment hash.
28303 * Should be called once a payment has failed or succeeded if not using [`InvoicePayer`] as an
28304 * [`EventHandler`]. Otherwise, calling this method is unnecessary.
28306 void InvoicePayer_remove_cached_payment(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
28309 * Constructs a new EventHandler which calls the relevant methods on this_arg.
28310 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
28312 struct LDKEventHandler InvoicePayer_as_EventHandler(const struct LDKInvoicePayer *NONNULL_PTR this_arg);
28315 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
28316 * See [`PhantomKeysManager`] for more information on phantom node payments.
28318 * `phantom_route_hints` parameter:
28319 * * Contains channel info for all nodes participating in the phantom invoice
28320 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
28321 * participating node
28322 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
28323 * updated when a channel becomes disabled or closes
28324 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
28325 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
28328 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
28329 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
28330 * If `None` is provided for `payment_hash`, then one will be created.
28332 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
28333 * in excess of the current time.
28335 * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom
28336 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
28339 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
28340 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
28341 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
28342 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
28343 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
28345 * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
28347 struct LDKCResult_InvoiceSignOrCreationErrorZ create_phantom_invoice(struct LDKCOption_u64Z amt_msat, struct LDKThirtyTwoBytes payment_hash, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKKeysInterface keys_manager, enum LDKCurrency network);
28350 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
28351 * See [`PhantomKeysManager`] for more information on phantom node payments.
28353 * `phantom_route_hints` parameter:
28354 * * Contains channel info for all nodes participating in the phantom invoice
28355 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
28356 * participating node
28357 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
28358 * updated when a channel becomes disabled or closes
28359 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
28360 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
28363 * `description_hash` is a SHA-256 hash of the description text
28365 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
28366 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
28367 * If `None` is provided for `payment_hash`, then one will be created.
28369 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
28370 * in excess of the current time.
28372 * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom
28373 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
28376 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
28377 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
28378 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
28379 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
28380 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
28382 * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
28384 struct LDKCResult_InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(struct LDKCOption_u64Z amt_msat, struct LDKThirtyTwoBytes payment_hash, uint32_t invoice_expiry_delta_secs, struct LDKSha256 description_hash, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKKeysInterface keys_manager, enum LDKCurrency network);
28387 * Utility to construct an invoice. Generally, unless you want to do something like a custom
28388 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
28389 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
28390 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
28391 * that the payment secret is valid when the invoice is paid.
28393 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
28394 * in excess of the current time.
28396 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, uint32_t invoice_expiry_delta_secs);
28399 * Utility to construct an invoice. Generally, unless you want to do something like a custom
28400 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
28401 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
28402 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
28403 * that the payment secret is valid when the invoice is paid.
28404 * Use this variant if you want to pass the `description_hash` to the invoice.
28406 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
28407 * in excess of the current time.
28409 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint32_t invoice_expiry_delta_secs);
28412 * See [`create_invoice_from_channelmanager_with_description_hash`]
28413 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
28414 * available and the current time is supplied by the caller.
28416 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs);
28419 * See [`create_invoice_from_channelmanager`]
28420 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
28421 * available and the current time is supplied by the caller.
28423 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs);
28426 * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
28428 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
28431 * Creates a new router using the given [`NetworkGraph`], a [`Logger`], and a randomness source
28432 * `random_seed_bytes`.
28434 MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKThirtyTwoBytes random_seed_bytes);
28437 * Constructs a new Router which calls the relevant methods on this_arg.
28438 * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
28440 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
28443 * Constructs a new Payer which calls the relevant methods on this_arg.
28444 * This copies the `inner` pointer in this_arg and thus the returned Payer must be freed before this_arg is
28446 struct LDKPayer ChannelManager_as_Payer(const struct LDKChannelManager *NONNULL_PTR this_arg);
28449 * Read a SiPrefix object from a string
28451 struct LDKCResult_SiPrefixParseErrorZ SiPrefix_from_str(struct LDKStr s);
28454 * Read a Invoice object from a string
28456 struct LDKCResult_InvoiceParseOrSemanticErrorZ Invoice_from_str(struct LDKStr s);
28459 * Read a SignedRawInvoice object from a string
28461 struct LDKCResult_SignedRawInvoiceParseErrorZ SignedRawInvoice_from_str(struct LDKStr s);
28464 * Get the string representation of a ParseError object
28466 struct LDKStr ParseError_to_str(const struct LDKParseError *NONNULL_PTR o);
28469 * Get the string representation of a ParseOrSemanticError object
28471 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
28474 * Get the string representation of a Invoice object
28476 struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o);
28479 * Get the string representation of a SignedRawInvoice object
28481 struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o);
28484 * Get the string representation of a Currency object
28486 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
28489 * Get the string representation of a SiPrefix object
28491 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
28494 * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
28496 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
28499 * Instantiate a new [`RapidGossipSync`] instance
28501 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph);
28504 * Sync gossip data from a file
28505 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
28507 * `network_graph`: The network graph to apply the updates to
28509 * `sync_path`: Path to the file where the gossip update data is located
28512 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path);
28515 * Returns whether a rapid gossip sync has completed at least once
28517 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
28520 * Frees any resources used by the GraphSyncError
28522 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
28525 * Creates a copy of the GraphSyncError
28527 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
28530 * Utility method to constructs a new DecodeError-variant GraphSyncError
28532 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
28535 * Utility method to constructs a new LightningError-variant GraphSyncError
28537 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
28540 * Update network graph from binary data.
28541 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
28543 * `network_graph`: network graph to be updated
28545 * `update_data`: `&[u8]` binary stream that comprises the update data
28547 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
28549 #endif /* LDK_C_BINDINGS_H */
28551 #include "ldk_ver.h"