1 #ifndef LDK_C_BINDINGS_H
2 #define LDK_C_BINDINGS_H
4 /* Generated with cbindgen:0.24.3 */
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_without_broadcasting_txn`].
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_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
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_without_broadcasting_txn`] to reject.
3135 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3136 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
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_without_broadcasting_txn`] to reject the
3147 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3148 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
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;
4419 * A tuple of 2 elements. See the individual fields for the types contained.
4421 typedef struct LDKC2Tuple_u64u64Z {
4423 * The element at position 0
4427 * The element at position 1
4430 } LDKC2Tuple_u64u64Z;
4433 * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u64Z or not
4435 typedef enum LDKCOption_C2Tuple_u64u64ZZ_Tag {
4437 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains a crate::c_types::derived::C2Tuple_u64u64Z
4439 LDKCOption_C2Tuple_u64u64ZZ_Some,
4441 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains nothing
4443 LDKCOption_C2Tuple_u64u64ZZ_None,
4445 * Must be last for serialization purposes
4447 LDKCOption_C2Tuple_u64u64ZZ_Sentinel,
4448 } LDKCOption_C2Tuple_u64u64ZZ_Tag;
4450 typedef struct LDKCOption_C2Tuple_u64u64ZZ {
4451 LDKCOption_C2Tuple_u64u64ZZ_Tag tag;
4454 struct LDKC2Tuple_u64u64Z some;
4457 } LDKCOption_C2Tuple_u64u64ZZ;
4462 * Represents the compressed public key of a node
4464 typedef struct MUST_USE_STRUCT LDKNodeId {
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 LDKnativeNodeId *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.
4480 * A dynamically-allocated array of crate::lightning::routing::gossip::NodeIds of arbitrary size.
4481 * This corresponds to std::vector in C++
4483 typedef struct LDKCVec_NodeIdZ {
4485 * The elements in the array.
4486 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4488 struct LDKNodeId *data;
4490 * The number of elements pointed to by `data`.
4498 * A Record, unit of logging output with Metadata to enable filtering
4499 * Module_path, file, line to inform on log's source
4501 typedef struct MUST_USE_STRUCT LDKRecord {
4503 * A pointer to the opaque Rust object.
4504 * Nearly everywhere, inner must be non-null, however in places where
4505 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4507 LDKnativeRecord *inner;
4509 * Indicates that this is the only struct which contains the same pointer.
4510 * Rust functions which take ownership of an object provided via an argument require
4511 * this to be true and invalidate the object pointed to by inner.
4517 * A trait encapsulating the operations required of a logger
4519 typedef struct LDKLogger {
4521 * An opaque pointer which is passed to your function implementations as an argument.
4522 * This has no meaning in the LDK, and can be NULL or any other value.
4528 void (*log)(const void *this_arg, const struct LDKRecord *NONNULL_PTR record);
4530 * Frees any resources associated with this object given its this_arg pointer.
4531 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4533 void (*free)(void *this_arg);
4539 * Represents the network as nodes and channels between them
4541 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4543 * A pointer to the opaque Rust object.
4544 * Nearly everywhere, inner must be non-null, however in places where
4545 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4547 LDKnativeNetworkGraph *inner;
4549 * Indicates that this is the only struct which contains the same pointer.
4550 * Rust functions which take ownership of an object provided via an argument require
4551 * this to be true and invalidate the object pointed to by inner.
4559 * [`Score`] implementation using channel success probability distributions.
4561 * Based on *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
4562 * and Stefan Richter [[1]]. Given the uncertainty of channel liquidity balances, probability
4563 * distributions are defined based on knowledge learned from successful and unsuccessful attempts.
4564 * Then the negative `log10` of the success probability is used to determine the cost of routing a
4565 * specific HTLC amount through a channel.
4567 * Knowledge about channel liquidity balances takes the form of upper and lower bounds on the
4568 * possible liquidity. Certainty of the bounds is decreased over time using a decay function. See
4569 * [`ProbabilisticScoringParameters`] for details.
4571 * Since the scorer aims to learn the current channel liquidity balances, it works best for nodes
4572 * with high payment volume or that actively probe the [`NetworkGraph`]. Nodes with low payment
4573 * volume are more likely to experience failed payment paths, which would need to be retried.
4577 * Mixing the `no-std` feature between serialization and deserialization results in undefined
4580 * [1]: https://arxiv.org/abs/2107.05322
4582 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
4584 * A pointer to the opaque Rust object.
4585 * Nearly everywhere, inner must be non-null, however in places where
4586 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4588 LDKnativeProbabilisticScorer *inner;
4590 * Indicates that this is the only struct which contains the same pointer.
4591 * Rust functions which take ownership of an object provided via an argument require
4592 * this to be true and invalidate the object pointed to by inner.
4595 } LDKProbabilisticScorer;
4598 * The contents of CResult_ProbabilisticScorerDecodeErrorZ
4600 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
4602 * A pointer to the contents in the success state.
4603 * Reading from this pointer when `result_ok` is not set is undefined.
4605 struct LDKProbabilisticScorer *result;
4607 * A pointer to the contents in the error state.
4608 * Reading from this pointer when `result_ok` is set is undefined.
4610 struct LDKDecodeError *err;
4611 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
4614 * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
4615 * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4616 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4618 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
4620 * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
4621 * `err` or `result` depending on the state of `result_ok`.
4623 union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
4625 * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
4628 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
4633 * Features used within an `init` message.
4635 typedef struct MUST_USE_STRUCT LDKInitFeatures {
4637 * A pointer to the opaque Rust object.
4638 * Nearly everywhere, inner must be non-null, however in places where
4639 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4641 LDKnativeInitFeatures *inner;
4643 * Indicates that this is the only struct which contains the same pointer.
4644 * Rust functions which take ownership of an object provided via an argument require
4645 * this to be true and invalidate the object pointed to by inner.
4651 * The contents of CResult_InitFeaturesDecodeErrorZ
4653 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
4655 * A pointer to the contents in the success state.
4656 * Reading from this pointer when `result_ok` is not set is undefined.
4658 struct LDKInitFeatures *result;
4660 * A pointer to the contents in the error state.
4661 * Reading from this pointer when `result_ok` is set is undefined.
4663 struct LDKDecodeError *err;
4664 } LDKCResult_InitFeaturesDecodeErrorZPtr;
4667 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
4668 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4669 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4671 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
4673 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
4674 * `err` or `result` depending on the state of `result_ok`.
4676 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
4678 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
4681 } LDKCResult_InitFeaturesDecodeErrorZ;
4686 * Features used within a `channel_announcement` message.
4688 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
4690 * A pointer to the opaque Rust object.
4691 * Nearly everywhere, inner must be non-null, however in places where
4692 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4694 LDKnativeChannelFeatures *inner;
4696 * Indicates that this is the only struct which contains the same pointer.
4697 * Rust functions which take ownership of an object provided via an argument require
4698 * this to be true and invalidate the object pointed to by inner.
4701 } LDKChannelFeatures;
4704 * The contents of CResult_ChannelFeaturesDecodeErrorZ
4706 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
4708 * A pointer to the contents in the success state.
4709 * Reading from this pointer when `result_ok` is not set is undefined.
4711 struct LDKChannelFeatures *result;
4713 * A pointer to the contents in the error state.
4714 * Reading from this pointer when `result_ok` is set is undefined.
4716 struct LDKDecodeError *err;
4717 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
4720 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
4721 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4722 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4724 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
4726 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
4727 * `err` or `result` depending on the state of `result_ok`.
4729 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
4731 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
4734 } LDKCResult_ChannelFeaturesDecodeErrorZ;
4739 * Features used within a `node_announcement` message.
4741 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
4743 * A pointer to the opaque Rust object.
4744 * Nearly everywhere, inner must be non-null, however in places where
4745 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4747 LDKnativeNodeFeatures *inner;
4749 * Indicates that this is the only struct which contains the same pointer.
4750 * Rust functions which take ownership of an object provided via an argument require
4751 * this to be true and invalidate the object pointed to by inner.
4757 * The contents of CResult_NodeFeaturesDecodeErrorZ
4759 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
4761 * A pointer to the contents in the success state.
4762 * Reading from this pointer when `result_ok` is not set is undefined.
4764 struct LDKNodeFeatures *result;
4766 * A pointer to the contents in the error state.
4767 * Reading from this pointer when `result_ok` is set is undefined.
4769 struct LDKDecodeError *err;
4770 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
4773 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
4774 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4775 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4777 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
4779 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
4780 * `err` or `result` depending on the state of `result_ok`.
4782 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
4784 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
4787 } LDKCResult_NodeFeaturesDecodeErrorZ;
4792 * Features used within an invoice.
4794 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
4796 * A pointer to the opaque Rust object.
4797 * Nearly everywhere, inner must be non-null, however in places where
4798 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4800 LDKnativeInvoiceFeatures *inner;
4802 * Indicates that this is the only struct which contains the same pointer.
4803 * Rust functions which take ownership of an object provided via an argument require
4804 * this to be true and invalidate the object pointed to by inner.
4807 } LDKInvoiceFeatures;
4810 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
4812 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
4814 * A pointer to the contents in the success state.
4815 * Reading from this pointer when `result_ok` is not set is undefined.
4817 struct LDKInvoiceFeatures *result;
4819 * A pointer to the contents in the error state.
4820 * Reading from this pointer when `result_ok` is set is undefined.
4822 struct LDKDecodeError *err;
4823 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
4826 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
4827 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4828 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4830 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
4832 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
4833 * `err` or `result` depending on the state of `result_ok`.
4835 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
4837 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
4840 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
4843 * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
4845 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
4847 * A pointer to the contents in the success state.
4848 * Reading from this pointer when `result_ok` is not set is undefined.
4850 struct LDKChannelTypeFeatures *result;
4852 * A pointer to the contents in the error state.
4853 * Reading from this pointer when `result_ok` is set is undefined.
4855 struct LDKDecodeError *err;
4856 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
4859 * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
4860 * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4861 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4863 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
4865 * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
4866 * `err` or `result` depending on the state of `result_ok`.
4868 union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
4870 * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
4873 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
4876 * The contents of CResult_NodeIdDecodeErrorZ
4878 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
4880 * A pointer to the contents in the success state.
4881 * Reading from this pointer when `result_ok` is not set is undefined.
4883 struct LDKNodeId *result;
4885 * A pointer to the contents in the error state.
4886 * Reading from this pointer when `result_ok` is set is undefined.
4888 struct LDKDecodeError *err;
4889 } LDKCResult_NodeIdDecodeErrorZPtr;
4892 * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
4893 * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
4894 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4896 typedef struct LDKCResult_NodeIdDecodeErrorZ {
4898 * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
4899 * `err` or `result` depending on the state of `result_ok`.
4901 union LDKCResult_NodeIdDecodeErrorZPtr contents;
4903 * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
4906 } LDKCResult_NodeIdDecodeErrorZ;
4909 * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
4911 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
4913 * A pointer to the contents in the success state.
4914 * Reading from this pointer when `result_ok` is not set is undefined.
4916 struct LDKCOption_NetworkUpdateZ *result;
4918 * A pointer to the contents in the error state.
4919 * Reading from this pointer when `result_ok` is set is undefined.
4921 struct LDKDecodeError *err;
4922 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
4925 * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
4926 * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
4927 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4929 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
4931 * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
4932 * `err` or `result` depending on the state of `result_ok`.
4934 union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
4936 * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
4939 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
4942 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
4945 typedef struct LDKAccess {
4947 * An opaque pointer which is passed to your function implementations as an argument.
4948 * This has no meaning in the LDK, and can be NULL or any other value.
4952 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
4953 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
4956 * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
4958 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
4960 * Frees any resources associated with this object given its this_arg pointer.
4961 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4963 void (*free)(void *this_arg);
4967 * An enum which can either contain a crate::lightning::chain::Access or not
4969 typedef enum LDKCOption_AccessZ_Tag {
4971 * When we're in this state, this COption_AccessZ contains a crate::lightning::chain::Access
4973 LDKCOption_AccessZ_Some,
4975 * When we're in this state, this COption_AccessZ contains nothing
4977 LDKCOption_AccessZ_None,
4979 * Must be last for serialization purposes
4981 LDKCOption_AccessZ_Sentinel,
4982 } LDKCOption_AccessZ_Tag;
4984 typedef struct LDKCOption_AccessZ {
4985 LDKCOption_AccessZ_Tag tag;
4988 struct LDKAccess some;
4991 } LDKCOption_AccessZ;
4994 * The contents of CResult_boolLightningErrorZ
4996 typedef union LDKCResult_boolLightningErrorZPtr {
4998 * A pointer to the contents in the success state.
4999 * Reading from this pointer when `result_ok` is not set is undefined.
5003 * A pointer to the contents in the error state.
5004 * Reading from this pointer when `result_ok` is set is undefined.
5006 struct LDKLightningError *err;
5007 } LDKCResult_boolLightningErrorZPtr;
5010 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
5011 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
5012 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5014 typedef struct LDKCResult_boolLightningErrorZ {
5016 * The contents of this CResult_boolLightningErrorZ, accessible via either
5017 * `err` or `result` depending on the state of `result_ok`.
5019 union LDKCResult_boolLightningErrorZPtr contents;
5021 * Whether this CResult_boolLightningErrorZ represents a success state.
5024 } LDKCResult_boolLightningErrorZ;
5027 * A tuple of 3 elements. See the individual fields for the types contained.
5029 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
5031 * The element at position 0
5033 struct LDKChannelAnnouncement a;
5035 * The element at position 1
5037 struct LDKChannelUpdate b;
5039 * The element at position 2
5041 struct LDKChannelUpdate c;
5042 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
5045 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
5046 * This corresponds to std::vector in C++
5048 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
5050 * The elements in the array.
5051 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5053 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
5055 * The number of elements pointed to by `data`.
5058 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
5061 * A dynamically-allocated array of crate::lightning::ln::msgs::NodeAnnouncements of arbitrary size.
5062 * This corresponds to std::vector in C++
5064 typedef struct LDKCVec_NodeAnnouncementZ {
5066 * The elements in the array.
5067 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5069 struct LDKNodeAnnouncement *data;
5071 * The number of elements pointed to by `data`.
5074 } LDKCVec_NodeAnnouncementZ;
5077 * The contents of CResult_NoneLightningErrorZ
5079 typedef union LDKCResult_NoneLightningErrorZPtr {
5081 * Note that this value is always NULL, as there are no contents in the OK variant
5085 * A pointer to the contents in the error state.
5086 * Reading from this pointer when `result_ok` is set is undefined.
5088 struct LDKLightningError *err;
5089 } LDKCResult_NoneLightningErrorZPtr;
5092 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
5093 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
5094 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5096 typedef struct LDKCResult_NoneLightningErrorZ {
5098 * The contents of this CResult_NoneLightningErrorZ, accessible via either
5099 * `err` or `result` depending on the state of `result_ok`.
5101 union LDKCResult_NoneLightningErrorZPtr contents;
5103 * Whether this CResult_NoneLightningErrorZ represents a success state.
5106 } LDKCResult_NoneLightningErrorZ;
5111 * Details about one direction of a channel as received within a [`ChannelUpdate`].
5113 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
5115 * A pointer to the opaque Rust object.
5116 * Nearly everywhere, inner must be non-null, however in places where
5117 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5119 LDKnativeChannelUpdateInfo *inner;
5121 * Indicates that this is the only struct which contains the same pointer.
5122 * Rust functions which take ownership of an object provided via an argument require
5123 * this to be true and invalidate the object pointed to by inner.
5126 } LDKChannelUpdateInfo;
5129 * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
5131 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
5133 * A pointer to the contents in the success state.
5134 * Reading from this pointer when `result_ok` is not set is undefined.
5136 struct LDKChannelUpdateInfo *result;
5138 * A pointer to the contents in the error state.
5139 * Reading from this pointer when `result_ok` is set is undefined.
5141 struct LDKDecodeError *err;
5142 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
5145 * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
5146 * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5147 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5149 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
5151 * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
5152 * `err` or `result` depending on the state of `result_ok`.
5154 union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
5156 * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
5159 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
5164 * Details about a channel (both directions).
5165 * Received within a channel announcement.
5167 typedef struct MUST_USE_STRUCT LDKChannelInfo {
5169 * A pointer to the opaque Rust object.
5170 * Nearly everywhere, inner must be non-null, however in places where
5171 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5173 LDKnativeChannelInfo *inner;
5175 * Indicates that this is the only struct which contains the same pointer.
5176 * Rust functions which take ownership of an object provided via an argument require
5177 * this to be true and invalidate the object pointed to by inner.
5183 * The contents of CResult_ChannelInfoDecodeErrorZ
5185 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
5187 * A pointer to the contents in the success state.
5188 * Reading from this pointer when `result_ok` is not set is undefined.
5190 struct LDKChannelInfo *result;
5192 * A pointer to the contents in the error state.
5193 * Reading from this pointer when `result_ok` is set is undefined.
5195 struct LDKDecodeError *err;
5196 } LDKCResult_ChannelInfoDecodeErrorZPtr;
5199 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
5200 * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5201 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5203 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
5205 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
5206 * `err` or `result` depending on the state of `result_ok`.
5208 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
5210 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
5213 } LDKCResult_ChannelInfoDecodeErrorZ;
5218 * Fees for routing via a given channel or a node
5220 typedef struct MUST_USE_STRUCT LDKRoutingFees {
5222 * A pointer to the opaque Rust object.
5223 * Nearly everywhere, inner must be non-null, however in places where
5224 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5226 LDKnativeRoutingFees *inner;
5228 * Indicates that this is the only struct which contains the same pointer.
5229 * Rust functions which take ownership of an object provided via an argument require
5230 * this to be true and invalidate the object pointed to by inner.
5236 * The contents of CResult_RoutingFeesDecodeErrorZ
5238 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
5240 * A pointer to the contents in the success state.
5241 * Reading from this pointer when `result_ok` is not set is undefined.
5243 struct LDKRoutingFees *result;
5245 * A pointer to the contents in the error state.
5246 * Reading from this pointer when `result_ok` is set is undefined.
5248 struct LDKDecodeError *err;
5249 } LDKCResult_RoutingFeesDecodeErrorZPtr;
5252 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
5253 * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
5254 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5256 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
5258 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
5259 * `err` or `result` depending on the state of `result_ok`.
5261 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
5263 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
5266 } LDKCResult_RoutingFeesDecodeErrorZ;
5269 * A 4-byte byte array.
5271 typedef struct LDKFourBytes {
5279 * A 16-byte byte array.
5281 typedef struct LDKSixteenBytes {
5289 * A 12-byte byte array.
5291 typedef struct LDKTwelveBytes {
5299 * An address which can be used to connect to a remote peer
5301 typedef enum LDKNetAddress_Tag {
5303 * An IPv4 address/port on which the peer is listening.
5307 * An IPv6 address/port on which the peer is listening.
5311 * An old-style Tor onion address/port on which the peer is listening.
5313 * This field is deprecated and the Tor network generally no longer supports V2 Onion
5314 * addresses. Thus, the details are not parsed here.
5316 LDKNetAddress_OnionV2,
5318 * A new-style Tor onion address/port on which the peer is listening.
5319 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
5320 * wrap as base32 and append \".onion\".
5322 LDKNetAddress_OnionV3,
5324 * Must be last for serialization purposes
5326 LDKNetAddress_Sentinel,
5327 } LDKNetAddress_Tag;
5329 typedef struct LDKNetAddress_LDKIPv4_Body {
5331 * The 4-byte IPv4 address
5333 struct LDKFourBytes addr;
5335 * The port on which the node is listening
5338 } LDKNetAddress_LDKIPv4_Body;
5340 typedef struct LDKNetAddress_LDKIPv6_Body {
5342 * The 16-byte IPv6 address
5344 struct LDKSixteenBytes addr;
5346 * The port on which the node is listening
5349 } LDKNetAddress_LDKIPv6_Body;
5351 typedef struct LDKNetAddress_LDKOnionV3_Body {
5353 * The ed25519 long-term public key of the peer
5355 struct LDKThirtyTwoBytes ed25519_pubkey;
5357 * The checksum of the pubkey and version, as included in the onion address
5361 * The version byte, as defined by the Tor Onion v3 spec.
5365 * The port on which the node is listening
5368 } LDKNetAddress_LDKOnionV3_Body;
5370 typedef struct MUST_USE_STRUCT LDKNetAddress {
5371 LDKNetAddress_Tag tag;
5373 LDKNetAddress_LDKIPv4_Body i_pv4;
5374 LDKNetAddress_LDKIPv6_Body i_pv6;
5376 struct LDKTwelveBytes onion_v2;
5378 LDKNetAddress_LDKOnionV3_Body onion_v3;
5383 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
5384 * This corresponds to std::vector in C++
5386 typedef struct LDKCVec_NetAddressZ {
5388 * The elements in the array.
5389 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5391 struct LDKNetAddress *data;
5393 * The number of elements pointed to by `data`.
5396 } LDKCVec_NetAddressZ;
5401 * Information received in the latest node_announcement from this node.
5403 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
5405 * A pointer to the opaque Rust object.
5406 * Nearly everywhere, inner must be non-null, however in places where
5407 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5409 LDKnativeNodeAnnouncementInfo *inner;
5411 * Indicates that this is the only struct which contains the same pointer.
5412 * Rust functions which take ownership of an object provided via an argument require
5413 * this to be true and invalidate the object pointed to by inner.
5416 } LDKNodeAnnouncementInfo;
5419 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
5421 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
5423 * A pointer to the contents in the success state.
5424 * Reading from this pointer when `result_ok` is not set is undefined.
5426 struct LDKNodeAnnouncementInfo *result;
5428 * A pointer to the contents in the error state.
5429 * Reading from this pointer when `result_ok` is set is undefined.
5431 struct LDKDecodeError *err;
5432 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
5435 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
5436 * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5437 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5439 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
5441 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
5442 * `err` or `result` depending on the state of `result_ok`.
5444 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
5446 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
5449 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
5454 * A user-defined name for a node, which may be used when displaying the node in a graph.
5456 * Since node aliases are provided by third parties, they are a potential avenue for injection
5457 * attacks. Care must be taken when processing.
5459 typedef struct MUST_USE_STRUCT LDKNodeAlias {
5461 * A pointer to the opaque Rust object.
5462 * Nearly everywhere, inner must be non-null, however in places where
5463 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5465 LDKnativeNodeAlias *inner;
5467 * Indicates that this is the only struct which contains the same pointer.
5468 * Rust functions which take ownership of an object provided via an argument require
5469 * this to be true and invalidate the object pointed to by inner.
5475 * The contents of CResult_NodeAliasDecodeErrorZ
5477 typedef union LDKCResult_NodeAliasDecodeErrorZPtr {
5479 * A pointer to the contents in the success state.
5480 * Reading from this pointer when `result_ok` is not set is undefined.
5482 struct LDKNodeAlias *result;
5484 * A pointer to the contents in the error state.
5485 * Reading from this pointer when `result_ok` is set is undefined.
5487 struct LDKDecodeError *err;
5488 } LDKCResult_NodeAliasDecodeErrorZPtr;
5491 * A CResult_NodeAliasDecodeErrorZ represents the result of a fallible operation,
5492 * containing a crate::lightning::routing::gossip::NodeAlias on success and a crate::lightning::ln::msgs::DecodeError on failure.
5493 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5495 typedef struct LDKCResult_NodeAliasDecodeErrorZ {
5497 * The contents of this CResult_NodeAliasDecodeErrorZ, accessible via either
5498 * `err` or `result` depending on the state of `result_ok`.
5500 union LDKCResult_NodeAliasDecodeErrorZPtr contents;
5502 * Whether this CResult_NodeAliasDecodeErrorZ represents a success state.
5505 } LDKCResult_NodeAliasDecodeErrorZ;
5508 * A dynamically-allocated array of u64s of arbitrary size.
5509 * This corresponds to std::vector in C++
5511 typedef struct LDKCVec_u64Z {
5513 * The elements in the array.
5514 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5518 * The number of elements pointed to by `data`.
5526 * Details about a node in the network, known from the network announcement.
5528 typedef struct MUST_USE_STRUCT LDKNodeInfo {
5530 * A pointer to the opaque Rust object.
5531 * Nearly everywhere, inner must be non-null, however in places where
5532 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5534 LDKnativeNodeInfo *inner;
5536 * Indicates that this is the only struct which contains the same pointer.
5537 * Rust functions which take ownership of an object provided via an argument require
5538 * this to be true and invalidate the object pointed to by inner.
5544 * The contents of CResult_NodeInfoDecodeErrorZ
5546 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
5548 * A pointer to the contents in the success state.
5549 * Reading from this pointer when `result_ok` is not set is undefined.
5551 struct LDKNodeInfo *result;
5553 * A pointer to the contents in the error state.
5554 * Reading from this pointer when `result_ok` is set is undefined.
5556 struct LDKDecodeError *err;
5557 } LDKCResult_NodeInfoDecodeErrorZPtr;
5560 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
5561 * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5562 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5564 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
5566 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
5567 * `err` or `result` depending on the state of `result_ok`.
5569 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
5571 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
5574 } LDKCResult_NodeInfoDecodeErrorZ;
5577 * The contents of CResult_NetworkGraphDecodeErrorZ
5579 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
5581 * A pointer to the contents in the success state.
5582 * Reading from this pointer when `result_ok` is not set is undefined.
5584 struct LDKNetworkGraph *result;
5586 * A pointer to the contents in the error state.
5587 * Reading from this pointer when `result_ok` is set is undefined.
5589 struct LDKDecodeError *err;
5590 } LDKCResult_NetworkGraphDecodeErrorZPtr;
5593 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
5594 * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
5595 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5597 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
5599 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
5600 * `err` or `result` depending on the state of `result_ok`.
5602 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
5604 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
5607 } LDKCResult_NetworkGraphDecodeErrorZ;
5610 * An enum which can either contain a crate::c_types::derived::CVec_NetAddressZ or not
5612 typedef enum LDKCOption_CVec_NetAddressZZ_Tag {
5614 * When we're in this state, this COption_CVec_NetAddressZZ contains a crate::c_types::derived::CVec_NetAddressZ
5616 LDKCOption_CVec_NetAddressZZ_Some,
5618 * When we're in this state, this COption_CVec_NetAddressZZ contains nothing
5620 LDKCOption_CVec_NetAddressZZ_None,
5622 * Must be last for serialization purposes
5624 LDKCOption_CVec_NetAddressZZ_Sentinel,
5625 } LDKCOption_CVec_NetAddressZZ_Tag;
5627 typedef struct LDKCOption_CVec_NetAddressZZ {
5628 LDKCOption_CVec_NetAddressZZ_Tag tag;
5631 struct LDKCVec_NetAddressZ some;
5634 } LDKCOption_CVec_NetAddressZZ;
5637 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
5639 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
5641 * A pointer to the contents in the success state.
5642 * Reading from this pointer when `result_ok` is not set is undefined.
5644 struct LDKDelayedPaymentOutputDescriptor *result;
5646 * A pointer to the contents in the error state.
5647 * Reading from this pointer when `result_ok` is set is undefined.
5649 struct LDKDecodeError *err;
5650 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
5653 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
5654 * containing a crate::lightning::chain::keysinterface::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
5655 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5657 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
5659 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
5660 * `err` or `result` depending on the state of `result_ok`.
5662 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
5664 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
5667 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
5670 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
5672 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
5674 * A pointer to the contents in the success state.
5675 * Reading from this pointer when `result_ok` is not set is undefined.
5677 struct LDKStaticPaymentOutputDescriptor *result;
5679 * A pointer to the contents in the error state.
5680 * Reading from this pointer when `result_ok` is set is undefined.
5682 struct LDKDecodeError *err;
5683 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
5686 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
5687 * containing a crate::lightning::chain::keysinterface::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
5688 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5690 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
5692 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
5693 * `err` or `result` depending on the state of `result_ok`.
5695 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
5697 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
5700 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
5703 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
5705 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
5707 * A pointer to the contents in the success state.
5708 * Reading from this pointer when `result_ok` is not set is undefined.
5710 struct LDKSpendableOutputDescriptor *result;
5712 * A pointer to the contents in the error state.
5713 * Reading from this pointer when `result_ok` is set is undefined.
5715 struct LDKDecodeError *err;
5716 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
5719 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
5720 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
5721 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5723 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
5725 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
5726 * `err` or `result` depending on the state of `result_ok`.
5728 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
5730 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
5733 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
5736 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
5737 * This corresponds to std::vector in C++
5739 typedef struct LDKCVec_PaymentPreimageZ {
5741 * The elements in the array.
5742 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5744 struct LDKThirtyTwoBytes *data;
5746 * The number of elements pointed to by `data`.
5749 } LDKCVec_PaymentPreimageZ;
5752 * A tuple of 2 elements. See the individual fields for the types contained.
5754 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
5756 * The element at position 0
5758 struct LDKSignature a;
5760 * The element at position 1
5762 struct LDKCVec_SignatureZ b;
5763 } LDKC2Tuple_SignatureCVec_SignatureZZ;
5766 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
5768 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
5770 * A pointer to the contents in the success state.
5771 * Reading from this pointer when `result_ok` is not set is undefined.
5773 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
5775 * Note that this value is always NULL, as there are no contents in the Err variant
5778 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
5781 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
5782 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
5783 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5785 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
5787 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
5788 * `err` or `result` depending on the state of `result_ok`.
5790 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
5792 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
5795 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
5798 * The contents of CResult_SignatureNoneZ
5800 typedef union LDKCResult_SignatureNoneZPtr {
5802 * A pointer to the contents in the success state.
5803 * Reading from this pointer when `result_ok` is not set is undefined.
5805 struct LDKSignature *result;
5807 * Note that this value is always NULL, as there are no contents in the Err variant
5810 } LDKCResult_SignatureNoneZPtr;
5813 * A CResult_SignatureNoneZ represents the result of a fallible operation,
5814 * containing a crate::c_types::Signature on success and a () on failure.
5815 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5817 typedef struct LDKCResult_SignatureNoneZ {
5819 * The contents of this CResult_SignatureNoneZ, accessible via either
5820 * `err` or `result` depending on the state of `result_ok`.
5822 union LDKCResult_SignatureNoneZPtr contents;
5824 * Whether this CResult_SignatureNoneZ represents a success state.
5827 } LDKCResult_SignatureNoneZ;
5830 * A tuple of 2 elements. See the individual fields for the types contained.
5832 typedef struct LDKC2Tuple_SignatureSignatureZ {
5834 * The element at position 0
5836 struct LDKSignature a;
5838 * The element at position 1
5840 struct LDKSignature b;
5841 } LDKC2Tuple_SignatureSignatureZ;
5844 * The contents of CResult_C2Tuple_SignatureSignatureZNoneZ
5846 typedef union LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr {
5848 * A pointer to the contents in the success state.
5849 * Reading from this pointer when `result_ok` is not set is undefined.
5851 struct LDKC2Tuple_SignatureSignatureZ *result;
5853 * Note that this value is always NULL, as there are no contents in the Err variant
5856 } LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr;
5859 * A CResult_C2Tuple_SignatureSignatureZNoneZ represents the result of a fallible operation,
5860 * containing a crate::c_types::derived::C2Tuple_SignatureSignatureZ on success and a () on failure.
5861 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5863 typedef struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ {
5865 * The contents of this CResult_C2Tuple_SignatureSignatureZNoneZ, accessible via either
5866 * `err` or `result` depending on the state of `result_ok`.
5868 union LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr contents;
5870 * Whether this CResult_C2Tuple_SignatureSignatureZNoneZ represents a success state.
5873 } LDKCResult_C2Tuple_SignatureSignatureZNoneZ;
5876 * The contents of CResult_SecretKeyNoneZ
5878 typedef union LDKCResult_SecretKeyNoneZPtr {
5880 * A pointer to the contents in the success state.
5881 * Reading from this pointer when `result_ok` is not set is undefined.
5883 struct LDKSecretKey *result;
5885 * Note that this value is always NULL, as there are no contents in the Err variant
5888 } LDKCResult_SecretKeyNoneZPtr;
5891 * A CResult_SecretKeyNoneZ represents the result of a fallible operation,
5892 * containing a crate::c_types::SecretKey on success and a () on failure.
5893 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5895 typedef struct LDKCResult_SecretKeyNoneZ {
5897 * The contents of this CResult_SecretKeyNoneZ, accessible via either
5898 * `err` or `result` depending on the state of `result_ok`.
5900 union LDKCResult_SecretKeyNoneZPtr contents;
5902 * Whether this CResult_SecretKeyNoneZ represents a success state.
5905 } LDKCResult_SecretKeyNoneZ;
5910 * This class tracks the per-transaction information needed to build a closing transaction and will
5911 * actually build it and sign.
5913 * This class can be used inside a signer implementation to generate a signature given the relevant
5916 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
5918 * A pointer to the opaque Rust object.
5919 * Nearly everywhere, inner must be non-null, however in places where
5920 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5922 LDKnativeClosingTransaction *inner;
5924 * Indicates that this is the only struct which contains the same pointer.
5925 * Rust functions which take ownership of an object provided via an argument require
5926 * this to be true and invalidate the object pointed to by inner.
5929 } LDKClosingTransaction;
5934 * The unsigned part of a channel_announcement
5936 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
5938 * A pointer to the opaque Rust object.
5939 * Nearly everywhere, inner must be non-null, however in places where
5940 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5942 LDKnativeUnsignedChannelAnnouncement *inner;
5944 * Indicates that this is the only struct which contains the same pointer.
5945 * Rust functions which take ownership of an object provided via an argument require
5946 * this to be true and invalidate the object pointed to by inner.
5949 } LDKUnsignedChannelAnnouncement;
5952 * A trait to sign lightning channel transactions as described in BOLT 3.
5954 * Signing services could be implemented on a hardware wallet. In this case,
5955 * the current Sign would be a front-end on top of a communication
5956 * channel connected to your secure device and lightning key material wouldn't
5957 * reside on a hot server. Nevertheless, a this deployment would still need
5958 * to trust the ChannelManager to avoid loss of funds as this latest component
5959 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
5961 * A more secure iteration would be to use hashlock (or payment points) to pair
5962 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
5963 * at the price of more state and computation on the hardware wallet side. In the future,
5964 * we are looking forward to design such interface.
5966 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
5967 * to act, as liveness and breach reply correctness are always going to be hard requirements
5968 * of LN security model, orthogonal of key management issues.
5970 typedef struct LDKBaseSign {
5972 * An opaque pointer which is passed to your function implementations as an argument.
5973 * This has no meaning in the LDK, and can be NULL or any other value.
5977 * Gets the per-commitment point for a specific commitment number
5979 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
5981 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
5983 * Gets the commitment secret for a specific commitment number as part of the revocation process
5985 * An external signer implementation should error here if the commitment was already signed
5986 * and should refuse to sign it in the future.
5988 * May be called more than once for the same index.
5990 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
5992 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
5994 * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
5996 * This is required in order for the signer to make sure that releasing a commitment
5997 * secret won't leave us without a broadcastable holder transaction.
5998 * Policy checks should be implemented in this function, including checking the amount
5999 * sent to us and checking the HTLCs.
6001 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
6002 * A validating signer should ensure that an HTLC output is removed only when the matching
6003 * preimage is provided, or when the value to holder is restored.
6005 * NOTE: all the relevant preimages will be provided, but there may also be additional
6006 * irrelevant or duplicate preimages.
6008 struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_PaymentPreimageZ preimages);
6010 * Gets the holder's channel public keys and basepoints
6012 struct LDKChannelPublicKeys pubkeys;
6014 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
6015 * Note that this takes a pointer to this object, not the this_ptr like other methods do
6016 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
6018 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
6020 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
6021 * some SpendableOutputDescriptor types. This should be sufficient to identify this
6022 * Sign object uniquely and lookup or re-derive its keys.
6024 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
6026 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
6028 * Note that if signing fails or is rejected, the channel will be force-closed.
6030 * Policy checks should be implemented in this function, including checking the amount
6031 * sent to us and checking the HTLCs.
6033 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
6034 * A validating signer should ensure that an HTLC output is removed only when the matching
6035 * preimage is provided, or when the value to holder is restored.
6037 * NOTE: all the relevant preimages will be provided, but there may also be additional
6038 * irrelevant or duplicate preimages.
6040 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_PaymentPreimageZ preimages);
6042 * Validate the counterparty's revocation.
6044 * This is required in order for the signer to make sure that the state has moved
6045 * forward and it is safe to sign the next counterparty commitment.
6047 struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
6049 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
6050 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
6051 * latest commitment_tx when we initiate a force-close.
6052 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
6053 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
6055 * This may be called multiple times for the same transaction.
6057 * An external signer implementation should check that the commitment has not been revoked.
6059 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
6061 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
6063 * Create a signature for the given input in a transaction spending an HTLC transaction output
6064 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
6066 * A justice transaction may claim multiple outputs at the same time if timelocks are
6067 * similar, but only a signature for the input at index `input` should be signed for here.
6068 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
6069 * to an upcoming timelock expiration.
6071 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
6073 * per_commitment_key is revocation secret which was provided by our counterparty when they
6074 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
6075 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
6078 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]);
6080 * Create a signature for the given input in a transaction spending a commitment transaction
6081 * HTLC output when our counterparty broadcasts an old state.
6083 * A justice transaction may claim multiple outputs at the same time if timelocks are
6084 * similar, but only a signature for the input at index `input` should be signed for here.
6085 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
6086 * to an upcoming timelock expiration.
6088 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
6090 * per_commitment_key is revocation secret which was provided by our counterparty when they
6091 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
6092 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
6095 * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script
6096 * (which is committed to in the BIP 143 signatures).
6098 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);
6100 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
6101 * transaction, either offered or received.
6103 * Such a transaction may claim multiples offered outputs at same time if we know the
6104 * preimage for each when we create it, but only the input at index `input` should be
6105 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
6106 * needed with regards to an upcoming timelock expiration.
6108 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
6111 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
6113 * Per_commitment_point is the dynamic point corresponding to the channel state
6114 * detected onchain. It has been generated by our counterparty and is used to derive
6115 * channel state keys, which are then included in the witness script and committed to in the
6116 * BIP 143 signature.
6118 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);
6120 * Create a signature for a (proposed) closing transaction.
6122 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
6123 * chosen to forgo their output as dust.
6125 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
6127 * Signs a channel announcement message with our funding key and our node secret key (aka
6128 * node_id or network_key), proving it comes from one of the channel participants.
6130 * The first returned signature should be from our node secret key, the second from our
6133 * Note that if this fails or is rejected, the channel will not be publicly announced and
6134 * our counterparty may (though likely will not) close the channel on us for violating the
6137 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
6139 * Set the counterparty static channel data, including basepoints,
6140 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
6141 * This is done as soon as the funding outpoint is known. Since these are static channel data,
6142 * they MUST NOT be allowed to change to different values once set.
6144 * channel_parameters.is_populated() MUST be true.
6146 * We bind holder_selected_contest_delay late here for API convenience.
6148 * Will be called before any signatures are applied.
6150 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
6152 * Frees any resources associated with this object given its this_arg pointer.
6153 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6155 void (*free)(void *this_arg);
6159 * A cloneable signer.
6161 * Although we require signers to be cloneable, it may be useful for developers to be able to use
6162 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
6163 * which implies Sized, into this derived trait.
6165 typedef struct LDKSign {
6167 * An opaque pointer which is passed to your function implementations as an argument.
6168 * This has no meaning in the LDK, and can be NULL or any other value.
6172 * Implementation of BaseSign for this object.
6174 struct LDKBaseSign BaseSign;
6176 * Serialize the object into a byte array
6178 struct LDKCVec_u8Z (*write)(const void *this_arg);
6180 * Called, if set, after this Sign has been cloned into a duplicate object.
6181 * The new Sign is provided, and should be mutated as needed to perform a
6182 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
6184 void (*cloned)(struct LDKSign *NONNULL_PTR new_Sign);
6186 * Frees any resources associated with this object given its this_arg pointer.
6187 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6189 void (*free)(void *this_arg);
6193 * The contents of CResult_SignDecodeErrorZ
6195 typedef union LDKCResult_SignDecodeErrorZPtr {
6197 * A pointer to the contents in the success state.
6198 * Reading from this pointer when `result_ok` is not set is undefined.
6200 struct LDKSign *result;
6202 * A pointer to the contents in the error state.
6203 * Reading from this pointer when `result_ok` is set is undefined.
6205 struct LDKDecodeError *err;
6206 } LDKCResult_SignDecodeErrorZPtr;
6209 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
6210 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
6211 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6213 typedef struct LDKCResult_SignDecodeErrorZ {
6215 * The contents of this CResult_SignDecodeErrorZ, accessible via either
6216 * `err` or `result` depending on the state of `result_ok`.
6218 union LDKCResult_SignDecodeErrorZPtr contents;
6220 * Whether this CResult_SignDecodeErrorZ represents a success state.
6223 } LDKCResult_SignDecodeErrorZ;
6226 * Integer in the range `0..32`
6228 typedef struct LDKu5 {
6233 * A dynamically-allocated array of crate::c_types::u5s of arbitrary size.
6234 * This corresponds to std::vector in C++
6236 typedef struct LDKCVec_u5Z {
6238 * The elements in the array.
6239 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6243 * The number of elements pointed to by `data`.
6249 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
6250 * allows recovering the exact public key which created the signature given the message.
6252 typedef struct LDKRecoverableSignature {
6254 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
6257 uint8_t serialized_form[68];
6258 } LDKRecoverableSignature;
6261 * The contents of CResult_RecoverableSignatureNoneZ
6263 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
6265 * A pointer to the contents in the success state.
6266 * Reading from this pointer when `result_ok` is not set is undefined.
6268 struct LDKRecoverableSignature *result;
6270 * Note that this value is always NULL, as there are no contents in the Err variant
6273 } LDKCResult_RecoverableSignatureNoneZPtr;
6276 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
6277 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
6278 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6280 typedef struct LDKCResult_RecoverableSignatureNoneZ {
6282 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
6283 * `err` or `result` depending on the state of `result_ok`.
6285 union LDKCResult_RecoverableSignatureNoneZPtr contents;
6287 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
6290 } LDKCResult_RecoverableSignatureNoneZ;
6293 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
6294 * This corresponds to std::vector in C++
6296 typedef struct LDKCVec_CVec_u8ZZ {
6298 * The elements in the array.
6299 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6301 struct LDKCVec_u8Z *data;
6303 * The number of elements pointed to by `data`.
6306 } LDKCVec_CVec_u8ZZ;
6309 * The contents of CResult_CVec_CVec_u8ZZNoneZ
6311 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
6313 * A pointer to the contents in the success state.
6314 * Reading from this pointer when `result_ok` is not set is undefined.
6316 struct LDKCVec_CVec_u8ZZ *result;
6318 * Note that this value is always NULL, as there are no contents in the Err variant
6321 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
6324 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
6325 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
6326 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6328 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
6330 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
6331 * `err` or `result` depending on the state of `result_ok`.
6333 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
6335 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
6338 } LDKCResult_CVec_CVec_u8ZZNoneZ;
6343 * A simple implementation of Sign that just keeps the private keys in memory.
6345 * This implementation performs no policy checks and is insufficient by itself as
6346 * a secure external signer.
6348 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
6350 * A pointer to the opaque Rust object.
6351 * Nearly everywhere, inner must be non-null, however in places where
6352 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6354 LDKnativeInMemorySigner *inner;
6356 * Indicates that this is the only struct which contains the same pointer.
6357 * Rust functions which take ownership of an object provided via an argument require
6358 * this to be true and invalidate the object pointed to by inner.
6361 } LDKInMemorySigner;
6364 * The contents of CResult_InMemorySignerDecodeErrorZ
6366 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
6368 * A pointer to the contents in the success state.
6369 * Reading from this pointer when `result_ok` is not set is undefined.
6371 struct LDKInMemorySigner *result;
6373 * A pointer to the contents in the error state.
6374 * Reading from this pointer when `result_ok` is set is undefined.
6376 struct LDKDecodeError *err;
6377 } LDKCResult_InMemorySignerDecodeErrorZPtr;
6380 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
6381 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
6382 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6384 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
6386 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
6387 * `err` or `result` depending on the state of `result_ok`.
6389 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
6391 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
6394 } LDKCResult_InMemorySignerDecodeErrorZ;
6397 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
6398 * This corresponds to std::vector in C++
6400 typedef struct LDKCVec_TxOutZ {
6402 * The elements in the array.
6403 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6405 struct LDKTxOut *data;
6407 * The number of elements pointed to by `data`.
6413 * The contents of CResult_TransactionNoneZ
6415 typedef union LDKCResult_TransactionNoneZPtr {
6417 * A pointer to the contents in the success state.
6418 * Reading from this pointer when `result_ok` is not set is undefined.
6420 struct LDKTransaction *result;
6422 * Note that this value is always NULL, as there are no contents in the Err variant
6425 } LDKCResult_TransactionNoneZPtr;
6428 * A CResult_TransactionNoneZ represents the result of a fallible operation,
6429 * containing a crate::c_types::Transaction on success and a () on failure.
6430 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6432 typedef struct LDKCResult_TransactionNoneZ {
6434 * The contents of this CResult_TransactionNoneZ, accessible via either
6435 * `err` or `result` depending on the state of `result_ok`.
6437 union LDKCResult_TransactionNoneZPtr contents;
6439 * Whether this CResult_TransactionNoneZ represents a success state.
6442 } LDKCResult_TransactionNoneZ;
6447 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
6448 * on-chain transactions to ensure no loss of funds occurs.
6450 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
6451 * information and are actively monitoring the chain.
6453 * Pending Events or updated HTLCs which have not yet been read out by
6454 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
6455 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
6456 * gotten are fully handled before re-serializing the new state.
6458 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
6459 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
6460 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
6461 * returned block hash and the the current chain and then reconnecting blocks to get to the
6462 * best chain) upon deserializing the object!
6464 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
6466 * A pointer to the opaque Rust object.
6467 * Nearly everywhere, inner must be non-null, however in places where
6468 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6470 LDKnativeChannelMonitor *inner;
6472 * Indicates that this is the only struct which contains the same pointer.
6473 * Rust functions which take ownership of an object provided via an argument require
6474 * this to be true and invalidate the object pointed to by inner.
6477 } LDKChannelMonitor;
6480 * A tuple of 2 elements. See the individual fields for the types contained.
6482 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
6484 * The element at position 0
6486 struct LDKThirtyTwoBytes a;
6488 * The element at position 1
6490 struct LDKChannelMonitor b;
6491 } LDKC2Tuple_BlockHashChannelMonitorZ;
6494 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
6495 * This corresponds to std::vector in C++
6497 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
6499 * The elements in the array.
6500 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6502 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
6504 * The number of elements pointed to by `data`.
6507 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
6510 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
6512 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
6514 * A pointer to the contents in the success state.
6515 * Reading from this pointer when `result_ok` is not set is undefined.
6517 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
6519 * A pointer to the contents in the error state.
6520 * Reading from this pointer when `result_ok` is set is undefined.
6522 enum LDKIOError *err;
6523 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
6526 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
6527 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
6528 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6530 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
6532 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
6533 * `err` or `result` depending on the state of `result_ok`.
6535 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
6537 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
6540 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
6543 * An enum which can either contain a u16 or not
6545 typedef enum LDKCOption_u16Z_Tag {
6547 * When we're in this state, this COption_u16Z contains a u16
6549 LDKCOption_u16Z_Some,
6551 * When we're in this state, this COption_u16Z contains nothing
6553 LDKCOption_u16Z_None,
6555 * Must be last for serialization purposes
6557 LDKCOption_u16Z_Sentinel,
6558 } LDKCOption_u16Z_Tag;
6560 typedef struct LDKCOption_u16Z {
6561 LDKCOption_u16Z_Tag tag;
6570 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
6573 typedef enum LDKAPIError_Tag {
6575 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
6576 * are documented, but generally indicates some precondition of a function was violated.
6578 LDKAPIError_APIMisuseError,
6580 * Due to a high feerate, we were unable to complete the request.
6581 * For example, this may be returned if the feerate implies we cannot open a channel at the
6582 * requested value, but opening a larger channel would succeed.
6584 LDKAPIError_FeeRateTooHigh,
6586 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
6587 * too-many-hops, etc).
6589 LDKAPIError_RouteError,
6591 * We were unable to complete the request as the Channel required to do so is unable to
6592 * complete the request (or was not found). This can take many forms, including disconnected
6593 * peer, channel at capacity, channel shutting down, etc.
6595 LDKAPIError_ChannelUnavailable,
6597 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
6598 * attempted action to fail.
6600 LDKAPIError_MonitorUpdateFailed,
6602 * [`KeysInterface::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
6603 * with the channel counterparty as negotiated in [`InitFeatures`].
6605 * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
6606 * a channel or cooperatively close one with this peer (and will have to force-close instead).
6608 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
6609 * [`InitFeatures`]: crate::ln::features::InitFeatures
6611 LDKAPIError_IncompatibleShutdownScript,
6613 * Must be last for serialization purposes
6615 LDKAPIError_Sentinel,
6618 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
6620 * A human-readable error message
6623 } LDKAPIError_LDKAPIMisuseError_Body;
6625 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
6627 * A human-readable error message
6631 * The feerate which was too high.
6634 } LDKAPIError_LDKFeeRateTooHigh_Body;
6636 typedef struct LDKAPIError_LDKRouteError_Body {
6638 * A human-readable error message
6641 } LDKAPIError_LDKRouteError_Body;
6643 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
6645 * A human-readable error message
6648 } LDKAPIError_LDKChannelUnavailable_Body;
6650 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
6652 * The incompatible shutdown script.
6654 struct LDKShutdownScript script;
6655 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
6657 typedef struct MUST_USE_STRUCT LDKAPIError {
6658 LDKAPIError_Tag tag;
6660 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
6661 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
6662 LDKAPIError_LDKRouteError_Body route_error;
6663 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
6664 LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
6669 * The contents of CResult_NoneAPIErrorZ
6671 typedef union LDKCResult_NoneAPIErrorZPtr {
6673 * Note that this value is always NULL, as there are no contents in the OK variant
6677 * A pointer to the contents in the error state.
6678 * Reading from this pointer when `result_ok` is set is undefined.
6680 struct LDKAPIError *err;
6681 } LDKCResult_NoneAPIErrorZPtr;
6684 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
6685 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
6686 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6688 typedef struct LDKCResult_NoneAPIErrorZ {
6690 * The contents of this CResult_NoneAPIErrorZ, accessible via either
6691 * `err` or `result` depending on the state of `result_ok`.
6693 union LDKCResult_NoneAPIErrorZPtr contents;
6695 * Whether this CResult_NoneAPIErrorZ represents a success state.
6698 } LDKCResult_NoneAPIErrorZ;
6701 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
6702 * This corresponds to std::vector in C++
6704 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
6706 * The elements in the array.
6707 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6709 struct LDKCResult_NoneAPIErrorZ *data;
6711 * The number of elements pointed to by `data`.
6714 } LDKCVec_CResult_NoneAPIErrorZZ;
6717 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
6718 * This corresponds to std::vector in C++
6720 typedef struct LDKCVec_APIErrorZ {
6722 * The elements in the array.
6723 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6725 struct LDKAPIError *data;
6727 * The number of elements pointed to by `data`.
6730 } LDKCVec_APIErrorZ;
6733 * The contents of CResult__u832APIErrorZ
6735 typedef union LDKCResult__u832APIErrorZPtr {
6737 * A pointer to the contents in the success state.
6738 * Reading from this pointer when `result_ok` is not set is undefined.
6740 struct LDKThirtyTwoBytes *result;
6742 * A pointer to the contents in the error state.
6743 * Reading from this pointer when `result_ok` is set is undefined.
6745 struct LDKAPIError *err;
6746 } LDKCResult__u832APIErrorZPtr;
6749 * A CResult__u832APIErrorZ represents the result of a fallible operation,
6750 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
6751 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6753 typedef struct LDKCResult__u832APIErrorZ {
6755 * The contents of this CResult__u832APIErrorZ, accessible via either
6756 * `err` or `result` depending on the state of `result_ok`.
6758 union LDKCResult__u832APIErrorZPtr contents;
6760 * Whether this CResult__u832APIErrorZ represents a success state.
6763 } LDKCResult__u832APIErrorZ;
6766 * If a payment fails to send, it can be in one of several states. This enum is returned as the
6767 * Err() type describing which state the payment is in, see the description of individual enum
6770 typedef enum LDKPaymentSendFailure_Tag {
6772 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
6773 * send the payment at all. No channel state has been changed or messages sent to peers, and
6774 * once you've changed the parameter at error, you can freely retry the payment in full.
6776 LDKPaymentSendFailure_ParameterError,
6778 * A parameter in a single path which was passed to send_payment was invalid, preventing us
6779 * from attempting to send the payment at all. No channel state has been changed or messages
6780 * sent to peers, and once you've changed the parameter at error, you can freely retry the
6783 * The results here are ordered the same as the paths in the route object which was passed to
6786 LDKPaymentSendFailure_PathParameterError,
6788 * All paths which were attempted failed to send, with no channel state change taking place.
6789 * You can freely retry the payment in full (though you probably want to do so over different
6790 * paths than the ones selected).
6792 LDKPaymentSendFailure_AllFailedRetrySafe,
6794 * Some paths which were attempted failed to send, though possibly not all. At least some
6795 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
6796 * in over-/re-payment.
6798 * The results here are ordered the same as the paths in the route object which was passed to
6799 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
6800 * retried (though there is currently no API with which to do so).
6802 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
6803 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
6804 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
6805 * with the latest update_id.
6807 LDKPaymentSendFailure_PartialFailure,
6809 * Must be last for serialization purposes
6811 LDKPaymentSendFailure_Sentinel,
6812 } LDKPaymentSendFailure_Tag;
6814 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
6816 * The errors themselves, in the same order as the route hops.
6818 struct LDKCVec_CResult_NoneAPIErrorZZ results;
6820 * If some paths failed without irrevocably committing to the new HTLC(s), this will
6821 * contain a [`RouteParameters`] object which can be used to calculate a new route that
6822 * will pay all remaining unpaid balance.
6824 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
6826 struct LDKRouteParameters failed_paths_retry;
6828 * The payment id for the payment, which is now at least partially pending.
6830 struct LDKThirtyTwoBytes payment_id;
6831 } LDKPaymentSendFailure_LDKPartialFailure_Body;
6833 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
6834 LDKPaymentSendFailure_Tag tag;
6837 struct LDKAPIError parameter_error;
6840 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
6843 struct LDKCVec_APIErrorZ all_failed_retry_safe;
6845 LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
6847 } LDKPaymentSendFailure;
6850 * The contents of CResult_PaymentIdPaymentSendFailureZ
6852 typedef union LDKCResult_PaymentIdPaymentSendFailureZPtr {
6854 * A pointer to the contents in the success state.
6855 * Reading from this pointer when `result_ok` is not set is undefined.
6857 struct LDKThirtyTwoBytes *result;
6859 * A pointer to the contents in the error state.
6860 * Reading from this pointer when `result_ok` is set is undefined.
6862 struct LDKPaymentSendFailure *err;
6863 } LDKCResult_PaymentIdPaymentSendFailureZPtr;
6866 * A CResult_PaymentIdPaymentSendFailureZ represents the result of a fallible operation,
6867 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
6868 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6870 typedef struct LDKCResult_PaymentIdPaymentSendFailureZ {
6872 * The contents of this CResult_PaymentIdPaymentSendFailureZ, accessible via either
6873 * `err` or `result` depending on the state of `result_ok`.
6875 union LDKCResult_PaymentIdPaymentSendFailureZPtr contents;
6877 * Whether this CResult_PaymentIdPaymentSendFailureZ represents a success state.
6880 } LDKCResult_PaymentIdPaymentSendFailureZ;
6883 * The contents of CResult_NonePaymentSendFailureZ
6885 typedef union LDKCResult_NonePaymentSendFailureZPtr {
6887 * Note that this value is always NULL, as there are no contents in the OK variant
6891 * A pointer to the contents in the error state.
6892 * Reading from this pointer when `result_ok` is set is undefined.
6894 struct LDKPaymentSendFailure *err;
6895 } LDKCResult_NonePaymentSendFailureZPtr;
6898 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
6899 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
6900 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6902 typedef struct LDKCResult_NonePaymentSendFailureZ {
6904 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
6905 * `err` or `result` depending on the state of `result_ok`.
6907 union LDKCResult_NonePaymentSendFailureZPtr contents;
6909 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
6912 } LDKCResult_NonePaymentSendFailureZ;
6915 * A tuple of 2 elements. See the individual fields for the types contained.
6917 typedef struct LDKC2Tuple_PaymentHashPaymentIdZ {
6919 * The element at position 0
6921 struct LDKThirtyTwoBytes a;
6923 * The element at position 1
6925 struct LDKThirtyTwoBytes b;
6926 } LDKC2Tuple_PaymentHashPaymentIdZ;
6929 * The contents of CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ
6931 typedef union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr {
6933 * A pointer to the contents in the success state.
6934 * Reading from this pointer when `result_ok` is not set is undefined.
6936 struct LDKC2Tuple_PaymentHashPaymentIdZ *result;
6938 * A pointer to the contents in the error state.
6939 * Reading from this pointer when `result_ok` is set is undefined.
6941 struct LDKPaymentSendFailure *err;
6942 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr;
6945 * A CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents the result of a fallible operation,
6946 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentIdZ on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
6947 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6949 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ {
6951 * The contents of this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ, accessible via either
6952 * `err` or `result` depending on the state of `result_ok`.
6954 union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr contents;
6956 * Whether this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents a success state.
6959 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ;
6962 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
6963 * This corresponds to std::vector in C++
6965 typedef struct LDKCVec_ThirtyTwoBytesZ {
6967 * The elements in the array.
6968 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6970 struct LDKThirtyTwoBytes *data;
6972 * The number of elements pointed to by `data`.
6975 } LDKCVec_ThirtyTwoBytesZ;
6978 * A tuple of 2 elements. See the individual fields for the types contained.
6980 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
6982 * The element at position 0
6984 struct LDKThirtyTwoBytes a;
6986 * The element at position 1
6988 struct LDKThirtyTwoBytes b;
6989 } LDKC2Tuple_PaymentHashPaymentSecretZ;
6992 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ
6994 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
6996 * A pointer to the contents in the success state.
6997 * Reading from this pointer when `result_ok` is not set is undefined.
6999 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
7001 * Note that this value is always NULL, as there are no contents in the Err variant
7004 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr;
7007 * A CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents the result of a fallible operation,
7008 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a () on failure.
7009 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7011 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
7013 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ, accessible via either
7014 * `err` or `result` depending on the state of `result_ok`.
7016 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr contents;
7018 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents a success state.
7021 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ;
7024 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ
7026 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr {
7028 * A pointer to the contents in the success state.
7029 * Reading from this pointer when `result_ok` is not set is undefined.
7031 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
7033 * A pointer to the contents in the error state.
7034 * Reading from this pointer when `result_ok` is set is undefined.
7036 struct LDKAPIError *err;
7037 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr;
7040 * A CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents the result of a fallible operation,
7041 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a crate::lightning::util::errors::APIError on failure.
7042 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7044 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
7046 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ, accessible via either
7047 * `err` or `result` depending on the state of `result_ok`.
7049 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr contents;
7051 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents a success state.
7054 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ;
7057 * The contents of CResult_PaymentSecretNoneZ
7059 typedef union LDKCResult_PaymentSecretNoneZPtr {
7061 * A pointer to the contents in the success state.
7062 * Reading from this pointer when `result_ok` is not set is undefined.
7064 struct LDKThirtyTwoBytes *result;
7066 * Note that this value is always NULL, as there are no contents in the Err variant
7069 } LDKCResult_PaymentSecretNoneZPtr;
7072 * A CResult_PaymentSecretNoneZ represents the result of a fallible operation,
7073 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
7074 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7076 typedef struct LDKCResult_PaymentSecretNoneZ {
7078 * The contents of this CResult_PaymentSecretNoneZ, accessible via either
7079 * `err` or `result` depending on the state of `result_ok`.
7081 union LDKCResult_PaymentSecretNoneZPtr contents;
7083 * Whether this CResult_PaymentSecretNoneZ represents a success state.
7086 } LDKCResult_PaymentSecretNoneZ;
7089 * The contents of CResult_PaymentSecretAPIErrorZ
7091 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
7093 * A pointer to the contents in the success state.
7094 * Reading from this pointer when `result_ok` is not set is undefined.
7096 struct LDKThirtyTwoBytes *result;
7098 * A pointer to the contents in the error state.
7099 * Reading from this pointer when `result_ok` is set is undefined.
7101 struct LDKAPIError *err;
7102 } LDKCResult_PaymentSecretAPIErrorZPtr;
7105 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
7106 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7107 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7109 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
7111 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
7112 * `err` or `result` depending on the state of `result_ok`.
7114 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
7116 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
7119 } LDKCResult_PaymentSecretAPIErrorZ;
7122 * The contents of CResult_PaymentPreimageAPIErrorZ
7124 typedef union LDKCResult_PaymentPreimageAPIErrorZPtr {
7126 * A pointer to the contents in the success state.
7127 * Reading from this pointer when `result_ok` is not set is undefined.
7129 struct LDKThirtyTwoBytes *result;
7131 * A pointer to the contents in the error state.
7132 * Reading from this pointer when `result_ok` is set is undefined.
7134 struct LDKAPIError *err;
7135 } LDKCResult_PaymentPreimageAPIErrorZPtr;
7138 * A CResult_PaymentPreimageAPIErrorZ represents the result of a fallible operation,
7139 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7140 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7142 typedef struct LDKCResult_PaymentPreimageAPIErrorZ {
7144 * The contents of this CResult_PaymentPreimageAPIErrorZ, accessible via either
7145 * `err` or `result` depending on the state of `result_ok`.
7147 union LDKCResult_PaymentPreimageAPIErrorZPtr contents;
7149 * Whether this CResult_PaymentPreimageAPIErrorZ represents a success state.
7152 } LDKCResult_PaymentPreimageAPIErrorZ;
7157 * Information needed for constructing an invoice route hint for this channel.
7159 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
7161 * A pointer to the opaque Rust object.
7162 * Nearly everywhere, inner must be non-null, however in places where
7163 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7165 LDKnativeCounterpartyForwardingInfo *inner;
7167 * Indicates that this is the only struct which contains the same pointer.
7168 * Rust functions which take ownership of an object provided via an argument require
7169 * this to be true and invalidate the object pointed to by inner.
7172 } LDKCounterpartyForwardingInfo;
7175 * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
7177 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
7179 * A pointer to the contents in the success state.
7180 * Reading from this pointer when `result_ok` is not set is undefined.
7182 struct LDKCounterpartyForwardingInfo *result;
7184 * A pointer to the contents in the error state.
7185 * Reading from this pointer when `result_ok` is set is undefined.
7187 struct LDKDecodeError *err;
7188 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
7191 * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
7192 * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7193 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7195 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
7197 * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
7198 * `err` or `result` depending on the state of `result_ok`.
7200 union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
7202 * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
7205 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
7210 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
7211 * to better separate parameters.
7213 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
7215 * A pointer to the opaque Rust object.
7216 * Nearly everywhere, inner must be non-null, however in places where
7217 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7219 LDKnativeChannelCounterparty *inner;
7221 * Indicates that this is the only struct which contains the same pointer.
7222 * Rust functions which take ownership of an object provided via an argument require
7223 * this to be true and invalidate the object pointed to by inner.
7226 } LDKChannelCounterparty;
7229 * The contents of CResult_ChannelCounterpartyDecodeErrorZ
7231 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
7233 * A pointer to the contents in the success state.
7234 * Reading from this pointer when `result_ok` is not set is undefined.
7236 struct LDKChannelCounterparty *result;
7238 * A pointer to the contents in the error state.
7239 * Reading from this pointer when `result_ok` is set is undefined.
7241 struct LDKDecodeError *err;
7242 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
7245 * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
7246 * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
7247 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7249 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
7251 * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
7252 * `err` or `result` depending on the state of `result_ok`.
7254 union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
7256 * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
7259 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
7262 * The contents of CResult_ChannelDetailsDecodeErrorZ
7264 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
7266 * A pointer to the contents in the success state.
7267 * Reading from this pointer when `result_ok` is not set is undefined.
7269 struct LDKChannelDetails *result;
7271 * A pointer to the contents in the error state.
7272 * Reading from this pointer when `result_ok` is set is undefined.
7274 struct LDKDecodeError *err;
7275 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
7278 * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
7279 * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
7280 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7282 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
7284 * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
7285 * `err` or `result` depending on the state of `result_ok`.
7287 union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
7289 * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
7292 } LDKCResult_ChannelDetailsDecodeErrorZ;
7297 * Route hints used in constructing invoices for [phantom node payents].
7299 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
7301 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
7303 * A pointer to the opaque Rust object.
7304 * Nearly everywhere, inner must be non-null, however in places where
7305 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7307 LDKnativePhantomRouteHints *inner;
7309 * Indicates that this is the only struct which contains the same pointer.
7310 * Rust functions which take ownership of an object provided via an argument require
7311 * this to be true and invalidate the object pointed to by inner.
7314 } LDKPhantomRouteHints;
7317 * The contents of CResult_PhantomRouteHintsDecodeErrorZ
7319 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
7321 * A pointer to the contents in the success state.
7322 * Reading from this pointer when `result_ok` is not set is undefined.
7324 struct LDKPhantomRouteHints *result;
7326 * A pointer to the contents in the error state.
7327 * Reading from this pointer when `result_ok` is set is undefined.
7329 struct LDKDecodeError *err;
7330 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
7333 * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
7334 * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
7335 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7337 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
7339 * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
7340 * `err` or `result` depending on the state of `result_ok`.
7342 union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
7344 * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
7347 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
7350 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
7351 * This corresponds to std::vector in C++
7353 typedef struct LDKCVec_ChannelMonitorZ {
7355 * The elements in the array.
7356 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7358 struct LDKChannelMonitor *data;
7360 * The number of elements pointed to by `data`.
7363 } LDKCVec_ChannelMonitorZ;
7368 * An update generated by the underlying Channel itself which contains some new information the
7369 * ChannelMonitor should be made aware of.
7371 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
7373 * A pointer to the opaque Rust object.
7374 * Nearly everywhere, inner must be non-null, however in places where
7375 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7377 LDKnativeChannelMonitorUpdate *inner;
7379 * Indicates that this is the only struct which contains the same pointer.
7380 * Rust functions which take ownership of an object provided via an argument require
7381 * this to be true and invalidate the object pointed to by inner.
7384 } LDKChannelMonitorUpdate;
7387 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
7388 * blocks are connected and disconnected.
7390 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
7391 * responsible for maintaining a set of monitors such that they can be updated accordingly as
7392 * channel state changes and HTLCs are resolved. See method documentation for specific
7395 * Implementations **must** ensure that updates are successfully applied and persisted upon method
7396 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
7397 * without taking any further action such as persisting the current state.
7399 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
7400 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
7401 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
7402 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
7403 * multiple instances.
7405 * [`PermanentFailure`]: ChannelMonitorUpdateErr::PermanentFailure
7407 typedef struct LDKWatch {
7409 * An opaque pointer which is passed to your function implementations as an argument.
7410 * This has no meaning in the LDK, and can be NULL or any other value.
7414 * Watches a channel identified by `funding_txo` using `monitor`.
7416 * Implementations are responsible for watching the chain for the funding transaction along
7417 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
7418 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
7420 * Note: this interface MUST error with `ChannelMonitorUpdateErr::PermanentFailure` if
7421 * the given `funding_txo` has previously been registered via `watch_channel`.
7423 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
7424 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
7425 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
7427 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
7429 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
7431 * Implementations must call [`update_monitor`] with the given update. See
7432 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
7434 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
7436 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
7438 * Returns any monitor events since the last call. Subsequent calls must only return new
7441 * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
7442 * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
7445 * For details on asynchronous [`ChannelMonitor`] updating and returning
7446 * [`MonitorEvent::UpdateCompleted`] here, see [`ChannelMonitorUpdateErr::TemporaryFailure`].
7448 struct LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ (*release_pending_monitor_events)(const void *this_arg);
7450 * Frees any resources associated with this object given its this_arg pointer.
7451 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7453 void (*free)(void *this_arg);
7457 * An interface to send a transaction to the Bitcoin network.
7459 typedef struct LDKBroadcasterInterface {
7461 * An opaque pointer which is passed to your function implementations as an argument.
7462 * This has no meaning in the LDK, and can be NULL or any other value.
7466 * Sends a transaction out to (hopefully) be mined.
7468 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
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);
7474 } LDKBroadcasterInterface;
7477 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
7478 * own the memory pointed to by data.
7480 typedef struct LDKu8slice {
7482 * A pointer to the byte buffer
7484 const uint8_t *data;
7486 * The number of bytes pointed to by `data`.
7492 * A trait to describe an object which can get user secrets and key material.
7494 typedef struct LDKKeysInterface {
7496 * An opaque pointer which is passed to your function implementations as an argument.
7497 * This has no meaning in the LDK, and can be NULL or any other value.
7501 * Get node secret key based on the provided [`Recipient`].
7503 * The node_id/network_key is the public key that corresponds to this secret key.
7505 * This method must return the same value each time it is called with a given `Recipient`
7508 struct LDKCResult_SecretKeyNoneZ (*get_node_secret)(const void *this_arg, enum LDKRecipient recipient);
7510 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
7512 * This method should return a different value each time it is called, to avoid linking
7513 * on-chain funds across channels as controlled to the same user.
7515 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
7517 * Get a script pubkey which we will send funds to when closing a channel.
7519 * This method should return a different value each time it is called, to avoid linking
7520 * on-chain funds across channels as controlled to the same user.
7522 struct LDKShutdownScript (*get_shutdown_scriptpubkey)(const void *this_arg);
7524 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
7525 * restarted with some stale data!
7527 * This method must return a different value each time it is called.
7529 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
7531 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
7532 * onion packets and for temporary channel IDs. There is no requirement that these be
7533 * persisted anywhere, though they must be unique across restarts.
7535 * This method must return a different value each time it is called.
7537 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
7539 * Reads a `Signer` for this `KeysInterface` from the given input stream.
7540 * This is only called during deserialization of other objects which contain
7541 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
7542 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
7543 * contain no versioning scheme. You may wish to include your own version prefix and ensure
7544 * you've read all of the provided bytes to ensure no corruption occurred.
7546 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
7549 * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
7550 * this trait to parse the invoice and make sure they're signing what they expect, rather than
7551 * blindly signing the hash.
7552 * The hrp is ascii bytes, while the invoice data is base32.
7554 * The secret key used to sign the invoice is dependent on the [`Recipient`].
7556 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z invoice_data, enum LDKRecipient receipient);
7558 * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
7560 * If the implementor of this trait supports [phantom node payments], then every node that is
7561 * intended to be included in the phantom invoice route hints must return the same value from
7564 * This method must return the same value each time it is called.
7566 * [phantom node payments]: PhantomKeysManager
7568 struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
7570 * Frees any resources associated with this object given its this_arg pointer.
7571 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7573 void (*free)(void *this_arg);
7577 * A trait which should be implemented to provide feerate information on a number of time
7580 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
7581 * called from inside the library in response to chain events, P2P events, or timer events).
7583 typedef struct LDKFeeEstimator {
7585 * An opaque pointer which is passed to your function implementations as an argument.
7586 * This has no meaning in the LDK, and can be NULL or any other value.
7590 * Gets estimated satoshis of fee required per 1000 Weight-Units.
7592 * Must return a value no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later
7593 * round-downs don't put us below 1 satoshi-per-byte).
7595 * This method can be implemented with the following unit conversions:
7596 * * max(satoshis-per-byte * 250, 253)
7597 * * max(satoshis-per-kbyte / 4, 253)
7599 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
7601 * Frees any resources associated with this object given its this_arg pointer.
7602 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7604 void (*free)(void *this_arg);
7610 * Manager which keeps track of a number of channels and sends messages to the appropriate
7611 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
7613 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
7614 * to individual Channels.
7616 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
7617 * all peers during write/read (though does not modify this instance, only the instance being
7618 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
7619 * called funding_transaction_generated for outbound channels).
7621 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
7622 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
7623 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
7624 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
7625 * the serialization process). If the deserialized version is out-of-date compared to the
7626 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
7627 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
7629 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
7630 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
7631 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
7632 * block_connected() to step towards your best block) upon deserialization before using the
7635 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
7636 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
7637 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
7638 * offline for a full minute. In order to track this, you must call
7639 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
7641 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
7642 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
7643 * essentially you should default to using a SimpleRefChannelManager, and use a
7644 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
7645 * you're using lightning-net-tokio.
7647 typedef struct MUST_USE_STRUCT LDKChannelManager {
7649 * A pointer to the opaque Rust object.
7650 * Nearly everywhere, inner must be non-null, however in places where
7651 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7653 LDKnativeChannelManager *inner;
7655 * Indicates that this is the only struct which contains the same pointer.
7656 * Rust functions which take ownership of an object provided via an argument require
7657 * this to be true and invalidate the object pointed to by inner.
7660 } LDKChannelManager;
7663 * A tuple of 2 elements. See the individual fields for the types contained.
7665 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
7667 * The element at position 0
7669 struct LDKThirtyTwoBytes a;
7671 * The element at position 1
7673 struct LDKChannelManager b;
7674 } LDKC2Tuple_BlockHashChannelManagerZ;
7677 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
7679 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
7681 * A pointer to the contents in the success state.
7682 * Reading from this pointer when `result_ok` is not set is undefined.
7684 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
7686 * A pointer to the contents in the error state.
7687 * Reading from this pointer when `result_ok` is set is undefined.
7689 struct LDKDecodeError *err;
7690 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
7693 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
7694 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
7695 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7697 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
7699 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
7700 * `err` or `result` depending on the state of `result_ok`.
7702 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
7704 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
7707 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
7712 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
7713 * with our counterparty.
7715 typedef struct MUST_USE_STRUCT LDKChannelConfig {
7717 * A pointer to the opaque Rust object.
7718 * Nearly everywhere, inner must be non-null, however in places where
7719 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7721 LDKnativeChannelConfig *inner;
7723 * Indicates that this is the only struct which contains the same pointer.
7724 * Rust functions which take ownership of an object provided via an argument require
7725 * this to be true and invalidate the object pointed to by inner.
7731 * The contents of CResult_ChannelConfigDecodeErrorZ
7733 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
7735 * A pointer to the contents in the success state.
7736 * Reading from this pointer when `result_ok` is not set is undefined.
7738 struct LDKChannelConfig *result;
7740 * A pointer to the contents in the error state.
7741 * Reading from this pointer when `result_ok` is set is undefined.
7743 struct LDKDecodeError *err;
7744 } LDKCResult_ChannelConfigDecodeErrorZPtr;
7747 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
7748 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
7749 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7751 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
7753 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
7754 * `err` or `result` depending on the state of `result_ok`.
7756 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
7758 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
7761 } LDKCResult_ChannelConfigDecodeErrorZ;
7764 * The contents of CResult_OutPointDecodeErrorZ
7766 typedef union LDKCResult_OutPointDecodeErrorZPtr {
7768 * A pointer to the contents in the success state.
7769 * Reading from this pointer when `result_ok` is not set is undefined.
7771 struct LDKOutPoint *result;
7773 * A pointer to the contents in the error state.
7774 * Reading from this pointer when `result_ok` is set is undefined.
7776 struct LDKDecodeError *err;
7777 } LDKCResult_OutPointDecodeErrorZPtr;
7780 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
7781 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
7782 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7784 typedef struct LDKCResult_OutPointDecodeErrorZ {
7786 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
7787 * `err` or `result` depending on the state of `result_ok`.
7789 union LDKCResult_OutPointDecodeErrorZPtr contents;
7791 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
7794 } LDKCResult_OutPointDecodeErrorZ;
7797 * Defines a type identifier for sending messages over the wire.
7799 * Messages implementing this trait specify a type and must be [`Writeable`].
7801 typedef struct LDKType {
7803 * An opaque pointer which is passed to your function implementations as an argument.
7804 * This has no meaning in the LDK, and can be NULL or any other value.
7808 * Returns the type identifying the message payload.
7810 uint16_t (*type_id)(const void *this_arg);
7812 * Return a human-readable "debug" string describing this object
7814 struct LDKStr (*debug_str)(const void *this_arg);
7816 * Serialize the object into a byte array
7818 struct LDKCVec_u8Z (*write)(const void *this_arg);
7820 * Frees any resources associated with this object given its this_arg pointer.
7821 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7823 void (*free)(void *this_arg);
7827 * An enum which can either contain a crate::lightning::ln::wire::Type or not
7829 typedef enum LDKCOption_TypeZ_Tag {
7831 * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
7833 LDKCOption_TypeZ_Some,
7835 * When we're in this state, this COption_TypeZ contains nothing
7837 LDKCOption_TypeZ_None,
7839 * Must be last for serialization purposes
7841 LDKCOption_TypeZ_Sentinel,
7842 } LDKCOption_TypeZ_Tag;
7844 typedef struct LDKCOption_TypeZ {
7845 LDKCOption_TypeZ_Tag tag;
7848 struct LDKType some;
7854 * The contents of CResult_COption_TypeZDecodeErrorZ
7856 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
7858 * A pointer to the contents in the success state.
7859 * Reading from this pointer when `result_ok` is not set is undefined.
7861 struct LDKCOption_TypeZ *result;
7863 * A pointer to the contents in the error state.
7864 * Reading from this pointer when `result_ok` is set is undefined.
7866 struct LDKDecodeError *err;
7867 } LDKCResult_COption_TypeZDecodeErrorZPtr;
7870 * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
7871 * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
7872 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7874 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
7876 * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
7877 * `err` or `result` depending on the state of `result_ok`.
7879 union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
7881 * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
7884 } LDKCResult_COption_TypeZDecodeErrorZ;
7887 * An error that may occur when making a payment.
7889 typedef enum LDKPaymentError_Tag {
7891 * An error resulting from the provided [`Invoice`] or payment hash.
7893 LDKPaymentError_Invoice,
7895 * An error occurring when finding a route.
7897 LDKPaymentError_Routing,
7899 * An error occurring when sending a payment.
7901 LDKPaymentError_Sending,
7903 * Must be last for serialization purposes
7905 LDKPaymentError_Sentinel,
7906 } LDKPaymentError_Tag;
7908 typedef struct MUST_USE_STRUCT LDKPaymentError {
7909 LDKPaymentError_Tag tag;
7912 struct LDKStr invoice;
7915 struct LDKLightningError routing;
7918 struct LDKPaymentSendFailure sending;
7924 * The contents of CResult_PaymentIdPaymentErrorZ
7926 typedef union LDKCResult_PaymentIdPaymentErrorZPtr {
7928 * A pointer to the contents in the success state.
7929 * Reading from this pointer when `result_ok` is not set is undefined.
7931 struct LDKThirtyTwoBytes *result;
7933 * A pointer to the contents in the error state.
7934 * Reading from this pointer when `result_ok` is set is undefined.
7936 struct LDKPaymentError *err;
7937 } LDKCResult_PaymentIdPaymentErrorZPtr;
7940 * A CResult_PaymentIdPaymentErrorZ represents the result of a fallible operation,
7941 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning_invoice::payment::PaymentError on failure.
7942 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7944 typedef struct LDKCResult_PaymentIdPaymentErrorZ {
7946 * The contents of this CResult_PaymentIdPaymentErrorZ, accessible via either
7947 * `err` or `result` depending on the state of `result_ok`.
7949 union LDKCResult_PaymentIdPaymentErrorZPtr contents;
7951 * Whether this CResult_PaymentIdPaymentErrorZ represents a success state.
7954 } LDKCResult_PaymentIdPaymentErrorZ;
7957 * Sub-errors which don't have specific information in them use this type.
7959 typedef struct LDKError {
7961 * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
7967 * Errors that indicate what is wrong with the invoice. They have some granularity for debug
7968 * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
7970 typedef enum LDKParseError_Tag {
7971 LDKParseError_Bech32Error,
7972 LDKParseError_ParseAmountError,
7973 LDKParseError_MalformedSignature,
7974 LDKParseError_BadPrefix,
7975 LDKParseError_UnknownCurrency,
7976 LDKParseError_UnknownSiPrefix,
7977 LDKParseError_MalformedHRP,
7978 LDKParseError_TooShortDataPart,
7979 LDKParseError_UnexpectedEndOfTaggedFields,
7980 LDKParseError_DescriptionDecodeError,
7981 LDKParseError_PaddingError,
7982 LDKParseError_IntegerOverflowError,
7983 LDKParseError_InvalidSegWitProgramLength,
7984 LDKParseError_InvalidPubKeyHashLength,
7985 LDKParseError_InvalidScriptHashLength,
7986 LDKParseError_InvalidRecoveryId,
7987 LDKParseError_InvalidSliceLength,
7989 * Not an error, but used internally to signal that a part of the invoice should be ignored
7990 * according to BOLT11
7994 * Must be last for serialization purposes
7996 LDKParseError_Sentinel,
7997 } LDKParseError_Tag;
7999 typedef struct MUST_USE_STRUCT LDKParseError {
8000 LDKParseError_Tag tag;
8003 struct LDKBech32Error bech32_error;
8006 struct LDKError parse_amount_error;
8009 enum LDKSecp256k1Error malformed_signature;
8012 struct LDKError description_decode_error;
8015 struct LDKStr invalid_slice_length;
8021 * The contents of CResult_SiPrefixParseErrorZ
8023 typedef union LDKCResult_SiPrefixParseErrorZPtr {
8025 * A pointer to the contents in the success state.
8026 * Reading from this pointer when `result_ok` is not set is undefined.
8028 enum LDKSiPrefix *result;
8030 * A pointer to the contents in the error state.
8031 * Reading from this pointer when `result_ok` is set is undefined.
8033 struct LDKParseError *err;
8034 } LDKCResult_SiPrefixParseErrorZPtr;
8037 * A CResult_SiPrefixParseErrorZ represents the result of a fallible operation,
8038 * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::ParseError on failure.
8039 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8041 typedef struct LDKCResult_SiPrefixParseErrorZ {
8043 * The contents of this CResult_SiPrefixParseErrorZ, accessible via either
8044 * `err` or `result` depending on the state of `result_ok`.
8046 union LDKCResult_SiPrefixParseErrorZPtr contents;
8048 * Whether this CResult_SiPrefixParseErrorZ represents a success state.
8051 } LDKCResult_SiPrefixParseErrorZ;
8056 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
8058 * There are three ways to construct an `Invoice`:
8059 * 1. using `InvoiceBuilder`
8060 * 2. using `Invoice::from_signed(SignedRawInvoice)`
8061 * 3. using `str::parse::<Invoice>(&str)`
8063 typedef struct MUST_USE_STRUCT LDKInvoice {
8065 * A pointer to the opaque Rust object.
8066 * Nearly everywhere, inner must be non-null, however in places where
8067 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8069 LDKnativeInvoice *inner;
8071 * Indicates that this is the only struct which contains the same pointer.
8072 * Rust functions which take ownership of an object provided via an argument require
8073 * this to be true and invalidate the object pointed to by inner.
8079 * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
8080 * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
8081 * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
8083 typedef enum LDKParseOrSemanticError_Tag {
8085 * The invoice couldn't be decoded
8087 LDKParseOrSemanticError_ParseError,
8089 * The invoice could be decoded but violates the BOLT11 standard
8091 LDKParseOrSemanticError_SemanticError,
8093 * Must be last for serialization purposes
8095 LDKParseOrSemanticError_Sentinel,
8096 } LDKParseOrSemanticError_Tag;
8098 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
8099 LDKParseOrSemanticError_Tag tag;
8102 struct LDKParseError parse_error;
8105 enum LDKSemanticError semantic_error;
8108 } LDKParseOrSemanticError;
8111 * The contents of CResult_InvoiceParseOrSemanticErrorZ
8113 typedef union LDKCResult_InvoiceParseOrSemanticErrorZPtr {
8115 * A pointer to the contents in the success state.
8116 * Reading from this pointer when `result_ok` is not set is undefined.
8118 struct LDKInvoice *result;
8120 * A pointer to the contents in the error state.
8121 * Reading from this pointer when `result_ok` is set is undefined.
8123 struct LDKParseOrSemanticError *err;
8124 } LDKCResult_InvoiceParseOrSemanticErrorZPtr;
8127 * A CResult_InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
8128 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
8129 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8131 typedef struct LDKCResult_InvoiceParseOrSemanticErrorZ {
8133 * The contents of this CResult_InvoiceParseOrSemanticErrorZ, accessible via either
8134 * `err` or `result` depending on the state of `result_ok`.
8136 union LDKCResult_InvoiceParseOrSemanticErrorZPtr contents;
8138 * Whether this CResult_InvoiceParseOrSemanticErrorZ represents a success state.
8141 } LDKCResult_InvoiceParseOrSemanticErrorZ;
8146 * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
8150 * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
8152 typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
8154 * A pointer to the opaque Rust object.
8155 * Nearly everywhere, inner must be non-null, however in places where
8156 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8158 LDKnativeSignedRawInvoice *inner;
8160 * Indicates that this is the only struct which contains the same pointer.
8161 * Rust functions which take ownership of an object provided via an argument require
8162 * this to be true and invalidate the object pointed to by inner.
8165 } LDKSignedRawInvoice;
8168 * The contents of CResult_SignedRawInvoiceParseErrorZ
8170 typedef union LDKCResult_SignedRawInvoiceParseErrorZPtr {
8172 * A pointer to the contents in the success state.
8173 * Reading from this pointer when `result_ok` is not set is undefined.
8175 struct LDKSignedRawInvoice *result;
8177 * A pointer to the contents in the error state.
8178 * Reading from this pointer when `result_ok` is set is undefined.
8180 struct LDKParseError *err;
8181 } LDKCResult_SignedRawInvoiceParseErrorZPtr;
8184 * A CResult_SignedRawInvoiceParseErrorZ represents the result of a fallible operation,
8185 * containing a crate::lightning_invoice::SignedRawInvoice on success and a crate::lightning_invoice::ParseError on failure.
8186 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8188 typedef struct LDKCResult_SignedRawInvoiceParseErrorZ {
8190 * The contents of this CResult_SignedRawInvoiceParseErrorZ, accessible via either
8191 * `err` or `result` depending on the state of `result_ok`.
8193 union LDKCResult_SignedRawInvoiceParseErrorZPtr contents;
8195 * Whether this CResult_SignedRawInvoiceParseErrorZ represents a success state.
8198 } LDKCResult_SignedRawInvoiceParseErrorZ;
8203 * Represents an syntactically correct Invoice for a payment on the lightning network,
8204 * but without the signature information.
8205 * De- and encoding should not lead to information loss but may lead to different hashes.
8207 * For methods without docs see the corresponding methods in `Invoice`.
8209 typedef struct MUST_USE_STRUCT LDKRawInvoice {
8211 * A pointer to the opaque Rust object.
8212 * Nearly everywhere, inner must be non-null, however in places where
8213 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8215 LDKnativeRawInvoice *inner;
8217 * Indicates that this is the only struct which contains the same pointer.
8218 * Rust functions which take ownership of an object provided via an argument require
8219 * this to be true and invalidate the object pointed to by inner.
8227 * Recoverable signature
8229 typedef struct MUST_USE_STRUCT LDKInvoiceSignature {
8231 * A pointer to the opaque Rust object.
8232 * Nearly everywhere, inner must be non-null, however in places where
8233 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8235 LDKnativeInvoiceSignature *inner;
8237 * Indicates that this is the only struct which contains the same pointer.
8238 * Rust functions which take ownership of an object provided via an argument require
8239 * this to be true and invalidate the object pointed to by inner.
8242 } LDKInvoiceSignature;
8245 * A tuple of 3 elements. See the individual fields for the types contained.
8247 typedef struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ {
8249 * The element at position 0
8251 struct LDKRawInvoice a;
8253 * The element at position 1
8255 struct LDKThirtyTwoBytes b;
8257 * The element at position 2
8259 struct LDKInvoiceSignature c;
8260 } LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ;
8267 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
8269 * A pointer to the opaque Rust object.
8270 * Nearly everywhere, inner must be non-null, however in places where
8271 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8273 LDKnativePayeePubKey *inner;
8275 * Indicates that this is the only struct which contains the same pointer.
8276 * Rust functions which take ownership of an object provided via an argument require
8277 * this to be true and invalidate the object pointed to by inner.
8283 * The contents of CResult_PayeePubKeyErrorZ
8285 typedef union LDKCResult_PayeePubKeyErrorZPtr {
8287 * A pointer to the contents in the success state.
8288 * Reading from this pointer when `result_ok` is not set is undefined.
8290 struct LDKPayeePubKey *result;
8292 * A pointer to the contents in the error state.
8293 * Reading from this pointer when `result_ok` is set is undefined.
8295 enum LDKSecp256k1Error *err;
8296 } LDKCResult_PayeePubKeyErrorZPtr;
8299 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
8300 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
8301 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8303 typedef struct LDKCResult_PayeePubKeyErrorZ {
8305 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
8306 * `err` or `result` depending on the state of `result_ok`.
8308 union LDKCResult_PayeePubKeyErrorZPtr contents;
8310 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
8313 } LDKCResult_PayeePubKeyErrorZ;
8318 * Private routing information
8321 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
8324 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
8326 * A pointer to the opaque Rust object.
8327 * Nearly everywhere, inner must be non-null, however in places where
8328 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8330 LDKnativePrivateRoute *inner;
8332 * Indicates that this is the only struct which contains the same pointer.
8333 * Rust functions which take ownership of an object provided via an argument require
8334 * this to be true and invalidate the object pointed to by inner.
8340 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
8341 * This corresponds to std::vector in C++
8343 typedef struct LDKCVec_PrivateRouteZ {
8345 * The elements in the array.
8346 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8348 struct LDKPrivateRoute *data;
8350 * The number of elements pointed to by `data`.
8353 } LDKCVec_PrivateRouteZ;
8358 * A timestamp that refers to a date after 1 January 1970.
8362 * The Unix timestamp representing the stored time has to be positive and no greater than
8363 * [`MAX_TIMESTAMP`].
8365 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
8367 * A pointer to the opaque Rust object.
8368 * Nearly everywhere, inner must be non-null, however in places where
8369 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8371 LDKnativePositiveTimestamp *inner;
8373 * Indicates that this is the only struct which contains the same pointer.
8374 * Rust functions which take ownership of an object provided via an argument require
8375 * this to be true and invalidate the object pointed to by inner.
8378 } LDKPositiveTimestamp;
8381 * The contents of CResult_PositiveTimestampCreationErrorZ
8383 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
8385 * A pointer to the contents in the success state.
8386 * Reading from this pointer when `result_ok` is not set is undefined.
8388 struct LDKPositiveTimestamp *result;
8390 * A pointer to the contents in the error state.
8391 * Reading from this pointer when `result_ok` is set is undefined.
8393 enum LDKCreationError *err;
8394 } LDKCResult_PositiveTimestampCreationErrorZPtr;
8397 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
8398 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
8399 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8401 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
8403 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
8404 * `err` or `result` depending on the state of `result_ok`.
8406 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
8408 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
8411 } LDKCResult_PositiveTimestampCreationErrorZ;
8414 * The contents of CResult_NoneSemanticErrorZ
8416 typedef union LDKCResult_NoneSemanticErrorZPtr {
8418 * Note that this value is always NULL, as there are no contents in the OK variant
8422 * A pointer to the contents in the error state.
8423 * Reading from this pointer when `result_ok` is set is undefined.
8425 enum LDKSemanticError *err;
8426 } LDKCResult_NoneSemanticErrorZPtr;
8429 * A CResult_NoneSemanticErrorZ represents the result of a fallible operation,
8430 * containing a () on success and a crate::lightning_invoice::SemanticError on failure.
8431 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8433 typedef struct LDKCResult_NoneSemanticErrorZ {
8435 * The contents of this CResult_NoneSemanticErrorZ, accessible via either
8436 * `err` or `result` depending on the state of `result_ok`.
8438 union LDKCResult_NoneSemanticErrorZPtr contents;
8440 * Whether this CResult_NoneSemanticErrorZ represents a success state.
8443 } LDKCResult_NoneSemanticErrorZ;
8446 * The contents of CResult_InvoiceSemanticErrorZ
8448 typedef union LDKCResult_InvoiceSemanticErrorZPtr {
8450 * A pointer to the contents in the success state.
8451 * Reading from this pointer when `result_ok` is not set is undefined.
8453 struct LDKInvoice *result;
8455 * A pointer to the contents in the error state.
8456 * Reading from this pointer when `result_ok` is set is undefined.
8458 enum LDKSemanticError *err;
8459 } LDKCResult_InvoiceSemanticErrorZPtr;
8462 * A CResult_InvoiceSemanticErrorZ represents the result of a fallible operation,
8463 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SemanticError on failure.
8464 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8466 typedef struct LDKCResult_InvoiceSemanticErrorZ {
8468 * The contents of this CResult_InvoiceSemanticErrorZ, accessible via either
8469 * `err` or `result` depending on the state of `result_ok`.
8471 union LDKCResult_InvoiceSemanticErrorZPtr contents;
8473 * Whether this CResult_InvoiceSemanticErrorZ represents a success state.
8476 } LDKCResult_InvoiceSemanticErrorZ;
8481 * Description string
8484 * The description can be at most 639 __bytes__ long
8486 typedef struct MUST_USE_STRUCT LDKDescription {
8488 * A pointer to the opaque Rust object.
8489 * Nearly everywhere, inner must be non-null, however in places where
8490 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8492 LDKnativeDescription *inner;
8494 * Indicates that this is the only struct which contains the same pointer.
8495 * Rust functions which take ownership of an object provided via an argument require
8496 * this to be true and invalidate the object pointed to by inner.
8502 * The contents of CResult_DescriptionCreationErrorZ
8504 typedef union LDKCResult_DescriptionCreationErrorZPtr {
8506 * A pointer to the contents in the success state.
8507 * Reading from this pointer when `result_ok` is not set is undefined.
8509 struct LDKDescription *result;
8511 * A pointer to the contents in the error state.
8512 * Reading from this pointer when `result_ok` is set is undefined.
8514 enum LDKCreationError *err;
8515 } LDKCResult_DescriptionCreationErrorZPtr;
8518 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
8519 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
8520 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8522 typedef struct LDKCResult_DescriptionCreationErrorZ {
8524 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
8525 * `err` or `result` depending on the state of `result_ok`.
8527 union LDKCResult_DescriptionCreationErrorZPtr contents;
8529 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
8532 } LDKCResult_DescriptionCreationErrorZ;
8535 * The contents of CResult_PrivateRouteCreationErrorZ
8537 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
8539 * A pointer to the contents in the success state.
8540 * Reading from this pointer when `result_ok` is not set is undefined.
8542 struct LDKPrivateRoute *result;
8544 * A pointer to the contents in the error state.
8545 * Reading from this pointer when `result_ok` is set is undefined.
8547 enum LDKCreationError *err;
8548 } LDKCResult_PrivateRouteCreationErrorZPtr;
8551 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
8552 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
8553 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8555 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
8557 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
8558 * `err` or `result` depending on the state of `result_ok`.
8560 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
8562 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
8565 } LDKCResult_PrivateRouteCreationErrorZ;
8568 * The contents of CResult_StringErrorZ
8570 typedef union LDKCResult_StringErrorZPtr {
8572 * A pointer to the contents in the success state.
8573 * Reading from this pointer when `result_ok` is not set is undefined.
8575 struct LDKStr *result;
8577 * A pointer to the contents in the error state.
8578 * Reading from this pointer when `result_ok` is set is undefined.
8580 enum LDKSecp256k1Error *err;
8581 } LDKCResult_StringErrorZPtr;
8584 * A CResult_StringErrorZ represents the result of a fallible operation,
8585 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
8586 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8588 typedef struct LDKCResult_StringErrorZ {
8590 * The contents of this CResult_StringErrorZ, accessible via either
8591 * `err` or `result` depending on the state of `result_ok`.
8593 union LDKCResult_StringErrorZPtr contents;
8595 * Whether this CResult_StringErrorZ represents a success state.
8598 } LDKCResult_StringErrorZ;
8601 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
8603 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
8605 * A pointer to the contents in the success state.
8606 * Reading from this pointer when `result_ok` is not set is undefined.
8608 struct LDKChannelMonitorUpdate *result;
8610 * A pointer to the contents in the error state.
8611 * Reading from this pointer when `result_ok` is set is undefined.
8613 struct LDKDecodeError *err;
8614 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
8617 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
8618 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
8619 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8621 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
8623 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
8624 * `err` or `result` depending on the state of `result_ok`.
8626 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
8628 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
8631 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
8634 * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
8636 typedef enum LDKCOption_MonitorEventZ_Tag {
8638 * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
8640 LDKCOption_MonitorEventZ_Some,
8642 * When we're in this state, this COption_MonitorEventZ contains nothing
8644 LDKCOption_MonitorEventZ_None,
8646 * Must be last for serialization purposes
8648 LDKCOption_MonitorEventZ_Sentinel,
8649 } LDKCOption_MonitorEventZ_Tag;
8651 typedef struct LDKCOption_MonitorEventZ {
8652 LDKCOption_MonitorEventZ_Tag tag;
8655 struct LDKMonitorEvent some;
8658 } LDKCOption_MonitorEventZ;
8661 * The contents of CResult_COption_MonitorEventZDecodeErrorZ
8663 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
8665 * A pointer to the contents in the success state.
8666 * Reading from this pointer when `result_ok` is not set is undefined.
8668 struct LDKCOption_MonitorEventZ *result;
8670 * A pointer to the contents in the error state.
8671 * Reading from this pointer when `result_ok` is set is undefined.
8673 struct LDKDecodeError *err;
8674 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
8677 * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
8678 * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
8679 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8681 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
8683 * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
8684 * `err` or `result` depending on the state of `result_ok`.
8686 union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
8688 * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
8691 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
8694 * The contents of CResult_HTLCUpdateDecodeErrorZ
8696 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
8698 * A pointer to the contents in the success state.
8699 * Reading from this pointer when `result_ok` is not set is undefined.
8701 struct LDKHTLCUpdate *result;
8703 * A pointer to the contents in the error state.
8704 * Reading from this pointer when `result_ok` is set is undefined.
8706 struct LDKDecodeError *err;
8707 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
8710 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
8711 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
8712 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8714 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
8716 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
8717 * `err` or `result` depending on the state of `result_ok`.
8719 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
8721 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
8724 } LDKCResult_HTLCUpdateDecodeErrorZ;
8727 * A tuple of 2 elements. See the individual fields for the types contained.
8729 typedef struct LDKC2Tuple_OutPointScriptZ {
8731 * The element at position 0
8733 struct LDKOutPoint a;
8735 * The element at position 1
8737 struct LDKCVec_u8Z b;
8738 } LDKC2Tuple_OutPointScriptZ;
8741 * A tuple of 2 elements. See the individual fields for the types contained.
8743 typedef struct LDKC2Tuple_u32ScriptZ {
8745 * The element at position 0
8749 * The element at position 1
8751 struct LDKCVec_u8Z b;
8752 } LDKC2Tuple_u32ScriptZ;
8755 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
8756 * This corresponds to std::vector in C++
8758 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
8760 * The elements in the array.
8761 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8763 struct LDKC2Tuple_u32ScriptZ *data;
8765 * The number of elements pointed to by `data`.
8768 } LDKCVec_C2Tuple_u32ScriptZZ;
8771 * A tuple of 2 elements. See the individual fields for the types contained.
8773 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
8775 * The element at position 0
8777 struct LDKThirtyTwoBytes a;
8779 * The element at position 1
8781 struct LDKCVec_C2Tuple_u32ScriptZZ b;
8782 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
8785 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
8786 * This corresponds to std::vector in C++
8788 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
8790 * The elements in the array.
8791 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8793 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
8795 * The number of elements pointed to by `data`.
8798 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
8801 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
8802 * This corresponds to std::vector in C++
8804 typedef struct LDKCVec_EventZ {
8806 * The elements in the array.
8807 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8809 struct LDKEvent *data;
8811 * The number of elements pointed to by `data`.
8817 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
8818 * This corresponds to std::vector in C++
8820 typedef struct LDKCVec_TransactionZ {
8822 * The elements in the array.
8823 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8825 struct LDKTransaction *data;
8827 * The number of elements pointed to by `data`.
8830 } LDKCVec_TransactionZ;
8833 * A tuple of 2 elements. See the individual fields for the types contained.
8835 typedef struct LDKC2Tuple_u32TxOutZ {
8837 * The element at position 0
8841 * The element at position 1
8844 } LDKC2Tuple_u32TxOutZ;
8847 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
8848 * This corresponds to std::vector in C++
8850 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
8852 * The elements in the array.
8853 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8855 struct LDKC2Tuple_u32TxOutZ *data;
8857 * The number of elements pointed to by `data`.
8860 } LDKCVec_C2Tuple_u32TxOutZZ;
8863 * A tuple of 2 elements. See the individual fields for the types contained.
8865 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
8867 * The element at position 0
8869 struct LDKThirtyTwoBytes a;
8871 * The element at position 1
8873 struct LDKCVec_C2Tuple_u32TxOutZZ b;
8874 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
8877 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
8878 * This corresponds to std::vector in C++
8880 typedef struct LDKCVec_TransactionOutputsZ {
8882 * The elements in the array.
8883 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8885 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
8887 * The number of elements pointed to by `data`.
8890 } LDKCVec_TransactionOutputsZ;
8893 * Details about the balance(s) available for spending once the channel appears on chain.
8895 * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
8898 typedef enum LDKBalance_Tag {
8900 * The channel is not yet closed (or the commitment or closing transaction has not yet
8901 * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
8904 LDKBalance_ClaimableOnChannelClose,
8906 * The channel has been closed, and the given balance is ours but awaiting confirmations until
8907 * we consider it spendable.
8909 LDKBalance_ClaimableAwaitingConfirmations,
8911 * The channel has been closed, and the given balance should be ours but awaiting spending
8912 * transaction confirmation. If the spending transaction does not confirm in time, it is
8913 * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
8915 * Once the spending transaction confirms, before it has reached enough confirmations to be
8916 * considered safe from chain reorganizations, the balance will instead be provided via
8917 * [`Balance::ClaimableAwaitingConfirmations`].
8919 LDKBalance_ContentiousClaimable,
8921 * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
8922 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
8923 * likely to be claimed by our counterparty before we do.
8925 LDKBalance_MaybeClaimableHTLCAwaitingTimeout,
8927 * Must be last for serialization purposes
8929 LDKBalance_Sentinel,
8932 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
8934 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
8935 * required to do so.
8937 uint64_t claimable_amount_satoshis;
8938 } LDKBalance_LDKClaimableOnChannelClose_Body;
8940 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
8942 * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
8943 * were spent in broadcasting the transaction.
8945 uint64_t claimable_amount_satoshis;
8947 * The height at which an [`Event::SpendableOutputs`] event will be generated for this
8950 uint32_t confirmation_height;
8951 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
8953 typedef struct LDKBalance_LDKContentiousClaimable_Body {
8955 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
8956 * required to do so.
8958 uint64_t claimable_amount_satoshis;
8960 * The height at which the counterparty may be able to claim the balance if we have not
8963 uint32_t timeout_height;
8964 } LDKBalance_LDKContentiousClaimable_Body;
8966 typedef struct LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body {
8968 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
8969 * required to do so.
8971 uint64_t claimable_amount_satoshis;
8973 * The height at which we will be able to claim the balance if our counterparty has not
8976 uint32_t claimable_height;
8977 } LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body;
8979 typedef struct MUST_USE_STRUCT LDKBalance {
8982 LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
8983 LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
8984 LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
8985 LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body maybe_claimable_htlc_awaiting_timeout;
8990 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
8991 * This corresponds to std::vector in C++
8993 typedef struct LDKCVec_BalanceZ {
8995 * The elements in the array.
8996 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8998 struct LDKBalance *data;
9000 * The number of elements pointed to by `data`.
9006 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
9008 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
9010 * A pointer to the contents in the success state.
9011 * Reading from this pointer when `result_ok` is not set is undefined.
9013 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
9015 * A pointer to the contents in the error state.
9016 * Reading from this pointer when `result_ok` is set is undefined.
9018 struct LDKDecodeError *err;
9019 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
9022 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
9023 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9024 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9026 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
9028 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
9029 * `err` or `result` depending on the state of `result_ok`.
9031 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
9033 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
9036 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
9039 * A tuple of 2 elements. See the individual fields for the types contained.
9041 typedef struct LDKC2Tuple_PublicKeyTypeZ {
9043 * The element at position 0
9045 struct LDKPublicKey a;
9047 * The element at position 1
9050 } LDKC2Tuple_PublicKeyTypeZ;
9053 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
9054 * This corresponds to std::vector in C++
9056 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
9058 * The elements in the array.
9059 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9061 struct LDKC2Tuple_PublicKeyTypeZ *data;
9063 * The number of elements pointed to by `data`.
9066 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
9069 * An enum which can either contain a crate::lightning::ln::msgs::NetAddress or not
9071 typedef enum LDKCOption_NetAddressZ_Tag {
9073 * When we're in this state, this COption_NetAddressZ contains a crate::lightning::ln::msgs::NetAddress
9075 LDKCOption_NetAddressZ_Some,
9077 * When we're in this state, this COption_NetAddressZ contains nothing
9079 LDKCOption_NetAddressZ_None,
9081 * Must be last for serialization purposes
9083 LDKCOption_NetAddressZ_Sentinel,
9084 } LDKCOption_NetAddressZ_Tag;
9086 typedef struct LDKCOption_NetAddressZ {
9087 LDKCOption_NetAddressZ_Tag tag;
9090 struct LDKNetAddress some;
9093 } LDKCOption_NetAddressZ;
9098 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
9099 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
9102 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
9104 * A pointer to the opaque Rust object.
9105 * Nearly everywhere, inner must be non-null, however in places where
9106 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9108 LDKnativePeerHandleError *inner;
9110 * Indicates that this is the only struct which contains the same pointer.
9111 * Rust functions which take ownership of an object provided via an argument require
9112 * this to be true and invalidate the object pointed to by inner.
9115 } LDKPeerHandleError;
9118 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
9120 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
9122 * A pointer to the contents in the success state.
9123 * Reading from this pointer when `result_ok` is not set is undefined.
9125 struct LDKCVec_u8Z *result;
9127 * A pointer to the contents in the error state.
9128 * Reading from this pointer when `result_ok` is set is undefined.
9130 struct LDKPeerHandleError *err;
9131 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
9134 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
9135 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9136 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9138 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
9140 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
9141 * `err` or `result` depending on the state of `result_ok`.
9143 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
9145 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
9148 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
9151 * The contents of CResult_NonePeerHandleErrorZ
9153 typedef union LDKCResult_NonePeerHandleErrorZPtr {
9155 * Note that this value is always NULL, as there are no contents in the OK variant
9159 * A pointer to the contents in the error state.
9160 * Reading from this pointer when `result_ok` is set is undefined.
9162 struct LDKPeerHandleError *err;
9163 } LDKCResult_NonePeerHandleErrorZPtr;
9166 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
9167 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9168 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9170 typedef struct LDKCResult_NonePeerHandleErrorZ {
9172 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
9173 * `err` or `result` depending on the state of `result_ok`.
9175 union LDKCResult_NonePeerHandleErrorZPtr contents;
9177 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
9180 } LDKCResult_NonePeerHandleErrorZ;
9183 * The contents of CResult_boolPeerHandleErrorZ
9185 typedef union LDKCResult_boolPeerHandleErrorZPtr {
9187 * A pointer to the contents in the success state.
9188 * Reading from this pointer when `result_ok` is not set is undefined.
9192 * A pointer to the contents in the error state.
9193 * Reading from this pointer when `result_ok` is set is undefined.
9195 struct LDKPeerHandleError *err;
9196 } LDKCResult_boolPeerHandleErrorZPtr;
9199 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
9200 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9201 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9203 typedef struct LDKCResult_boolPeerHandleErrorZ {
9205 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
9206 * `err` or `result` depending on the state of `result_ok`.
9208 union LDKCResult_boolPeerHandleErrorZPtr contents;
9210 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
9213 } LDKCResult_boolPeerHandleErrorZ;
9216 * All-encompassing standard error type that processing can return
9218 typedef enum LDKGraphSyncError_Tag {
9220 * Error trying to read the update data, typically due to an erroneous data length indication
9221 * that is greater than the actual amount of data provided
9223 LDKGraphSyncError_DecodeError,
9225 * Error applying the patch to the network graph, usually the result of updates that are too
9226 * old or missing prerequisite data to the application of updates out of order
9228 LDKGraphSyncError_LightningError,
9230 * Must be last for serialization purposes
9232 LDKGraphSyncError_Sentinel,
9233 } LDKGraphSyncError_Tag;
9235 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
9236 LDKGraphSyncError_Tag tag;
9239 struct LDKDecodeError decode_error;
9242 struct LDKLightningError lightning_error;
9245 } LDKGraphSyncError;
9248 * The contents of CResult_u32GraphSyncErrorZ
9250 typedef union LDKCResult_u32GraphSyncErrorZPtr {
9252 * A pointer to the contents in the success state.
9253 * Reading from this pointer when `result_ok` is not set is undefined.
9257 * A pointer to the contents in the error state.
9258 * Reading from this pointer when `result_ok` is set is undefined.
9260 struct LDKGraphSyncError *err;
9261 } LDKCResult_u32GraphSyncErrorZPtr;
9264 * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
9265 * containing a u32 on success and a crate::lightning_rapid_gossip_sync::error::GraphSyncError on failure.
9266 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9268 typedef struct LDKCResult_u32GraphSyncErrorZ {
9270 * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
9271 * `err` or `result` depending on the state of `result_ok`.
9273 union LDKCResult_u32GraphSyncErrorZPtr contents;
9275 * Whether this CResult_u32GraphSyncErrorZ represents a success state.
9278 } LDKCResult_u32GraphSyncErrorZ;
9281 * The contents of CResult_NetAddressDecodeErrorZ
9283 typedef union LDKCResult_NetAddressDecodeErrorZPtr {
9285 * A pointer to the contents in the success state.
9286 * Reading from this pointer when `result_ok` is not set is undefined.
9288 struct LDKNetAddress *result;
9290 * A pointer to the contents in the error state.
9291 * Reading from this pointer when `result_ok` is set is undefined.
9293 struct LDKDecodeError *err;
9294 } LDKCResult_NetAddressDecodeErrorZPtr;
9297 * A CResult_NetAddressDecodeErrorZ represents the result of a fallible operation,
9298 * containing a crate::lightning::ln::msgs::NetAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
9299 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9301 typedef struct LDKCResult_NetAddressDecodeErrorZ {
9303 * The contents of this CResult_NetAddressDecodeErrorZ, accessible via either
9304 * `err` or `result` depending on the state of `result_ok`.
9306 union LDKCResult_NetAddressDecodeErrorZPtr contents;
9308 * Whether this CResult_NetAddressDecodeErrorZ represents a success state.
9311 } LDKCResult_NetAddressDecodeErrorZ;
9316 * An update_add_htlc message to be sent or received from a peer
9318 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
9320 * A pointer to the opaque Rust object.
9321 * Nearly everywhere, inner must be non-null, however in places where
9322 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9324 LDKnativeUpdateAddHTLC *inner;
9326 * Indicates that this is the only struct which contains the same pointer.
9327 * Rust functions which take ownership of an object provided via an argument require
9328 * this to be true and invalidate the object pointed to by inner.
9334 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
9335 * This corresponds to std::vector in C++
9337 typedef struct LDKCVec_UpdateAddHTLCZ {
9339 * The elements in the array.
9340 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9342 struct LDKUpdateAddHTLC *data;
9344 * The number of elements pointed to by `data`.
9347 } LDKCVec_UpdateAddHTLCZ;
9352 * An update_fulfill_htlc message to be sent or received from a peer
9354 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
9356 * A pointer to the opaque Rust object.
9357 * Nearly everywhere, inner must be non-null, however in places where
9358 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9360 LDKnativeUpdateFulfillHTLC *inner;
9362 * Indicates that this is the only struct which contains the same pointer.
9363 * Rust functions which take ownership of an object provided via an argument require
9364 * this to be true and invalidate the object pointed to by inner.
9367 } LDKUpdateFulfillHTLC;
9370 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
9371 * This corresponds to std::vector in C++
9373 typedef struct LDKCVec_UpdateFulfillHTLCZ {
9375 * The elements in the array.
9376 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9378 struct LDKUpdateFulfillHTLC *data;
9380 * The number of elements pointed to by `data`.
9383 } LDKCVec_UpdateFulfillHTLCZ;
9388 * An update_fail_htlc message to be sent or received from a peer
9390 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
9392 * A pointer to the opaque Rust object.
9393 * Nearly everywhere, inner must be non-null, however in places where
9394 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9396 LDKnativeUpdateFailHTLC *inner;
9398 * Indicates that this is the only struct which contains the same pointer.
9399 * Rust functions which take ownership of an object provided via an argument require
9400 * this to be true and invalidate the object pointed to by inner.
9403 } LDKUpdateFailHTLC;
9406 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
9407 * This corresponds to std::vector in C++
9409 typedef struct LDKCVec_UpdateFailHTLCZ {
9411 * The elements in the array.
9412 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9414 struct LDKUpdateFailHTLC *data;
9416 * The number of elements pointed to by `data`.
9419 } LDKCVec_UpdateFailHTLCZ;
9424 * An update_fail_malformed_htlc message to be sent or received from a peer
9426 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
9428 * A pointer to the opaque Rust object.
9429 * Nearly everywhere, inner must be non-null, however in places where
9430 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9432 LDKnativeUpdateFailMalformedHTLC *inner;
9434 * Indicates that this is the only struct which contains the same pointer.
9435 * Rust functions which take ownership of an object provided via an argument require
9436 * this to be true and invalidate the object pointed to by inner.
9439 } LDKUpdateFailMalformedHTLC;
9442 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
9443 * This corresponds to std::vector in C++
9445 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
9447 * The elements in the array.
9448 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9450 struct LDKUpdateFailMalformedHTLC *data;
9452 * The number of elements pointed to by `data`.
9455 } LDKCVec_UpdateFailMalformedHTLCZ;
9458 * The contents of CResult_AcceptChannelDecodeErrorZ
9460 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
9462 * A pointer to the contents in the success state.
9463 * Reading from this pointer when `result_ok` is not set is undefined.
9465 struct LDKAcceptChannel *result;
9467 * A pointer to the contents in the error state.
9468 * Reading from this pointer when `result_ok` is set is undefined.
9470 struct LDKDecodeError *err;
9471 } LDKCResult_AcceptChannelDecodeErrorZPtr;
9474 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
9475 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
9476 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9478 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
9480 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
9481 * `err` or `result` depending on the state of `result_ok`.
9483 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
9485 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
9488 } LDKCResult_AcceptChannelDecodeErrorZ;
9491 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
9493 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
9495 * A pointer to the contents in the success state.
9496 * Reading from this pointer when `result_ok` is not set is undefined.
9498 struct LDKAnnouncementSignatures *result;
9500 * A pointer to the contents in the error state.
9501 * Reading from this pointer when `result_ok` is set is undefined.
9503 struct LDKDecodeError *err;
9504 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
9507 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
9508 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
9509 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9511 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
9513 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
9514 * `err` or `result` depending on the state of `result_ok`.
9516 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
9518 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
9521 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
9524 * The contents of CResult_ChannelReestablishDecodeErrorZ
9526 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
9528 * A pointer to the contents in the success state.
9529 * Reading from this pointer when `result_ok` is not set is undefined.
9531 struct LDKChannelReestablish *result;
9533 * A pointer to the contents in the error state.
9534 * Reading from this pointer when `result_ok` is set is undefined.
9536 struct LDKDecodeError *err;
9537 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
9540 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
9541 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
9542 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9544 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
9546 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
9547 * `err` or `result` depending on the state of `result_ok`.
9549 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
9551 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
9554 } LDKCResult_ChannelReestablishDecodeErrorZ;
9557 * The contents of CResult_ClosingSignedDecodeErrorZ
9559 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
9561 * A pointer to the contents in the success state.
9562 * Reading from this pointer when `result_ok` is not set is undefined.
9564 struct LDKClosingSigned *result;
9566 * A pointer to the contents in the error state.
9567 * Reading from this pointer when `result_ok` is set is undefined.
9569 struct LDKDecodeError *err;
9570 } LDKCResult_ClosingSignedDecodeErrorZPtr;
9573 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
9574 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
9575 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9577 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
9579 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
9580 * `err` or `result` depending on the state of `result_ok`.
9582 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
9584 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
9587 } LDKCResult_ClosingSignedDecodeErrorZ;
9592 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
9593 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
9596 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
9598 * A pointer to the opaque Rust object.
9599 * Nearly everywhere, inner must be non-null, however in places where
9600 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9602 LDKnativeClosingSignedFeeRange *inner;
9604 * Indicates that this is the only struct which contains the same pointer.
9605 * Rust functions which take ownership of an object provided via an argument require
9606 * this to be true and invalidate the object pointed to by inner.
9609 } LDKClosingSignedFeeRange;
9612 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
9614 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
9616 * A pointer to the contents in the success state.
9617 * Reading from this pointer when `result_ok` is not set is undefined.
9619 struct LDKClosingSignedFeeRange *result;
9621 * A pointer to the contents in the error state.
9622 * Reading from this pointer when `result_ok` is set is undefined.
9624 struct LDKDecodeError *err;
9625 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
9628 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
9629 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
9630 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9632 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
9634 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
9635 * `err` or `result` depending on the state of `result_ok`.
9637 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
9639 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
9642 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
9647 * A commitment_signed message to be sent or received from a peer
9649 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
9651 * A pointer to the opaque Rust object.
9652 * Nearly everywhere, inner must be non-null, however in places where
9653 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9655 LDKnativeCommitmentSigned *inner;
9657 * Indicates that this is the only struct which contains the same pointer.
9658 * Rust functions which take ownership of an object provided via an argument require
9659 * this to be true and invalidate the object pointed to by inner.
9662 } LDKCommitmentSigned;
9665 * The contents of CResult_CommitmentSignedDecodeErrorZ
9667 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
9669 * A pointer to the contents in the success state.
9670 * Reading from this pointer when `result_ok` is not set is undefined.
9672 struct LDKCommitmentSigned *result;
9674 * A pointer to the contents in the error state.
9675 * Reading from this pointer when `result_ok` is set is undefined.
9677 struct LDKDecodeError *err;
9678 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
9681 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
9682 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
9683 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9685 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
9687 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
9688 * `err` or `result` depending on the state of `result_ok`.
9690 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
9692 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
9695 } LDKCResult_CommitmentSignedDecodeErrorZ;
9698 * The contents of CResult_FundingCreatedDecodeErrorZ
9700 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
9702 * A pointer to the contents in the success state.
9703 * Reading from this pointer when `result_ok` is not set is undefined.
9705 struct LDKFundingCreated *result;
9707 * A pointer to the contents in the error state.
9708 * Reading from this pointer when `result_ok` is set is undefined.
9710 struct LDKDecodeError *err;
9711 } LDKCResult_FundingCreatedDecodeErrorZPtr;
9714 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
9715 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
9716 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9718 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
9720 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
9721 * `err` or `result` depending on the state of `result_ok`.
9723 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
9725 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
9728 } LDKCResult_FundingCreatedDecodeErrorZ;
9731 * The contents of CResult_FundingSignedDecodeErrorZ
9733 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
9735 * A pointer to the contents in the success state.
9736 * Reading from this pointer when `result_ok` is not set is undefined.
9738 struct LDKFundingSigned *result;
9740 * A pointer to the contents in the error state.
9741 * Reading from this pointer when `result_ok` is set is undefined.
9743 struct LDKDecodeError *err;
9744 } LDKCResult_FundingSignedDecodeErrorZPtr;
9747 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
9748 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
9749 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9751 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
9753 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
9754 * `err` or `result` depending on the state of `result_ok`.
9756 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
9758 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
9761 } LDKCResult_FundingSignedDecodeErrorZ;
9764 * The contents of CResult_ChannelReadyDecodeErrorZ
9766 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
9768 * A pointer to the contents in the success state.
9769 * Reading from this pointer when `result_ok` is not set is undefined.
9771 struct LDKChannelReady *result;
9773 * A pointer to the contents in the error state.
9774 * Reading from this pointer when `result_ok` is set is undefined.
9776 struct LDKDecodeError *err;
9777 } LDKCResult_ChannelReadyDecodeErrorZPtr;
9780 * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
9781 * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
9782 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9784 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
9786 * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
9787 * `err` or `result` depending on the state of `result_ok`.
9789 union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
9791 * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
9794 } LDKCResult_ChannelReadyDecodeErrorZ;
9799 * An init message to be sent or received from a peer
9801 typedef struct MUST_USE_STRUCT LDKInit {
9803 * A pointer to the opaque Rust object.
9804 * Nearly everywhere, inner must be non-null, however in places where
9805 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9807 LDKnativeInit *inner;
9809 * Indicates that this is the only struct which contains the same pointer.
9810 * Rust functions which take ownership of an object provided via an argument require
9811 * this to be true and invalidate the object pointed to by inner.
9817 * The contents of CResult_InitDecodeErrorZ
9819 typedef union LDKCResult_InitDecodeErrorZPtr {
9821 * A pointer to the contents in the success state.
9822 * Reading from this pointer when `result_ok` is not set is undefined.
9824 struct LDKInit *result;
9826 * A pointer to the contents in the error state.
9827 * Reading from this pointer when `result_ok` is set is undefined.
9829 struct LDKDecodeError *err;
9830 } LDKCResult_InitDecodeErrorZPtr;
9833 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
9834 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
9835 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9837 typedef struct LDKCResult_InitDecodeErrorZ {
9839 * The contents of this CResult_InitDecodeErrorZ, accessible via either
9840 * `err` or `result` depending on the state of `result_ok`.
9842 union LDKCResult_InitDecodeErrorZPtr contents;
9844 * Whether this CResult_InitDecodeErrorZ represents a success state.
9847 } LDKCResult_InitDecodeErrorZ;
9850 * The contents of CResult_OpenChannelDecodeErrorZ
9852 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
9854 * A pointer to the contents in the success state.
9855 * Reading from this pointer when `result_ok` is not set is undefined.
9857 struct LDKOpenChannel *result;
9859 * A pointer to the contents in the error state.
9860 * Reading from this pointer when `result_ok` is set is undefined.
9862 struct LDKDecodeError *err;
9863 } LDKCResult_OpenChannelDecodeErrorZPtr;
9866 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
9867 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
9868 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9870 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
9872 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
9873 * `err` or `result` depending on the state of `result_ok`.
9875 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
9877 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
9880 } LDKCResult_OpenChannelDecodeErrorZ;
9883 * The contents of CResult_RevokeAndACKDecodeErrorZ
9885 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
9887 * A pointer to the contents in the success state.
9888 * Reading from this pointer when `result_ok` is not set is undefined.
9890 struct LDKRevokeAndACK *result;
9892 * A pointer to the contents in the error state.
9893 * Reading from this pointer when `result_ok` is set is undefined.
9895 struct LDKDecodeError *err;
9896 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
9899 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
9900 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
9901 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9903 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
9905 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
9906 * `err` or `result` depending on the state of `result_ok`.
9908 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
9910 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
9913 } LDKCResult_RevokeAndACKDecodeErrorZ;
9916 * The contents of CResult_ShutdownDecodeErrorZ
9918 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
9920 * A pointer to the contents in the success state.
9921 * Reading from this pointer when `result_ok` is not set is undefined.
9923 struct LDKShutdown *result;
9925 * A pointer to the contents in the error state.
9926 * Reading from this pointer when `result_ok` is set is undefined.
9928 struct LDKDecodeError *err;
9929 } LDKCResult_ShutdownDecodeErrorZPtr;
9932 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
9933 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
9934 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9936 typedef struct LDKCResult_ShutdownDecodeErrorZ {
9938 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
9939 * `err` or `result` depending on the state of `result_ok`.
9941 union LDKCResult_ShutdownDecodeErrorZPtr contents;
9943 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
9946 } LDKCResult_ShutdownDecodeErrorZ;
9949 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
9951 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
9953 * A pointer to the contents in the success state.
9954 * Reading from this pointer when `result_ok` is not set is undefined.
9956 struct LDKUpdateFailHTLC *result;
9958 * A pointer to the contents in the error state.
9959 * Reading from this pointer when `result_ok` is set is undefined.
9961 struct LDKDecodeError *err;
9962 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
9965 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
9966 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
9967 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9969 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
9971 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
9972 * `err` or `result` depending on the state of `result_ok`.
9974 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
9976 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
9979 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
9982 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
9984 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
9986 * A pointer to the contents in the success state.
9987 * Reading from this pointer when `result_ok` is not set is undefined.
9989 struct LDKUpdateFailMalformedHTLC *result;
9991 * A pointer to the contents in the error state.
9992 * Reading from this pointer when `result_ok` is set is undefined.
9994 struct LDKDecodeError *err;
9995 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
9998 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
9999 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
10000 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10002 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
10004 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
10005 * `err` or `result` depending on the state of `result_ok`.
10007 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
10009 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
10012 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
10017 * An update_fee message to be sent or received from a peer
10019 typedef struct MUST_USE_STRUCT LDKUpdateFee {
10021 * A pointer to the opaque Rust object.
10022 * Nearly everywhere, inner must be non-null, however in places where
10023 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10025 LDKnativeUpdateFee *inner;
10027 * Indicates that this is the only struct which contains the same pointer.
10028 * Rust functions which take ownership of an object provided via an argument require
10029 * this to be true and invalidate the object pointed to by inner.
10035 * The contents of CResult_UpdateFeeDecodeErrorZ
10037 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
10039 * A pointer to the contents in the success state.
10040 * Reading from this pointer when `result_ok` is not set is undefined.
10042 struct LDKUpdateFee *result;
10044 * A pointer to the contents in the error state.
10045 * Reading from this pointer when `result_ok` is set is undefined.
10047 struct LDKDecodeError *err;
10048 } LDKCResult_UpdateFeeDecodeErrorZPtr;
10051 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
10052 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
10053 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10055 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
10057 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
10058 * `err` or `result` depending on the state of `result_ok`.
10060 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
10062 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
10065 } LDKCResult_UpdateFeeDecodeErrorZ;
10068 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
10070 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
10072 * A pointer to the contents in the success state.
10073 * Reading from this pointer when `result_ok` is not set is undefined.
10075 struct LDKUpdateFulfillHTLC *result;
10077 * A pointer to the contents in the error state.
10078 * Reading from this pointer when `result_ok` is set is undefined.
10080 struct LDKDecodeError *err;
10081 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
10084 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
10085 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
10086 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10088 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
10090 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
10091 * `err` or `result` depending on the state of `result_ok`.
10093 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
10095 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
10098 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
10101 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
10103 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
10105 * A pointer to the contents in the success state.
10106 * Reading from this pointer when `result_ok` is not set is undefined.
10108 struct LDKUpdateAddHTLC *result;
10110 * A pointer to the contents in the error state.
10111 * Reading from this pointer when `result_ok` is set is undefined.
10113 struct LDKDecodeError *err;
10114 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
10117 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
10118 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
10119 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10121 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
10123 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
10124 * `err` or `result` depending on the state of `result_ok`.
10126 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
10128 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
10131 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
10136 * A ping message to be sent or received from a peer
10138 typedef struct MUST_USE_STRUCT LDKPing {
10140 * A pointer to the opaque Rust object.
10141 * Nearly everywhere, inner must be non-null, however in places where
10142 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10144 LDKnativePing *inner;
10146 * Indicates that this is the only struct which contains the same pointer.
10147 * Rust functions which take ownership of an object provided via an argument require
10148 * this to be true and invalidate the object pointed to by inner.
10154 * The contents of CResult_PingDecodeErrorZ
10156 typedef union LDKCResult_PingDecodeErrorZPtr {
10158 * A pointer to the contents in the success state.
10159 * Reading from this pointer when `result_ok` is not set is undefined.
10161 struct LDKPing *result;
10163 * A pointer to the contents in the error state.
10164 * Reading from this pointer when `result_ok` is set is undefined.
10166 struct LDKDecodeError *err;
10167 } LDKCResult_PingDecodeErrorZPtr;
10170 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
10171 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
10172 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10174 typedef struct LDKCResult_PingDecodeErrorZ {
10176 * The contents of this CResult_PingDecodeErrorZ, accessible via either
10177 * `err` or `result` depending on the state of `result_ok`.
10179 union LDKCResult_PingDecodeErrorZPtr contents;
10181 * Whether this CResult_PingDecodeErrorZ represents a success state.
10184 } LDKCResult_PingDecodeErrorZ;
10189 * A pong message to be sent or received from a peer
10191 typedef struct MUST_USE_STRUCT LDKPong {
10193 * A pointer to the opaque Rust object.
10194 * Nearly everywhere, inner must be non-null, however in places where
10195 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10197 LDKnativePong *inner;
10199 * Indicates that this is the only struct which contains the same pointer.
10200 * Rust functions which take ownership of an object provided via an argument require
10201 * this to be true and invalidate the object pointed to by inner.
10207 * The contents of CResult_PongDecodeErrorZ
10209 typedef union LDKCResult_PongDecodeErrorZPtr {
10211 * A pointer to the contents in the success state.
10212 * Reading from this pointer when `result_ok` is not set is undefined.
10214 struct LDKPong *result;
10216 * A pointer to the contents in the error state.
10217 * Reading from this pointer when `result_ok` is set is undefined.
10219 struct LDKDecodeError *err;
10220 } LDKCResult_PongDecodeErrorZPtr;
10223 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
10224 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
10225 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10227 typedef struct LDKCResult_PongDecodeErrorZ {
10229 * The contents of this CResult_PongDecodeErrorZ, accessible via either
10230 * `err` or `result` depending on the state of `result_ok`.
10232 union LDKCResult_PongDecodeErrorZPtr contents;
10234 * Whether this CResult_PongDecodeErrorZ represents a success state.
10237 } LDKCResult_PongDecodeErrorZ;
10240 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
10242 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
10244 * A pointer to the contents in the success state.
10245 * Reading from this pointer when `result_ok` is not set is undefined.
10247 struct LDKUnsignedChannelAnnouncement *result;
10249 * A pointer to the contents in the error state.
10250 * Reading from this pointer when `result_ok` is set is undefined.
10252 struct LDKDecodeError *err;
10253 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
10256 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
10257 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10258 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10260 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
10262 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
10263 * `err` or `result` depending on the state of `result_ok`.
10265 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
10267 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
10270 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
10273 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
10275 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
10277 * A pointer to the contents in the success state.
10278 * Reading from this pointer when `result_ok` is not set is undefined.
10280 struct LDKChannelAnnouncement *result;
10282 * A pointer to the contents in the error state.
10283 * Reading from this pointer when `result_ok` is set is undefined.
10285 struct LDKDecodeError *err;
10286 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
10289 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
10290 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10291 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10293 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
10295 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
10296 * `err` or `result` depending on the state of `result_ok`.
10298 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
10300 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
10303 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
10308 * The unsigned part of a channel_update
10310 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
10312 * A pointer to the opaque Rust object.
10313 * Nearly everywhere, inner must be non-null, however in places where
10314 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10316 LDKnativeUnsignedChannelUpdate *inner;
10318 * Indicates that this is the only struct which contains the same pointer.
10319 * Rust functions which take ownership of an object provided via an argument require
10320 * this to be true and invalidate the object pointed to by inner.
10323 } LDKUnsignedChannelUpdate;
10326 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
10328 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
10330 * A pointer to the contents in the success state.
10331 * Reading from this pointer when `result_ok` is not set is undefined.
10333 struct LDKUnsignedChannelUpdate *result;
10335 * A pointer to the contents in the error state.
10336 * Reading from this pointer when `result_ok` is set is undefined.
10338 struct LDKDecodeError *err;
10339 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
10342 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
10343 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
10344 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10346 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
10348 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
10349 * `err` or `result` depending on the state of `result_ok`.
10351 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
10353 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
10356 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
10359 * The contents of CResult_ChannelUpdateDecodeErrorZ
10361 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
10363 * A pointer to the contents in the success state.
10364 * Reading from this pointer when `result_ok` is not set is undefined.
10366 struct LDKChannelUpdate *result;
10368 * A pointer to the contents in the error state.
10369 * Reading from this pointer when `result_ok` is set is undefined.
10371 struct LDKDecodeError *err;
10372 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
10375 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
10376 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
10377 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10379 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
10381 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
10382 * `err` or `result` depending on the state of `result_ok`.
10384 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
10386 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
10389 } LDKCResult_ChannelUpdateDecodeErrorZ;
10392 * The contents of CResult_ErrorMessageDecodeErrorZ
10394 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
10396 * A pointer to the contents in the success state.
10397 * Reading from this pointer when `result_ok` is not set is undefined.
10399 struct LDKErrorMessage *result;
10401 * A pointer to the contents in the error state.
10402 * Reading from this pointer when `result_ok` is set is undefined.
10404 struct LDKDecodeError *err;
10405 } LDKCResult_ErrorMessageDecodeErrorZPtr;
10408 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
10409 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
10410 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10412 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
10414 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
10415 * `err` or `result` depending on the state of `result_ok`.
10417 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
10419 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
10422 } LDKCResult_ErrorMessageDecodeErrorZ;
10425 * The contents of CResult_WarningMessageDecodeErrorZ
10427 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
10429 * A pointer to the contents in the success state.
10430 * Reading from this pointer when `result_ok` is not set is undefined.
10432 struct LDKWarningMessage *result;
10434 * A pointer to the contents in the error state.
10435 * Reading from this pointer when `result_ok` is set is undefined.
10437 struct LDKDecodeError *err;
10438 } LDKCResult_WarningMessageDecodeErrorZPtr;
10441 * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
10442 * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
10443 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10445 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
10447 * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
10448 * `err` or `result` depending on the state of `result_ok`.
10450 union LDKCResult_WarningMessageDecodeErrorZPtr contents;
10452 * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
10455 } LDKCResult_WarningMessageDecodeErrorZ;
10460 * The unsigned part of a node_announcement
10462 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
10464 * A pointer to the opaque Rust object.
10465 * Nearly everywhere, inner must be non-null, however in places where
10466 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10468 LDKnativeUnsignedNodeAnnouncement *inner;
10470 * Indicates that this is the only struct which contains the same pointer.
10471 * Rust functions which take ownership of an object provided via an argument require
10472 * this to be true and invalidate the object pointed to by inner.
10475 } LDKUnsignedNodeAnnouncement;
10478 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
10480 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
10482 * A pointer to the contents in the success state.
10483 * Reading from this pointer when `result_ok` is not set is undefined.
10485 struct LDKUnsignedNodeAnnouncement *result;
10487 * A pointer to the contents in the error state.
10488 * Reading from this pointer when `result_ok` is set is undefined.
10490 struct LDKDecodeError *err;
10491 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
10494 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
10495 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10496 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10498 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
10500 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
10501 * `err` or `result` depending on the state of `result_ok`.
10503 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
10505 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
10508 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
10511 * The contents of CResult_NodeAnnouncementDecodeErrorZ
10513 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
10515 * A pointer to the contents in the success state.
10516 * Reading from this pointer when `result_ok` is not set is undefined.
10518 struct LDKNodeAnnouncement *result;
10520 * A pointer to the contents in the error state.
10521 * Reading from this pointer when `result_ok` is set is undefined.
10523 struct LDKDecodeError *err;
10524 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
10527 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
10528 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10529 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10531 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
10533 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
10534 * `err` or `result` depending on the state of `result_ok`.
10536 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
10538 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
10541 } LDKCResult_NodeAnnouncementDecodeErrorZ;
10544 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
10546 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
10548 * A pointer to the contents in the success state.
10549 * Reading from this pointer when `result_ok` is not set is undefined.
10551 struct LDKQueryShortChannelIds *result;
10553 * A pointer to the contents in the error state.
10554 * Reading from this pointer when `result_ok` is set is undefined.
10556 struct LDKDecodeError *err;
10557 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
10560 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
10561 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
10562 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10564 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
10566 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
10567 * `err` or `result` depending on the state of `result_ok`.
10569 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
10571 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
10574 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
10579 * A reply_short_channel_ids_end message is sent as a reply to a
10580 * query_short_channel_ids message. The query recipient makes a best
10581 * effort to respond based on their local network view which may not be
10582 * a perfect view of the network.
10584 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
10586 * A pointer to the opaque Rust object.
10587 * Nearly everywhere, inner must be non-null, however in places where
10588 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10590 LDKnativeReplyShortChannelIdsEnd *inner;
10592 * Indicates that this is the only struct which contains the same pointer.
10593 * Rust functions which take ownership of an object provided via an argument require
10594 * this to be true and invalidate the object pointed to by inner.
10597 } LDKReplyShortChannelIdsEnd;
10600 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
10602 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
10604 * A pointer to the contents in the success state.
10605 * Reading from this pointer when `result_ok` is not set is undefined.
10607 struct LDKReplyShortChannelIdsEnd *result;
10609 * A pointer to the contents in the error state.
10610 * Reading from this pointer when `result_ok` is set is undefined.
10612 struct LDKDecodeError *err;
10613 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
10616 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
10617 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
10618 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10620 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
10622 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
10623 * `err` or `result` depending on the state of `result_ok`.
10625 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
10627 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
10630 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
10633 * The contents of CResult_QueryChannelRangeDecodeErrorZ
10635 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
10637 * A pointer to the contents in the success state.
10638 * Reading from this pointer when `result_ok` is not set is undefined.
10640 struct LDKQueryChannelRange *result;
10642 * A pointer to the contents in the error state.
10643 * Reading from this pointer when `result_ok` is set is undefined.
10645 struct LDKDecodeError *err;
10646 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
10649 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
10650 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
10651 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10653 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
10655 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
10656 * `err` or `result` depending on the state of `result_ok`.
10658 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
10660 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
10663 } LDKCResult_QueryChannelRangeDecodeErrorZ;
10666 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
10668 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
10670 * A pointer to the contents in the success state.
10671 * Reading from this pointer when `result_ok` is not set is undefined.
10673 struct LDKReplyChannelRange *result;
10675 * A pointer to the contents in the error state.
10676 * Reading from this pointer when `result_ok` is set is undefined.
10678 struct LDKDecodeError *err;
10679 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
10682 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
10683 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
10684 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10686 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
10688 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
10689 * `err` or `result` depending on the state of `result_ok`.
10691 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
10693 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
10696 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
10699 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
10701 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
10703 * A pointer to the contents in the success state.
10704 * Reading from this pointer when `result_ok` is not set is undefined.
10706 struct LDKGossipTimestampFilter *result;
10708 * A pointer to the contents in the error state.
10709 * Reading from this pointer when `result_ok` is set is undefined.
10711 struct LDKDecodeError *err;
10712 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
10715 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
10716 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
10717 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10719 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
10721 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
10722 * `err` or `result` depending on the state of `result_ok`.
10724 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
10726 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
10729 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
10732 * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
10733 * This corresponds to std::vector in C++
10735 typedef struct LDKCVec_PhantomRouteHintsZ {
10737 * The elements in the array.
10738 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10740 struct LDKPhantomRouteHints *data;
10742 * The number of elements pointed to by `data`.
10745 } LDKCVec_PhantomRouteHintsZ;
10748 * When signing using a fallible method either an user-supplied `SignError` or a `CreationError`
10751 typedef enum LDKSignOrCreationError_Tag {
10753 * An error occurred during signing
10755 LDKSignOrCreationError_SignError,
10757 * An error occurred while building the transaction
10759 LDKSignOrCreationError_CreationError,
10761 * Must be last for serialization purposes
10763 LDKSignOrCreationError_Sentinel,
10764 } LDKSignOrCreationError_Tag;
10766 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
10767 LDKSignOrCreationError_Tag tag;
10770 enum LDKCreationError creation_error;
10773 } LDKSignOrCreationError;
10776 * The contents of CResult_InvoiceSignOrCreationErrorZ
10778 typedef union LDKCResult_InvoiceSignOrCreationErrorZPtr {
10780 * A pointer to the contents in the success state.
10781 * Reading from this pointer when `result_ok` is not set is undefined.
10783 struct LDKInvoice *result;
10785 * A pointer to the contents in the error state.
10786 * Reading from this pointer when `result_ok` is set is undefined.
10788 struct LDKSignOrCreationError *err;
10789 } LDKCResult_InvoiceSignOrCreationErrorZPtr;
10792 * A CResult_InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
10793 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
10794 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10796 typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
10798 * The contents of this CResult_InvoiceSignOrCreationErrorZ, accessible via either
10799 * `err` or `result` depending on the state of `result_ok`.
10801 union LDKCResult_InvoiceSignOrCreationErrorZPtr contents;
10803 * Whether this CResult_InvoiceSignOrCreationErrorZ represents a success state.
10806 } LDKCResult_InvoiceSignOrCreationErrorZ;
10811 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
10813 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
10814 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
10815 * the return value of [`Filter::register_output`].
10817 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
10818 * may have been spent there. See [`Filter::register_output`] for details.
10820 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
10821 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
10823 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
10825 * A pointer to the opaque Rust object.
10826 * Nearly everywhere, inner must be non-null, however in places where
10827 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10829 LDKnativeWatchedOutput *inner;
10831 * Indicates that this is the only struct which contains the same pointer.
10832 * Rust functions which take ownership of an object provided via an argument require
10833 * this to be true and invalidate the object pointed to by inner.
10836 } LDKWatchedOutput;
10839 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
10842 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
10843 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
10844 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
10845 * receiving full blocks from a chain source, any further filtering is unnecessary.
10847 * After an output has been registered, subsequent block retrievals from the chain source must not
10848 * exclude any transactions matching the new criteria nor any in-block descendants of such
10851 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
10852 * should not block on I/O. Implementations should instead queue the newly monitored data to be
10853 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
10854 * invocation that has called the `Filter` must return [`TemporaryFailure`].
10856 * [`TemporaryFailure`]: ChannelMonitorUpdateErr::TemporaryFailure
10857 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
10858 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
10860 typedef struct LDKFilter {
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 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
10868 * a spending condition.
10870 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
10872 * Registers interest in spends of a transaction output.
10874 * Optionally, when `output.block_hash` is set, should return any transaction spending the
10875 * output that is found in the corresponding block along with its index.
10877 * This return value is useful for Electrum clients in order to supply in-block descendant
10878 * transactions which otherwise were not included. This is not necessary for other clients if
10879 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
10882 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
10884 * Frees any resources associated with this object given its this_arg pointer.
10885 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10887 void (*free)(void *this_arg);
10891 * An enum which can either contain a crate::lightning::chain::Filter or not
10893 typedef enum LDKCOption_FilterZ_Tag {
10895 * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
10897 LDKCOption_FilterZ_Some,
10899 * When we're in this state, this COption_FilterZ contains nothing
10901 LDKCOption_FilterZ_None,
10903 * Must be last for serialization purposes
10905 LDKCOption_FilterZ_Sentinel,
10906 } LDKCOption_FilterZ_Tag;
10908 typedef struct LDKCOption_FilterZ {
10909 LDKCOption_FilterZ_Tag tag;
10912 struct LDKFilter some;
10915 } LDKCOption_FilterZ;
10920 * A read-only reference to a current ChannelMonitor.
10922 * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
10925 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
10927 * A pointer to the opaque Rust object.
10928 * Nearly everywhere, inner must be non-null, however in places where
10929 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10931 LDKnativeLockedChannelMonitor *inner;
10933 * Indicates that this is the only struct which contains the same pointer.
10934 * Rust functions which take ownership of an object provided via an argument require
10935 * this to be true and invalidate the object pointed to by inner.
10938 } LDKLockedChannelMonitor;
10941 * The contents of CResult_LockedChannelMonitorNoneZ
10943 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
10945 * A pointer to the contents in the success state.
10946 * Reading from this pointer when `result_ok` is not set is undefined.
10948 struct LDKLockedChannelMonitor *result;
10950 * Note that this value is always NULL, as there are no contents in the Err variant
10953 } LDKCResult_LockedChannelMonitorNoneZPtr;
10956 * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
10957 * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
10958 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10960 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
10962 * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
10963 * `err` or `result` depending on the state of `result_ok`.
10965 union LDKCResult_LockedChannelMonitorNoneZPtr contents;
10967 * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
10970 } LDKCResult_LockedChannelMonitorNoneZ;
10973 * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
10974 * This corresponds to std::vector in C++
10976 typedef struct LDKCVec_OutPointZ {
10978 * The elements in the array.
10979 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10981 struct LDKOutPoint *data;
10983 * The number of elements pointed to by `data`.
10986 } LDKCVec_OutPointZ;
10989 * A trait indicating an object may generate message send events
10991 typedef struct LDKMessageSendEventsProvider {
10993 * An opaque pointer which is passed to your function implementations as an argument.
10994 * This has no meaning in the LDK, and can be NULL or any other value.
10998 * Gets the list of pending events which were generated by previous actions, clearing the list
11001 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
11003 * Frees any resources associated with this object given its this_arg pointer.
11004 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11006 void (*free)(void *this_arg);
11007 } LDKMessageSendEventsProvider;
11010 * A trait implemented for objects handling events from [`EventsProvider`].
11012 typedef struct LDKEventHandler {
11014 * An opaque pointer which is passed to your function implementations as an argument.
11015 * This has no meaning in the LDK, and can be NULL or any other value.
11019 * Handles the given [`Event`].
11021 * See [`EventsProvider`] for details that must be considered when implementing this method.
11023 void (*handle_event)(const void *this_arg, const struct LDKEvent *NONNULL_PTR event);
11025 * Frees any resources associated with this object given its this_arg pointer.
11026 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11028 void (*free)(void *this_arg);
11032 * A trait indicating an object may generate events.
11034 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
11038 * See [`process_pending_events`] for requirements around event processing.
11040 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
11041 * event since the last invocation. The handler must either act upon the event immediately
11042 * or preserve it for later handling.
11044 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
11045 * consult the provider's documentation on the implication of processing events and how a handler
11046 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
11047 * [`ChainMonitor::process_pending_events`]).
11049 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
11052 * [`process_pending_events`]: Self::process_pending_events
11053 * [`handle_event`]: EventHandler::handle_event
11054 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
11055 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
11057 typedef struct LDKEventsProvider {
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 * Processes any events generated since the last call using the given event handler.
11066 * Subsequent calls must only process new events. However, handlers must be capable of handling
11067 * duplicate events across process restarts. This may occur if the provider was recovered from
11068 * an old state (i.e., it hadn't been successfully persisted after processing pending events).
11070 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
11072 * Frees any resources associated with this object given its this_arg pointer.
11073 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11075 void (*free)(void *this_arg);
11076 } LDKEventsProvider;
11081 * Lightning TLV uses a custom variable-length integer called BigSize. It is similar to Bitcoin's
11082 * variable-length integers except that it is serialized in big-endian instead of little-endian.
11084 * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
11085 * encoded in several different ways, which we must check for at deserialization-time. Thus, if
11086 * you're looking for an example of a variable-length integer to use for your own project, move
11087 * along, this is a rather poor design.
11089 typedef struct MUST_USE_STRUCT LDKBigSize {
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 LDKnativeBigSize *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.
11107 * Proposed use of a channel passed as a parameter to [`Score::channel_penalty_msat`].
11109 typedef struct MUST_USE_STRUCT LDKChannelUsage {
11111 * A pointer to the opaque Rust object.
11112 * Nearly everywhere, inner must be non-null, however in places where
11113 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11115 LDKnativeChannelUsage *inner;
11117 * Indicates that this is the only struct which contains the same pointer.
11118 * Rust functions which take ownership of an object provided via an argument require
11119 * this to be true and invalidate the object pointed to by inner.
11125 * An interface used to score payment channels for path finding.
11127 *\tScoring is in terms of fees willing to be paid in order to avoid routing through a channel.
11129 typedef struct LDKScore {
11131 * An opaque pointer which is passed to your function implementations as an argument.
11132 * This has no meaning in the LDK, and can be NULL or any other value.
11136 * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
11137 * given channel in the direction from `source` to `target`.
11139 * The channel's capacity (less any other MPP parts that are also being considered for use in
11140 * the same payment) is given by `capacity_msat`. It may be determined from various sources
11141 * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
11142 * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
11143 * Thus, implementations should be overflow-safe.
11145 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);
11147 * Handles updating channel penalties after failing to route through a channel.
11149 void (*payment_path_failed)(void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
11151 * Handles updating channel penalties after successfully routing along a path.
11153 void (*payment_path_successful)(void *this_arg, struct LDKCVec_RouteHopZ path);
11155 * Serialize the object into a byte array
11157 struct LDKCVec_u8Z (*write)(const void *this_arg);
11159 * Frees any resources associated with this object given its this_arg pointer.
11160 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11162 void (*free)(void *this_arg);
11168 * A concrete implementation of [`LockableScore`] which supports multi-threading.
11170 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
11172 * A pointer to the opaque Rust object.
11173 * Nearly everywhere, inner must be non-null, however in places where
11174 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11176 LDKnativeMultiThreadedLockableScore *inner;
11178 * Indicates that this is the only struct which contains the same pointer.
11179 * Rust functions which take ownership of an object provided via an argument require
11180 * this to be true and invalidate the object pointed to by inner.
11183 } LDKMultiThreadedLockableScore;
11186 * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`MultiThreadedLockableScore`] to disk.
11188 typedef struct LDKPersister {
11190 * An opaque pointer which is passed to your function implementations as an argument.
11191 * This has no meaning in the LDK, and can be NULL or any other value.
11195 * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
11197 struct LDKCResult_NoneErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
11199 * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
11201 struct LDKCResult_NoneErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
11203 * Persist the given [`MultiThreadedLockableScore`] to disk, returning an error if persistence failed.
11205 struct LDKCResult_NoneErrorZ (*persist_scorer)(const void *this_arg, const struct LDKMultiThreadedLockableScore *NONNULL_PTR scorer);
11207 * Frees any resources associated with this object given its this_arg pointer.
11208 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11210 void (*free)(void *this_arg);
11216 * Configuration we set when applicable.
11218 * Default::default() provides sane defaults.
11220 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
11222 * A pointer to the opaque Rust object.
11223 * Nearly everywhere, inner must be non-null, however in places where
11224 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11226 LDKnativeChannelHandshakeConfig *inner;
11228 * Indicates that this is the only struct which contains the same pointer.
11229 * Rust functions which take ownership of an object provided via an argument require
11230 * this to be true and invalidate the object pointed to by inner.
11233 } LDKChannelHandshakeConfig;
11238 * Optional channel limits which are applied during channel creation.
11240 * These limits are only applied to our counterparty's limits, not our own.
11242 * Use 0/<type>::max_value() as appropriate to skip checking.
11244 * Provides sane defaults for most configurations.
11246 * Most additional limits are disabled except those with which specify a default in individual
11247 * field documentation. Note that this may result in barely-usable channels, but since they
11248 * are applied mostly only to incoming channels that's not much of a problem.
11250 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
11252 * A pointer to the opaque Rust object.
11253 * Nearly everywhere, inner must be non-null, however in places where
11254 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11256 LDKnativeChannelHandshakeLimits *inner;
11258 * Indicates that this is the only struct which contains the same pointer.
11259 * Rust functions which take ownership of an object provided via an argument require
11260 * this to be true and invalidate the object pointed to by inner.
11263 } LDKChannelHandshakeLimits;
11268 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
11270 * Default::default() provides sane defaults for most configurations
11271 * (but currently with 0 relay fees!)
11273 typedef struct MUST_USE_STRUCT LDKUserConfig {
11275 * A pointer to the opaque Rust object.
11276 * Nearly everywhere, inner must be non-null, however in places where
11277 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11279 LDKnativeUserConfig *inner;
11281 * Indicates that this is the only struct which contains the same pointer.
11282 * Rust functions which take ownership of an object provided via an argument require
11283 * this to be true and invalidate the object pointed to by inner.
11291 * The best known block as identified by its hash and height.
11293 typedef struct MUST_USE_STRUCT LDKBestBlock {
11295 * A pointer to the opaque Rust object.
11296 * Nearly everywhere, inner must be non-null, however in places where
11297 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11299 LDKnativeBestBlock *inner;
11301 * Indicates that this is the only struct which contains the same pointer.
11302 * Rust functions which take ownership of an object provided via an argument require
11303 * this to be true and invalidate the object pointed to by inner.
11309 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
11312 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
11313 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
11314 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
11317 * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
11318 * entire header chain and only blocks with matching transaction data using BIP 157 filters or
11319 * other similar filtering.
11321 typedef struct LDKListen {
11323 * An opaque pointer which is passed to your function implementations as an argument.
11324 * This has no meaning in the LDK, and can be NULL or any other value.
11328 * Notifies the listener that a block was added at the given height, with the transaction data
11329 * possibly filtered.
11331 void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
11333 * Notifies the listener that a block was added at the given height.
11335 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
11337 * Notifies the listener that a block was removed at the given height.
11339 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
11341 * Frees any resources associated with this object given its this_arg pointer.
11342 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11344 void (*free)(void *this_arg);
11348 * The `Confirm` trait is used to notify when transactions have been confirmed on chain or
11349 * unconfirmed during a chain reorganization.
11351 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
11352 * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity
11353 * related to registered transactions and outputs. Upon notification, it would pass along the
11354 * matching transactions using this interface.
11358 * The intended use is as follows:
11359 * - Call [`transactions_confirmed`] to process any on-chain activity of interest.
11360 * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`]
11361 * that has been reorganized out of the chain.
11362 * - Call [`best_block_updated`] whenever a new chain tip becomes available.
11366 * Clients must call these methods in chain order. Specifically:
11367 * - Transactions confirmed in a block must be given before transactions confirmed in a later
11369 * - Dependent transactions within the same block must be given in topological order, possibly in
11371 * - Unconfirmed transactions must be given after the original confirmations and before any
11374 * See individual method documentation for further details.
11376 * [`transactions_confirmed`]: Self::transactions_confirmed
11377 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
11378 * [`best_block_updated`]: Self::best_block_updated
11379 * [`get_relevant_txids`]: Self::get_relevant_txids
11381 typedef struct LDKConfirm {
11383 * An opaque pointer which is passed to your function implementations as an argument.
11384 * This has no meaning in the LDK, and can be NULL or any other value.
11388 * Processes transactions confirmed in a block with a given header and height.
11390 * Should be called for any transactions registered by [`Filter::register_tx`] or any
11391 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
11392 * appearing in the same block do not need to be included in the same call; instead, multiple
11393 * calls with additional transactions may be made so long as they are made in [chain order].
11395 * May be called before or after [`best_block_updated`] for the corresponding block. However,
11396 * in the event of a chain reorganization, it must not be called with a `header` that is no
11397 * longer in the chain as of the last call to [`best_block_updated`].
11399 * [chain order]: Confirm#Order
11400 * [`best_block_updated`]: Self::best_block_updated
11402 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
11404 * Processes a transaction that is no longer confirmed as result of a chain reorganization.
11406 * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
11407 * reorganized out of the best chain. Once called, the given transaction should not be returned
11408 * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`].
11410 * [`get_relevant_txids`]: Self::get_relevant_txids
11411 * [`transactions_confirmed`]: Self::transactions_confirmed
11413 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
11415 * Processes an update to the best header connected at the given height.
11417 * Should be called when a new header is available but may be skipped for intermediary blocks
11418 * if they become available at the same time.
11420 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
11422 * Returns transactions that should be monitored for reorganization out of the chain.
11424 * Should include any transactions passed to [`transactions_confirmed`] that have insufficient
11425 * confirmations to be safe from a chain reorganization. Should not include any transactions
11426 * passed to [`transaction_unconfirmed`] unless later reconfirmed.
11428 * May be called to determine the subset of transactions that must still be monitored for
11429 * reorganization. Will be idempotent between calls but may change as a result of calls to the
11430 * other interface methods. Thus, this is useful to determine which transactions may need to be
11431 * given to [`transaction_unconfirmed`].
11433 * [`transactions_confirmed`]: Self::transactions_confirmed
11434 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
11436 struct LDKCVec_TxidZ (*get_relevant_txids)(const void *this_arg);
11438 * Frees any resources associated with this object given its this_arg pointer.
11439 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11441 void (*free)(void *this_arg);
11447 * An opaque identifier describing a specific [`Persist`] method call.
11449 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
11451 * A pointer to the opaque Rust object.
11452 * Nearly everywhere, inner must be non-null, however in places where
11453 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11455 LDKnativeMonitorUpdateId *inner;
11457 * Indicates that this is the only struct which contains the same pointer.
11458 * Rust functions which take ownership of an object provided via an argument require
11459 * this to be true and invalidate the object pointed to by inner.
11462 } LDKMonitorUpdateId;
11465 * `Persist` defines behavior for persisting channel monitors: this could mean
11466 * writing once to disk, and/or uploading to one or more backup services.
11468 * Each method can return three possible values:
11469 * * If persistence (including any relevant `fsync()` calls) happens immediately, the
11470 * implementation should return `Ok(())`, indicating normal channel operation should continue.
11471 * * If persistence happens asynchronously, implementations should first ensure the
11472 * [`ChannelMonitor`] or [`ChannelMonitorUpdate`] are written durably to disk, and then return
11473 * `Err(ChannelMonitorUpdateErr::TemporaryFailure)` while the update continues in the
11474 * background. Once the update completes, [`ChainMonitor::channel_monitor_updated`] should be
11475 * called with the corresponding [`MonitorUpdateId`].
11477 * Note that unlike the direct [`chain::Watch`] interface,
11478 * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
11480 * * If persistence fails for some reason, implementations should return
11481 * `Err(ChannelMonitorUpdateErr::PermanentFailure)`, in which case the channel will likely be
11482 * closed without broadcasting the latest state. See
11483 * [`ChannelMonitorUpdateErr::PermanentFailure`] for more details.
11485 typedef struct LDKPersist {
11487 * An opaque pointer which is passed to your function implementations as an argument.
11488 * This has no meaning in the LDK, and can be NULL or any other value.
11492 * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
11493 * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
11495 * The data can be stored any way you want, but the identifier provided by LDK is the
11496 * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
11497 * and the stored channel data). Note that you **must** persist every new monitor to disk.
11499 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
11500 * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
11502 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
11503 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
11505 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11506 * [`Writeable::write`]: crate::util::ser::Writeable::write
11508 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
11510 * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
11513 * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
11514 * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
11517 * During blockchain synchronization operations, this may be called with no
11518 * [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
11519 * Note that after the full [`ChannelMonitor`] is persisted any previous
11520 * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
11521 * applied to the persisted [`ChannelMonitor`] as they were already applied.
11523 * If an implementer chooses to persist the updates only, they need to make
11524 * sure that all the updates are applied to the `ChannelMonitors` *before*
11525 * the set of channel monitors is given to the `ChannelManager`
11526 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
11527 * applying a monitor update to a monitor. If full `ChannelMonitors` are
11528 * persisted, then there is no need to persist individual updates.
11530 * Note that there could be a performance tradeoff between persisting complete
11531 * channel monitors on every update vs. persisting only updates and applying
11532 * them in batches. The size of each monitor grows `O(number of state updates)`
11533 * whereas updates are small and `O(1)`.
11535 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
11536 * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
11538 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
11539 * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
11540 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
11542 * [`Writeable::write`]: crate::util::ser::Writeable::write
11544 * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
11546 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);
11548 * Frees any resources associated with this object given its this_arg pointer.
11549 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11551 void (*free)(void *this_arg);
11557 * An implementation of [`chain::Watch`] for monitoring channels.
11559 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
11560 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
11561 * or used independently to monitor channels remotely. See the [module-level documentation] for
11564 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11565 * [module-level documentation]: crate::chain::chainmonitor
11567 typedef struct MUST_USE_STRUCT LDKChainMonitor {
11569 * A pointer to the opaque Rust object.
11570 * Nearly everywhere, inner must be non-null, however in places where
11571 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11573 LDKnativeChainMonitor *inner;
11575 * Indicates that this is the only struct which contains the same pointer.
11576 * Rust functions which take ownership of an object provided via an argument require
11577 * this to be true and invalidate the object pointed to by inner.
11585 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
11586 * and derives keys from that.
11588 * Your node_id is seed/0'
11589 * ChannelMonitor closes may use seed/1'
11590 * Cooperative closes may use seed/2'
11591 * The two close keys may be needed to claim on-chain funds!
11593 * This struct cannot be used for nodes that wish to support receiving phantom payments;
11594 * [`PhantomKeysManager`] must be used instead.
11596 * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
11597 * previously issued invoices and attempts to pay previous invoices will fail.
11599 typedef struct MUST_USE_STRUCT LDKKeysManager {
11601 * A pointer to the opaque Rust object.
11602 * Nearly everywhere, inner must be non-null, however in places where
11603 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11605 LDKnativeKeysManager *inner;
11607 * Indicates that this is the only struct which contains the same pointer.
11608 * Rust functions which take ownership of an object provided via an argument require
11609 * this to be true and invalidate the object pointed to by inner.
11617 * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
11620 * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
11621 * paid to one of multiple nodes. This works because we encode the invoice route hints such that
11622 * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
11623 * itself without ever needing to forward to this fake node.
11625 * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
11626 * provide some fault tolerance, because payers will automatically retry paying other provided
11627 * nodes in the case that one node goes down.
11629 * Note that multi-path payments are not supported in phantom invoices for security reasons.
11630 * Switching between this struct and [`KeysManager`] will invalidate any previously issued
11631 * invoices and attempts to pay previous invoices will fail.
11633 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
11635 * A pointer to the opaque Rust object.
11636 * Nearly everywhere, inner must be non-null, however in places where
11637 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11639 LDKnativePhantomKeysManager *inner;
11641 * Indicates that this is the only struct which contains the same pointer.
11642 * Rust functions which take ownership of an object provided via an argument require
11643 * this to be true and invalidate the object pointed to by inner.
11646 } LDKPhantomKeysManager;
11651 * Chain-related parameters used to construct a new `ChannelManager`.
11653 * Typically, the block-specific parameters are derived from the best block hash for the network,
11654 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
11655 * are not needed when deserializing a previously constructed `ChannelManager`.
11657 typedef struct MUST_USE_STRUCT LDKChainParameters {
11659 * A pointer to the opaque Rust object.
11660 * Nearly everywhere, inner must be non-null, however in places where
11661 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11663 LDKnativeChainParameters *inner;
11665 * Indicates that this is the only struct which contains the same pointer.
11666 * Rust functions which take ownership of an object provided via an argument require
11667 * this to be true and invalidate the object pointed to by inner.
11670 } LDKChainParameters;
11673 * A 3-byte byte array.
11675 typedef struct LDKThreeBytes {
11683 * A trait to describe an object which can receive channel messages.
11685 * Messages MAY be called in parallel when they originate from different their_node_ids, however
11686 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
11688 typedef struct LDKChannelMessageHandler {
11690 * An opaque pointer which is passed to your function implementations as an argument.
11691 * This has no meaning in the LDK, and can be NULL or any other value.
11695 * Handle an incoming open_channel message from the given peer.
11697 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
11699 * Handle an incoming accept_channel message from the given peer.
11701 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
11703 * Handle an incoming funding_created message from the given peer.
11705 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
11707 * Handle an incoming funding_signed message from the given peer.
11709 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
11711 * Handle an incoming channel_ready message from the given peer.
11713 void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
11715 * Handle an incoming shutdown message from the given peer.
11717 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);
11719 * Handle an incoming closing_signed message from the given peer.
11721 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
11723 * Handle an incoming update_add_htlc message from the given peer.
11725 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
11727 * Handle an incoming update_fulfill_htlc message from the given peer.
11729 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
11731 * Handle an incoming update_fail_htlc message from the given peer.
11733 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
11735 * Handle an incoming update_fail_malformed_htlc message from the given peer.
11737 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
11739 * Handle an incoming commitment_signed message from the given peer.
11741 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
11743 * Handle an incoming revoke_and_ack message from the given peer.
11745 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
11747 * Handle an incoming update_fee message from the given peer.
11749 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
11751 * Handle an incoming announcement_signatures message from the given peer.
11753 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
11755 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
11756 * is believed to be possible in the future (eg they're sending us messages we don't
11757 * understand or indicate they require unknown feature bits), no_connection_possible is set
11758 * and any outstanding channels should be failed.
11760 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
11762 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
11764 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
11766 * Handle an incoming channel_reestablish message from the given peer.
11768 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
11770 * Handle an incoming channel update from the given peer.
11772 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
11774 * Handle an incoming error message from the given peer.
11776 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
11778 * Implementation of MessageSendEventsProvider for this object.
11780 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
11782 * Frees any resources associated with this object given its this_arg pointer.
11783 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11785 void (*free)(void *this_arg);
11786 } LDKChannelMessageHandler;
11791 * Arguments for the creation of a ChannelManager that are not deserialized.
11793 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
11795 * 1) Deserialize all stored [`ChannelMonitor`]s.
11796 * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
11797 * `<(BlockHash, ChannelManager)>::read(reader, args)`
11798 * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
11799 * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
11800 * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
11801 * same way you would handle a [`chain::Filter`] call using
11802 * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
11803 * 4) Reconnect blocks on your [`ChannelMonitor`]s.
11804 * 5) Disconnect/connect blocks on the [`ChannelManager`].
11805 * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
11806 * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
11807 * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
11809 * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
11810 * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
11812 * Note that the ordering of #4-7 is not of importance, however all four must occur before you
11813 * call any other methods on the newly-deserialized [`ChannelManager`].
11815 * Note that because some channels may be closed during deserialization, it is critical that you
11816 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
11817 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
11818 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
11819 * not force-close the same channels but consider them live), you may end up revoking a state for
11820 * which you've already broadcasted the transaction.
11822 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
11824 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
11826 * A pointer to the opaque Rust object.
11827 * Nearly everywhere, inner must be non-null, however in places where
11828 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11830 LDKnativeChannelManagerReadArgs *inner;
11832 * Indicates that this is the only struct which contains the same pointer.
11833 * Rust functions which take ownership of an object provided via an argument require
11834 * this to be true and invalidate the object pointed to by inner.
11837 } LDKChannelManagerReadArgs;
11842 * A set of keys that were HKDF-expanded from an initial call to
11843 * [`KeysInterface::get_inbound_payment_key_material`].
11845 * [`KeysInterface::get_inbound_payment_key_material`]: crate::chain::keysinterface::KeysInterface::get_inbound_payment_key_material
11847 typedef struct MUST_USE_STRUCT LDKExpandedKey {
11849 * A pointer to the opaque Rust object.
11850 * Nearly everywhere, inner must be non-null, however in places where
11851 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11853 LDKnativeExpandedKey *inner;
11855 * Indicates that this is the only struct which contains the same pointer.
11856 * Rust functions which take ownership of an object provided via an argument require
11857 * this to be true and invalidate the object pointed to by inner.
11865 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
11866 * This is used to convince the recipient that the channel is at a certain commitment
11867 * number even if they lost that data due to a local failure. Of course, the peer may lie
11868 * and even later commitments may have been revoked.
11870 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
11872 * A pointer to the opaque Rust object.
11873 * Nearly everywhere, inner must be non-null, however in places where
11874 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11876 LDKnativeDataLossProtect *inner;
11878 * Indicates that this is the only struct which contains the same pointer.
11879 * Rust functions which take ownership of an object provided via an argument require
11880 * this to be true and invalidate the object pointed to by inner.
11883 } LDKDataLossProtect;
11886 * A trait to describe an object which can receive routing messages.
11888 * # Implementor DoS Warnings
11890 * For `gossip_queries` messages there are potential DoS vectors when handling
11891 * inbound queries. Implementors using an on-disk network graph should be aware of
11892 * repeated disk I/O for queries accessing different parts of the network graph.
11894 typedef struct LDKRoutingMessageHandler {
11896 * An opaque pointer which is passed to your function implementations as an argument.
11897 * This has no meaning in the LDK, and can be NULL or any other value.
11901 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
11902 * false or returning an Err otherwise.
11904 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
11906 * Handle a channel_announcement message, returning true if it should be forwarded on, false
11907 * or returning an Err otherwise.
11909 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
11911 * Handle an incoming channel_update message, returning true if it should be forwarded on,
11912 * false or returning an Err otherwise.
11914 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
11916 * Gets a subset of the channel announcements and updates required to dump our routing table
11917 * to a remote node, starting at the short_channel_id indicated by starting_point and
11918 * including the batch_amount entries immediately higher in numerical value than starting_point.
11920 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
11922 * Gets a subset of the node announcements required to dump our routing table to a remote node,
11923 * starting at the node *after* the provided publickey and including batch_amount entries
11924 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
11925 * If None is provided for starting_point, we start at the first node.
11927 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
11929 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
11931 * Called when a connection is established with a peer. This can be used to
11932 * perform routing table synchronization using a strategy defined by the
11935 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
11937 * Handles the reply of a query we initiated to learn about channels
11938 * for a given range of blocks. We can expect to receive one or more
11939 * replies to a single query.
11941 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
11943 * Handles the reply of a query we initiated asking for routing gossip
11944 * messages for a list of channels. We should receive this message when
11945 * a node has completed its best effort to send us the pertaining routing
11948 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
11950 * Handles when a peer asks us to send a list of short_channel_ids
11951 * for the requested range of blocks.
11953 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
11955 * Handles when a peer asks us to send routing gossip messages for a
11956 * list of short_channel_ids.
11958 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
11960 * Implementation of MessageSendEventsProvider for this object.
11962 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
11964 * Frees any resources associated with this object given its this_arg pointer.
11965 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11967 void (*free)(void *this_arg);
11968 } LDKRoutingMessageHandler;
11971 * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
11974 typedef struct LDKCustomMessageReader {
11976 * An opaque pointer which is passed to your function implementations as an argument.
11977 * This has no meaning in the LDK, and can be NULL or any other value.
11981 * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
11982 * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
11983 * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
11984 * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
11986 struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
11988 * Frees any resources associated with this object given its this_arg pointer.
11989 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11991 void (*free)(void *this_arg);
11992 } LDKCustomMessageReader;
11995 * Handler for BOLT1-compliant messages.
11997 typedef struct LDKCustomMessageHandler {
11999 * An opaque pointer which is passed to your function implementations as an argument.
12000 * This has no meaning in the LDK, and can be NULL or any other value.
12004 * Called with the message type that was received and the buffer to be read.
12005 * Can return a `MessageHandlingError` if the message could not be handled.
12007 struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
12009 * Gets the list of pending messages which were generated by the custom message
12010 * handler, clearing the list in the process. The first tuple element must
12011 * correspond to the intended recipients node ids. If no connection to one of the
12012 * specified node does not exist, the message is simply not sent to it.
12014 struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
12016 * Implementation of CustomMessageReader for this object.
12018 struct LDKCustomMessageReader CustomMessageReader;
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 } LDKCustomMessageHandler;
12029 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
12030 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
12032 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
12034 * A pointer to the opaque Rust object.
12035 * Nearly everywhere, inner must be non-null, however in places where
12036 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12038 LDKnativeIgnoringMessageHandler *inner;
12040 * Indicates that this is the only struct which contains the same pointer.
12041 * Rust functions which take ownership of an object provided via an argument require
12042 * this to be true and invalidate the object pointed to by inner.
12045 } LDKIgnoringMessageHandler;
12050 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
12051 * You can provide one of these as the route_handler in a MessageHandler.
12053 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
12055 * A pointer to the opaque Rust object.
12056 * Nearly everywhere, inner must be non-null, however in places where
12057 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12059 LDKnativeErroringMessageHandler *inner;
12061 * Indicates that this is the only struct which contains the same pointer.
12062 * Rust functions which take ownership of an object provided via an argument require
12063 * this to be true and invalidate the object pointed to by inner.
12066 } LDKErroringMessageHandler;
12071 * Provides references to trait impls which handle different types of messages.
12073 typedef struct MUST_USE_STRUCT LDKMessageHandler {
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 LDKnativeMessageHandler *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 } LDKMessageHandler;
12089 * Provides an object which can be used to send data to and which uniquely identifies a connection
12090 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
12091 * implement Hash to meet the PeerManager API.
12093 * For efficiency, Clone should be relatively cheap for this type.
12095 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
12096 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
12097 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
12098 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
12099 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
12100 * to simply use another value which is guaranteed to be globally unique instead.
12102 typedef struct LDKSocketDescriptor {
12104 * An opaque pointer which is passed to your function implementations as an argument.
12105 * This has no meaning in the LDK, and can be NULL or any other value.
12109 * Attempts to send some data from the given slice to the peer.
12111 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
12112 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
12113 * called and further write attempts may occur until that time.
12115 * If the returned size is smaller than `data.len()`, a
12116 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
12117 * written. Additionally, until a `send_data` event completes fully, no further
12118 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
12119 * prevent denial-of-service issues, you should not read or buffer any data from the socket
12122 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
12123 * (indicating that read events should be paused to prevent DoS in the send buffer),
12124 * `resume_read` may be set indicating that read events on this descriptor should resume. A
12125 * `resume_read` of false carries no meaning, and should not cause any action.
12127 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
12129 * Disconnect the socket pointed to by this SocketDescriptor.
12131 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
12132 * call (doing so is a noop).
12134 void (*disconnect_socket)(void *this_arg);
12136 * Checks if two objects are equal given this object's this_arg pointer and another object.
12138 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
12140 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
12141 * This is used, for example, for inclusion of this object in a hash map.
12143 uint64_t (*hash)(const void *this_arg);
12145 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
12146 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
12147 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
12149 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
12151 * Frees any resources associated with this object given its this_arg pointer.
12152 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12154 void (*free)(void *this_arg);
12155 } LDKSocketDescriptor;
12160 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
12161 * socket events into messages which it passes on to its [`MessageHandler`].
12163 * Locks are taken internally, so you must never assume that reentrancy from a
12164 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
12166 * Calls to [`read_event`] will decode relevant messages and pass them to the
12167 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
12168 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
12169 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
12170 * calls only after previous ones have returned.
12172 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
12173 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
12174 * essentially you should default to using a SimpleRefPeerManager, and use a
12175 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
12176 * you're using lightning-net-tokio.
12178 * [`read_event`]: PeerManager::read_event
12180 typedef struct MUST_USE_STRUCT LDKPeerManager {
12182 * A pointer to the opaque Rust object.
12183 * Nearly everywhere, inner must be non-null, however in places where
12184 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12186 LDKnativePeerManager *inner;
12188 * Indicates that this is the only struct which contains the same pointer.
12189 * Rust functions which take ownership of an object provided via an argument require
12190 * this to be true and invalidate the object pointed to by inner.
12198 * Static channel fields used to build transactions given per-commitment fields, organized by
12199 * broadcaster/countersignatory.
12201 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
12202 * as_holder_broadcastable and as_counterparty_broadcastable functions.
12204 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
12206 * A pointer to the opaque Rust object.
12207 * Nearly everywhere, inner must be non-null, however in places where
12208 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12210 LDKnativeDirectedChannelTransactionParameters *inner;
12212 * Indicates that this is the only struct which contains the same pointer.
12213 * Rust functions which take ownership of an object provided via an argument require
12214 * this to be true and invalidate the object pointed to by inner.
12217 } LDKDirectedChannelTransactionParameters;
12220 * Integer in the range `0..=16`
12222 typedef struct LDKWitnessVersion {
12224 } LDKWitnessVersion;
12229 * A read-only view of [`NetworkGraph`].
12231 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
12233 * A pointer to the opaque Rust object.
12234 * Nearly everywhere, inner must be non-null, however in places where
12235 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12237 LDKnativeReadOnlyNetworkGraph *inner;
12239 * Indicates that this is the only struct which contains the same pointer.
12240 * Rust functions which take ownership of an object provided via an argument require
12241 * this to be true and invalidate the object pointed to by inner.
12244 } LDKReadOnlyNetworkGraph;
12249 * Receives and validates network updates from peers,
12250 * stores authentic and relevant data as a network graph.
12251 * This network graph is then used for routing payments.
12252 * Provides interface to help with initial routing sync by
12253 * serving historical announcements.
12255 * Serves as an [`EventHandler`] for applying updates from [`Event::PaymentPathFailed`] to the
12256 * [`NetworkGraph`].
12258 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
12260 * A pointer to the opaque Rust object.
12261 * Nearly everywhere, inner must be non-null, however in places where
12262 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12264 LDKnativeP2PGossipSync *inner;
12266 * Indicates that this is the only struct which contains the same pointer.
12267 * Rust functions which take ownership of an object provided via an argument require
12268 * this to be true and invalidate the object pointed to by inner.
12271 } LDKP2PGossipSync;
12276 * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
12277 * source node to a target node.
12279 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
12281 * A pointer to the opaque Rust object.
12282 * Nearly everywhere, inner must be non-null, however in places where
12283 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12285 LDKnativeDirectedChannelInfo *inner;
12287 * Indicates that this is the only struct which contains the same pointer.
12288 * Rust functions which take ownership of an object provided via an argument require
12289 * this to be true and invalidate the object pointed to by inner.
12292 } LDKDirectedChannelInfo;
12295 * The effective capacity of a channel for routing purposes.
12297 * While this may be smaller than the actual channel capacity, amounts greater than
12298 * [`Self::as_msat`] should not be routed through the channel.
12300 typedef enum LDKEffectiveCapacity_Tag {
12302 * The available liquidity in the channel known from being a channel counterparty, and thus a
12305 LDKEffectiveCapacity_ExactLiquidity,
12307 * The maximum HTLC amount in one direction as advertised on the gossip network.
12309 LDKEffectiveCapacity_MaximumHTLC,
12311 * The total capacity of the channel as determined by the funding transaction.
12313 LDKEffectiveCapacity_Total,
12315 * A capacity sufficient to route any payment, typically used for private channels provided by
12318 LDKEffectiveCapacity_Infinite,
12320 * A capacity that is unknown possibly because either the chain state is unavailable to know
12321 * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
12323 LDKEffectiveCapacity_Unknown,
12325 * Must be last for serialization purposes
12327 LDKEffectiveCapacity_Sentinel,
12328 } LDKEffectiveCapacity_Tag;
12330 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
12332 * Either the inbound or outbound liquidity depending on the direction, denominated in
12335 uint64_t liquidity_msat;
12336 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
12338 typedef struct LDKEffectiveCapacity_LDKMaximumHTLC_Body {
12340 * The maximum HTLC amount denominated in millisatoshi.
12342 uint64_t amount_msat;
12343 } LDKEffectiveCapacity_LDKMaximumHTLC_Body;
12345 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
12347 * The funding amount denominated in millisatoshi.
12349 uint64_t capacity_msat;
12351 * The maximum HTLC amount denominated in millisatoshi.
12353 struct LDKCOption_u64Z htlc_maximum_msat;
12354 } LDKEffectiveCapacity_LDKTotal_Body;
12356 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
12357 LDKEffectiveCapacity_Tag tag;
12359 LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
12360 LDKEffectiveCapacity_LDKMaximumHTLC_Body maximum_htlc;
12361 LDKEffectiveCapacity_LDKTotal_Body total;
12363 } LDKEffectiveCapacity;
12366 * A scorer that is accessed under a lock.
12368 * Needed so that calls to [`Score::channel_penalty_msat`] in [`find_route`] can be made while
12369 * having shared ownership of a scorer but without requiring internal locking in [`Score`]
12370 * implementations. Internal locking would be detrimental to route finding performance and could
12371 * result in [`Score::channel_penalty_msat`] returning a different value for the same channel.
12373 * [`find_route`]: crate::routing::router::find_route
12375 typedef struct LDKLockableScore {
12377 * An opaque pointer which is passed to your function implementations as an argument.
12378 * This has no meaning in the LDK, and can be NULL or any other value.
12382 * Returns the locked scorer.
12384 struct LDKScore (*lock)(const void *this_arg);
12386 * Frees any resources associated with this object given its this_arg pointer.
12387 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12389 void (*free)(void *this_arg);
12390 } LDKLockableScore;
12395 * Parameters for configuring [`ProbabilisticScorer`].
12397 * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
12398 * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
12400 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringParameters {
12402 * A pointer to the opaque Rust object.
12403 * Nearly everywhere, inner must be non-null, however in places where
12404 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12406 LDKnativeProbabilisticScoringParameters *inner;
12408 * Indicates that this is the only struct which contains the same pointer.
12409 * Rust functions which take ownership of an object provided via an argument require
12410 * this to be true and invalidate the object pointed to by inner.
12413 } LDKProbabilisticScoringParameters;
12418 * FilesystemPersister persists channel data on disk, where each channel's
12419 * data is stored in a file named after its funding outpoint.
12421 * Warning: this module does the best it can with calls to persist data, but it
12422 * can only guarantee that the data is passed to the drive. It is up to the
12423 * drive manufacturers to do the actual persistence properly, which they often
12424 * don't (especially on consumer-grade hardware). Therefore, it is up to the
12425 * user to validate their entire storage stack, to ensure the writes are
12427 * Corollary: especially when dealing with larger amounts of money, it is best
12428 * practice to have multiple channel data backups and not rely only on one
12429 * FilesystemPersister.
12431 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
12433 * A pointer to the opaque Rust object.
12434 * Nearly everywhere, inner must be non-null, however in places where
12435 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12437 LDKnativeFilesystemPersister *inner;
12439 * Indicates that this is the only struct which contains the same pointer.
12440 * Rust functions which take ownership of an object provided via an argument require
12441 * this to be true and invalidate the object pointed to by inner.
12444 } LDKFilesystemPersister;
12449 * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
12450 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
12451 * responsibilities are:
12452 * * Processing [`Event`]s with a user-provided [`EventHandler`].
12453 * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
12454 * writing it to disk/backups by invoking the callback given to it at startup.
12455 * [`ChannelManager`] persistence should be done in the background.
12456 * * Calling [`ChannelManager::timer_tick_occurred`] and [`PeerManager::timer_tick_occurred`]
12457 * at the appropriate intervals.
12458 * * Calling [`NetworkGraph::remove_stale_channels`] (if a [`GossipSync`] with a [`NetworkGraph`]
12459 * is provided to [`BackgroundProcessor::start`]).
12461 * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
12462 * upon as doing so may result in high latency.
12466 * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
12467 * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
12468 * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
12469 * unilateral chain closure fees are at risk.
12471 * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
12472 * [`Event`]: lightning::util::events::Event
12473 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
12475 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
12477 * A pointer to the opaque Rust object.
12478 * Nearly everywhere, inner must be non-null, however in places where
12479 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12481 LDKnativeBackgroundProcessor *inner;
12483 * Indicates that this is the only struct which contains the same pointer.
12484 * Rust functions which take ownership of an object provided via an argument require
12485 * this to be true and invalidate the object pointed to by inner.
12488 } LDKBackgroundProcessor;
12493 * Rapid Gossip Sync struct
12494 * See [crate-level documentation] for usage.
12496 * [crate-level documentation]: crate
12498 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
12500 * A pointer to the opaque Rust object.
12501 * Nearly everywhere, inner must be non-null, however in places where
12502 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12504 LDKnativeRapidGossipSync *inner;
12506 * Indicates that this is the only struct which contains the same pointer.
12507 * Rust functions which take ownership of an object provided via an argument require
12508 * this to be true and invalidate the object pointed to by inner.
12511 } LDKRapidGossipSync;
12514 * Either [`P2PGossipSync`] or [`RapidGossipSync`].
12516 typedef enum LDKGossipSync_Tag {
12518 * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
12522 * Rapid gossip sync from a trusted server.
12524 LDKGossipSync_Rapid,
12528 LDKGossipSync_None,
12530 * Must be last for serialization purposes
12532 LDKGossipSync_Sentinel,
12533 } LDKGossipSync_Tag;
12535 typedef struct MUST_USE_STRUCT LDKGossipSync {
12536 LDKGossipSync_Tag tag;
12540 * Note that this field is expected to be a reference.
12542 struct LDKP2PGossipSync p2p;
12546 * Note that this field is expected to be a reference.
12548 struct LDKRapidGossipSync rapid;
12556 * Data of the `RawInvoice` that is encoded in the data part
12558 typedef struct MUST_USE_STRUCT LDKRawDataPart {
12560 * A pointer to the opaque Rust object.
12561 * Nearly everywhere, inner must be non-null, however in places where
12562 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12564 LDKnativeRawDataPart *inner;
12566 * Indicates that this is the only struct which contains the same pointer.
12567 * Rust functions which take ownership of an object provided via an argument require
12568 * this to be true and invalidate the object pointed to by inner.
12578 typedef struct MUST_USE_STRUCT LDKSha256 {
12580 * A pointer to the opaque Rust object.
12581 * Nearly everywhere, inner must be non-null, however in places where
12582 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12584 LDKnativeSha256 *inner;
12586 * Indicates that this is the only struct which contains the same pointer.
12587 * Rust functions which take ownership of an object provided via an argument require
12588 * this to be true and invalidate the object pointed to by inner.
12596 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
12599 typedef struct MUST_USE_STRUCT LDKExpiryTime {
12601 * A pointer to the opaque Rust object.
12602 * Nearly everywhere, inner must be non-null, however in places where
12603 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12605 LDKnativeExpiryTime *inner;
12607 * Indicates that this is the only struct which contains the same pointer.
12608 * Rust functions which take ownership of an object provided via an argument require
12609 * this to be true and invalidate the object pointed to by inner.
12617 * `min_final_cltv_expiry` to use for the last HTLC in the route
12619 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiry {
12621 * A pointer to the opaque Rust object.
12622 * Nearly everywhere, inner must be non-null, however in places where
12623 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12625 LDKnativeMinFinalCltvExpiry *inner;
12627 * Indicates that this is the only struct which contains the same pointer.
12628 * Rust functions which take ownership of an object provided via an argument require
12629 * this to be true and invalidate the object pointed to by inner.
12632 } LDKMinFinalCltvExpiry;
12635 * A 20-byte byte array.
12637 typedef struct LDKTwentyBytes {
12645 * Fallback address in case no LN payment is possible
12647 typedef enum LDKFallback_Tag {
12648 LDKFallback_SegWitProgram,
12649 LDKFallback_PubKeyHash,
12650 LDKFallback_ScriptHash,
12652 * Must be last for serialization purposes
12654 LDKFallback_Sentinel,
12657 typedef struct LDKFallback_LDKSegWitProgram_Body {
12658 struct LDKu5 version;
12659 struct LDKCVec_u8Z program;
12660 } LDKFallback_LDKSegWitProgram_Body;
12662 typedef struct MUST_USE_STRUCT LDKFallback {
12663 LDKFallback_Tag tag;
12665 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
12667 struct LDKTwentyBytes pub_key_hash;
12670 struct LDKTwentyBytes script_hash;
12676 * A trait defining behavior of an [`Invoice`] payer.
12678 typedef struct LDKPayer {
12680 * An opaque pointer which is passed to your function implementations as an argument.
12681 * This has no meaning in the LDK, and can be NULL or any other value.
12685 * Returns the payer's node id.
12687 struct LDKPublicKey (*node_id)(const void *this_arg);
12689 * Returns the payer's channels.
12691 struct LDKCVec_ChannelDetailsZ (*first_hops)(const void *this_arg);
12693 * Sends a payment over the Lightning Network using the given [`Route`].
12695 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
12697 struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
12699 * Sends a spontaneous payment over the Lightning Network using the given [`Route`].
12701 struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_spontaneous_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage);
12703 * Retries a failed payment path for the [`PaymentId`] using the given [`Route`].
12705 struct LDKCResult_NonePaymentSendFailureZ (*retry_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id);
12707 * Signals that no further retries for the given payment will occur.
12709 void (*abandon_payment)(const void *this_arg, struct LDKThirtyTwoBytes payment_id);
12711 * Frees any resources associated with this object given its this_arg pointer.
12712 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12714 void (*free)(void *this_arg);
12718 * A trait defining behavior for routing an [`Invoice`] payment.
12720 typedef struct LDKRouter {
12722 * An opaque pointer which is passed to your function implementations as an argument.
12723 * This has no meaning in the LDK, and can be NULL or any other value.
12727 * Finds a [`Route`] between `payer` and `payee` for a payment with the given values.
12729 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
12731 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);
12733 * Frees any resources associated with this object given its this_arg pointer.
12734 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12736 void (*free)(void *this_arg);
12742 * A utility for paying [`Invoice`]s and sending spontaneous payments.
12744 * See [module-level documentation] for details.
12746 * [module-level documentation]: crate::payment
12748 typedef struct MUST_USE_STRUCT LDKInvoicePayer {
12750 * A pointer to the opaque Rust object.
12751 * Nearly everywhere, inner must be non-null, however in places where
12752 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12754 LDKnativeInvoicePayer *inner;
12756 * Indicates that this is the only struct which contains the same pointer.
12757 * Rust functions which take ownership of an object provided via an argument require
12758 * this to be true and invalidate the object pointed to by inner.
12764 * Strategies available to retry payment path failures for an [`Invoice`].
12767 typedef enum LDKRetry_Tag {
12769 * Max number of attempts to retry payment.
12771 * Note that this is the number of *path* failures, not full payment retries. For multi-path
12772 * payments, if this is less than the total number of paths, we will never even retry all of the
12777 * Time elapsed before abandoning retries for a payment.
12781 * Must be last for serialization purposes
12786 typedef struct MUST_USE_STRUCT LDKRetry {
12790 uintptr_t attempts;
12801 * A [`Router`] implemented using [`find_route`].
12803 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
12805 * A pointer to the opaque Rust object.
12806 * Nearly everywhere, inner must be non-null, however in places where
12807 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12809 LDKnativeDefaultRouter *inner;
12811 * Indicates that this is the only struct which contains the same pointer.
12812 * Rust functions which take ownership of an object provided via an argument require
12813 * this to be true and invalidate the object pointed to by inner.
12816 } LDKDefaultRouter;
12818 extern const uintptr_t MAX_BUF_SIZE;
12820 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
12822 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
12824 extern const uint32_t ANTI_REORG_DELAY;
12826 extern const uint16_t BREAKDOWN_TIMEOUT;
12828 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
12830 extern const uint32_t MIN_FINAL_CLTV_EXPIRY;
12832 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
12834 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
12836 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
12838 extern const uint8_t DEFAULT_MAX_MPP_PATH_COUNT;
12840 extern const uint64_t MAX_TIMESTAMP;
12842 extern const uint64_t DEFAULT_EXPIRY_TIME;
12844 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY;
12846 extern const uint8_t TAG_PAYMENT_HASH;
12848 extern const uint8_t TAG_DESCRIPTION;
12850 extern const uint8_t TAG_PAYEE_PUB_KEY;
12852 extern const uint8_t TAG_DESCRIPTION_HASH;
12854 extern const uint8_t TAG_EXPIRY_TIME;
12856 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
12858 extern const uint8_t TAG_FALLBACK;
12860 extern const uint8_t TAG_PRIVATE_ROUTE;
12862 extern const uint8_t TAG_PAYMENT_SECRET;
12864 extern const uint8_t TAG_FEATURES;
12866 struct LDKStr _ldk_get_compiled_version(void);
12868 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
12871 * Creates a new Bech32Error which has the same data as `orig`
12873 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
12876 * Releases any memory held by the given `Bech32Error` (which is currently none)
12878 void Bech32Error_free(struct LDKBech32Error o);
12881 * Frees the data buffer, if data_is_owned is set and datalen > 0.
12883 void Transaction_free(struct LDKTransaction _res);
12886 * Convenience function for constructing a new TxOut
12888 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
12891 * Frees the data pointed to by script_pubkey.
12893 void TxOut_free(struct LDKTxOut _res);
12896 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
12898 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
12901 * Frees the data buffer, if chars_is_owned is set and len > 0.
12903 void Str_free(struct LDKStr _res);
12905 #if defined(LDK_DEBUG_BUILD)
12907 * This function exists for memory safety testing purposes. It should never be used in production
12910 const void *__unmangle_inner_ptr(const void *ptr);
12914 * Creates a new CResult_NoneNoneZ in the success state.
12916 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
12919 * Creates a new CResult_NoneNoneZ in the error state.
12921 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
12924 * Checks if the given object is currently in the success state
12926 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
12929 * Frees any resources used by the CResult_NoneNoneZ.
12931 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
12934 * Creates a new CResult_NoneNoneZ which has the same data as `orig`
12935 * but with all dynamically-allocated buffers duplicated in new buffers.
12937 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
12940 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
12942 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
12945 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
12947 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
12950 * Checks if the given object is currently in the success state
12952 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
12955 * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
12957 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
12960 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
12961 * but with all dynamically-allocated buffers duplicated in new buffers.
12963 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
12966 * Creates a new CResult_SecretKeyErrorZ in the success state.
12968 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
12971 * Creates a new CResult_SecretKeyErrorZ in the error state.
12973 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
12976 * Checks if the given object is currently in the success state
12978 bool CResult_SecretKeyErrorZ_is_ok(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR o);
12981 * Frees any resources used by the CResult_SecretKeyErrorZ.
12983 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
12986 * Creates a new CResult_SecretKeyErrorZ which has the same data as `orig`
12987 * but with all dynamically-allocated buffers duplicated in new buffers.
12989 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_clone(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR orig);
12992 * Creates a new CResult_PublicKeyErrorZ in the success state.
12994 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
12997 * Creates a new CResult_PublicKeyErrorZ in the error state.
12999 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
13002 * Checks if the given object is currently in the success state
13004 bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o);
13007 * Frees any resources used by the CResult_PublicKeyErrorZ.
13009 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
13012 * Creates a new CResult_PublicKeyErrorZ which has the same data as `orig`
13013 * but with all dynamically-allocated buffers duplicated in new buffers.
13015 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig);
13018 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
13020 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
13023 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
13025 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
13028 * Checks if the given object is currently in the success state
13030 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
13033 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
13035 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
13038 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
13039 * but with all dynamically-allocated buffers duplicated in new buffers.
13041 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
13044 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
13046 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
13049 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
13051 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
13054 * Checks if the given object is currently in the success state
13056 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
13059 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
13061 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
13064 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
13065 * but with all dynamically-allocated buffers duplicated in new buffers.
13067 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
13070 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
13072 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
13075 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
13077 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
13080 * Checks if the given object is currently in the success state
13082 bool CResult_TxCreationKeysErrorZ_is_ok(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR o);
13085 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
13087 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
13090 * Creates a new CResult_TxCreationKeysErrorZ which has the same data as `orig`
13091 * but with all dynamically-allocated buffers duplicated in new buffers.
13093 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_clone(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR orig);
13096 * Constructs a new COption_u32Z containing a u32
13098 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
13101 * Constructs a new COption_u32Z containing nothing
13103 struct LDKCOption_u32Z COption_u32Z_none(void);
13106 * Frees any resources associated with the u32, if we are in the Some state
13108 void COption_u32Z_free(struct LDKCOption_u32Z _res);
13111 * Creates a new COption_u32Z which has the same data as `orig`
13112 * but with all dynamically-allocated buffers duplicated in new buffers.
13114 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
13117 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
13119 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
13122 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
13124 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
13127 * Checks if the given object is currently in the success state
13129 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
13132 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
13134 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
13137 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
13138 * but with all dynamically-allocated buffers duplicated in new buffers.
13140 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
13143 * Constructs a new COption_NoneZ containing a
13145 enum LDKCOption_NoneZ COption_NoneZ_some(void);
13148 * Constructs a new COption_NoneZ containing nothing
13150 enum LDKCOption_NoneZ COption_NoneZ_none(void);
13153 * Frees any resources associated with the , if we are in the Some state
13155 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
13158 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
13160 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
13163 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
13165 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
13168 * Checks if the given object is currently in the success state
13170 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
13173 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
13175 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
13178 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
13179 * but with all dynamically-allocated buffers duplicated in new buffers.
13181 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
13184 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
13186 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
13189 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
13191 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
13194 * Checks if the given object is currently in the success state
13196 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
13199 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
13201 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
13204 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
13205 * but with all dynamically-allocated buffers duplicated in new buffers.
13207 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
13210 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13212 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
13215 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
13217 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
13220 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
13222 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
13225 * Checks if the given object is currently in the success state
13227 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
13230 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
13232 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
13235 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
13236 * but with all dynamically-allocated buffers duplicated in new buffers.
13238 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
13241 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
13243 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
13246 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
13248 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
13251 * Checks if the given object is currently in the success state
13253 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
13256 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
13258 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
13261 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
13262 * but with all dynamically-allocated buffers duplicated in new buffers.
13264 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
13267 * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
13269 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
13272 * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
13274 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
13277 * Checks if the given object is currently in the success state
13279 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
13282 * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
13284 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
13287 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
13289 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
13292 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
13294 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
13297 * Checks if the given object is currently in the success state
13299 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
13302 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
13304 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
13307 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
13308 * but with all dynamically-allocated buffers duplicated in new buffers.
13310 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
13313 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
13315 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
13318 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
13320 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
13323 * Checks if the given object is currently in the success state
13325 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
13328 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
13330 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
13333 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
13335 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
13338 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
13340 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
13343 * Checks if the given object is currently in the success state
13345 bool CResult_CVec_SignatureZNoneZ_is_ok(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR o);
13348 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
13350 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
13353 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
13354 * but with all dynamically-allocated buffers duplicated in new buffers.
13356 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
13359 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
13361 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
13364 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
13366 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
13369 * Checks if the given object is currently in the success state
13371 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
13374 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
13376 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
13379 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
13380 * but with all dynamically-allocated buffers duplicated in new buffers.
13382 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
13385 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
13387 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
13390 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
13392 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
13395 * Checks if the given object is currently in the success state
13397 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
13400 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
13402 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
13405 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
13406 * but with all dynamically-allocated buffers duplicated in new buffers.
13408 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
13411 * Creates a new CResult_NoneErrorZ in the success state.
13413 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
13416 * Creates a new CResult_NoneErrorZ in the error state.
13418 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
13421 * Checks if the given object is currently in the success state
13423 bool CResult_NoneErrorZ_is_ok(const struct LDKCResult_NoneErrorZ *NONNULL_PTR o);
13426 * Frees any resources used by the CResult_NoneErrorZ.
13428 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
13431 * Creates a new CResult_NoneErrorZ which has the same data as `orig`
13432 * but with all dynamically-allocated buffers duplicated in new buffers.
13434 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig);
13437 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
13439 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
13442 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
13444 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
13447 * Checks if the given object is currently in the success state
13449 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
13452 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
13454 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
13457 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
13458 * but with all dynamically-allocated buffers duplicated in new buffers.
13460 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
13463 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13465 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
13468 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13470 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
13473 * Creates a new CResult_RouteDecodeErrorZ in the success state.
13475 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
13478 * Creates a new CResult_RouteDecodeErrorZ in the error state.
13480 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
13483 * Checks if the given object is currently in the success state
13485 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
13488 * Frees any resources used by the CResult_RouteDecodeErrorZ.
13490 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
13493 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
13494 * but with all dynamically-allocated buffers duplicated in new buffers.
13496 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
13499 * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
13501 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
13504 * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
13506 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
13509 * Checks if the given object is currently in the success state
13511 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
13514 * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
13516 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
13519 * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
13520 * but with all dynamically-allocated buffers duplicated in new buffers.
13522 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
13525 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13527 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
13530 * Constructs a new COption_u64Z containing a u64
13532 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
13535 * Constructs a new COption_u64Z containing nothing
13537 struct LDKCOption_u64Z COption_u64Z_none(void);
13540 * Frees any resources associated with the u64, if we are in the Some state
13542 void COption_u64Z_free(struct LDKCOption_u64Z _res);
13545 * Creates a new COption_u64Z which has the same data as `orig`
13546 * but with all dynamically-allocated buffers duplicated in new buffers.
13548 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
13551 * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
13553 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
13556 * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
13558 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
13561 * Checks if the given object is currently in the success state
13563 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
13566 * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
13568 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
13571 * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
13572 * but with all dynamically-allocated buffers duplicated in new buffers.
13574 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
13577 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13579 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
13582 * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
13584 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
13587 * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
13589 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
13592 * Checks if the given object is currently in the success state
13594 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
13597 * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
13599 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
13602 * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
13603 * but with all dynamically-allocated buffers duplicated in new buffers.
13605 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
13608 * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
13610 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
13613 * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
13615 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
13618 * Checks if the given object is currently in the success state
13620 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
13623 * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
13625 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
13628 * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
13629 * but with all dynamically-allocated buffers duplicated in new buffers.
13631 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
13634 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13636 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
13639 * Creates a new CResult_RouteLightningErrorZ in the success state.
13641 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
13644 * Creates a new CResult_RouteLightningErrorZ in the error state.
13646 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
13649 * Checks if the given object is currently in the success state
13651 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
13654 * Frees any resources used by the CResult_RouteLightningErrorZ.
13656 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
13659 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
13660 * but with all dynamically-allocated buffers duplicated in new buffers.
13662 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
13665 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13667 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
13670 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
13672 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
13675 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
13677 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
13680 * Checks if the given object is currently in the success state
13682 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
13685 * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
13687 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
13690 * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
13691 * but with all dynamically-allocated buffers duplicated in new buffers.
13693 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
13696 * Constructs a new COption_ClosureReasonZ containing a crate::lightning::util::events::ClosureReason
13698 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
13701 * Constructs a new COption_ClosureReasonZ containing nothing
13703 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
13706 * Frees any resources associated with the crate::lightning::util::events::ClosureReason, if we are in the Some state
13708 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
13711 * Creates a new COption_ClosureReasonZ which has the same data as `orig`
13712 * but with all dynamically-allocated buffers duplicated in new buffers.
13714 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
13717 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
13719 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
13722 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
13724 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
13727 * Checks if the given object is currently in the success state
13729 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
13732 * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
13734 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
13737 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
13738 * but with all dynamically-allocated buffers duplicated in new buffers.
13740 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
13743 * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
13745 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
13748 * Constructs a new COption_NetworkUpdateZ containing nothing
13750 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
13753 * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
13755 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
13758 * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
13759 * but with all dynamically-allocated buffers duplicated in new buffers.
13761 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
13764 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13766 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
13769 * Constructs a new COption_EventZ containing a crate::lightning::util::events::Event
13771 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
13774 * Constructs a new COption_EventZ containing nothing
13776 struct LDKCOption_EventZ COption_EventZ_none(void);
13779 * Frees any resources associated with the crate::lightning::util::events::Event, if we are in the Some state
13781 void COption_EventZ_free(struct LDKCOption_EventZ _res);
13784 * Creates a new COption_EventZ which has the same data as `orig`
13785 * but with all dynamically-allocated buffers duplicated in new buffers.
13787 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
13790 * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
13792 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
13795 * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
13797 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
13800 * Checks if the given object is currently in the success state
13802 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
13805 * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
13807 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
13810 * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
13811 * but with all dynamically-allocated buffers duplicated in new buffers.
13813 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
13816 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13818 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
13821 * Creates a new CResult_TxOutAccessErrorZ in the success state.
13823 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
13826 * Creates a new CResult_TxOutAccessErrorZ in the error state.
13828 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
13831 * Checks if the given object is currently in the success state
13833 bool CResult_TxOutAccessErrorZ_is_ok(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR o);
13836 * Frees any resources used by the CResult_TxOutAccessErrorZ.
13838 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
13841 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
13842 * but with all dynamically-allocated buffers duplicated in new buffers.
13844 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
13847 * Creates a new tuple which has the same data as `orig`
13848 * but with all dynamically-allocated buffers duplicated in new buffers.
13850 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
13853 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
13855 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
13858 * Frees any resources used by the C2Tuple_usizeTransactionZ.
13860 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
13863 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13865 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
13868 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13870 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
13873 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
13875 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
13878 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
13880 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
13883 * Checks if the given object is currently in the success state
13885 bool CResult_NoneChannelMonitorUpdateErrZ_is_ok(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR o);
13888 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
13890 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
13893 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
13894 * but with all dynamically-allocated buffers duplicated in new buffers.
13896 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
13899 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13901 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
13904 * Creates a new tuple which has the same data as `orig`
13905 * but with all dynamically-allocated buffers duplicated in new buffers.
13907 struct LDKC2Tuple_OutPointCVec_MonitorEventZZ C2Tuple_OutPointCVec_MonitorEventZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorEventZZ *NONNULL_PTR orig);
13910 * Creates a new C2Tuple_OutPointCVec_MonitorEventZZ from the contained elements.
13912 struct LDKC2Tuple_OutPointCVec_MonitorEventZZ C2Tuple_OutPointCVec_MonitorEventZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b);
13915 * Frees any resources used by the C2Tuple_OutPointCVec_MonitorEventZZ.
13917 void C2Tuple_OutPointCVec_MonitorEventZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorEventZZ _res);
13920 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13922 void CVec_C2Tuple_OutPointCVec_MonitorEventZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ _res);
13925 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
13927 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
13930 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
13932 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
13935 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
13937 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
13940 * Creates a new COption_C2Tuple_usizeTransactionZZ which has the same data as `orig`
13941 * but with all dynamically-allocated buffers duplicated in new buffers.
13943 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_clone(const struct LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR orig);
13946 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
13948 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
13951 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
13953 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
13956 * Checks if the given object is currently in the success state
13958 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
13961 * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
13963 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
13966 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
13967 * but with all dynamically-allocated buffers duplicated in new buffers.
13969 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
13972 * Creates a new tuple which has the same data as `orig`
13973 * but with all dynamically-allocated buffers duplicated in new buffers.
13975 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
13978 * Creates a new C2Tuple_u64u64Z from the contained elements.
13980 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
13983 * Frees any resources used by the C2Tuple_u64u64Z.
13985 void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
13988 * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
13990 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
13993 * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
13995 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
13998 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
14000 void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
14003 * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
14004 * but with all dynamically-allocated buffers duplicated in new buffers.
14006 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
14009 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14011 void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
14014 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
14016 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
14019 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
14021 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
14024 * Checks if the given object is currently in the success state
14026 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
14029 * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
14031 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
14034 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
14036 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
14039 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
14041 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
14044 * Checks if the given object is currently in the success state
14046 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
14049 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
14051 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
14054 * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
14055 * but with all dynamically-allocated buffers duplicated in new buffers.
14057 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
14060 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
14062 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
14065 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
14067 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
14070 * Checks if the given object is currently in the success state
14072 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
14075 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
14077 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
14080 * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
14081 * but with all dynamically-allocated buffers duplicated in new buffers.
14083 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
14086 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
14088 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
14091 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
14093 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
14096 * Checks if the given object is currently in the success state
14098 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
14101 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
14103 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
14106 * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
14107 * but with all dynamically-allocated buffers duplicated in new buffers.
14109 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
14112 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
14114 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
14117 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
14119 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
14122 * Checks if the given object is currently in the success state
14124 bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
14127 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
14129 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
14132 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
14133 * but with all dynamically-allocated buffers duplicated in new buffers.
14135 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
14138 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
14140 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
14143 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
14145 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
14148 * Checks if the given object is currently in the success state
14150 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
14153 * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
14155 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
14158 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
14159 * but with all dynamically-allocated buffers duplicated in new buffers.
14161 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
14164 * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
14166 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
14169 * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
14171 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
14174 * Checks if the given object is currently in the success state
14176 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
14179 * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
14181 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
14184 * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
14185 * but with all dynamically-allocated buffers duplicated in new buffers.
14187 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
14190 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
14192 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
14195 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
14197 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
14200 * Checks if the given object is currently in the success state
14202 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
14205 * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
14207 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
14210 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
14211 * but with all dynamically-allocated buffers duplicated in new buffers.
14213 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
14216 * Constructs a new COption_AccessZ containing a crate::lightning::chain::Access
14218 struct LDKCOption_AccessZ COption_AccessZ_some(struct LDKAccess o);
14221 * Constructs a new COption_AccessZ containing nothing
14223 struct LDKCOption_AccessZ COption_AccessZ_none(void);
14226 * Frees any resources associated with the crate::lightning::chain::Access, if we are in the Some state
14228 void COption_AccessZ_free(struct LDKCOption_AccessZ _res);
14231 * Creates a new CResult_boolLightningErrorZ in the success state.
14233 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
14236 * Creates a new CResult_boolLightningErrorZ in the error state.
14238 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
14241 * Checks if the given object is currently in the success state
14243 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
14246 * Frees any resources used by the CResult_boolLightningErrorZ.
14248 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
14251 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
14252 * but with all dynamically-allocated buffers duplicated in new buffers.
14254 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
14257 * Creates a new tuple which has the same data as `orig`
14258 * but with all dynamically-allocated buffers duplicated in new buffers.
14260 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
14263 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
14265 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
14268 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
14270 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
14273 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14275 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
14278 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14280 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
14283 * Creates a new CResult_NoneLightningErrorZ in the success state.
14285 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
14288 * Creates a new CResult_NoneLightningErrorZ in the error state.
14290 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
14293 * Checks if the given object is currently in the success state
14295 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
14298 * Frees any resources used by the CResult_NoneLightningErrorZ.
14300 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
14303 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
14304 * but with all dynamically-allocated buffers duplicated in new buffers.
14306 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
14309 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
14311 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
14314 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
14316 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
14319 * Checks if the given object is currently in the success state
14321 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
14324 * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
14326 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
14329 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
14330 * but with all dynamically-allocated buffers duplicated in new buffers.
14332 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
14335 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
14337 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
14340 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
14342 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
14345 * Checks if the given object is currently in the success state
14347 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
14350 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
14352 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
14355 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
14356 * but with all dynamically-allocated buffers duplicated in new buffers.
14358 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
14361 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
14363 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
14366 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
14368 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
14371 * Checks if the given object is currently in the success state
14373 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
14376 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
14378 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
14381 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
14382 * but with all dynamically-allocated buffers duplicated in new buffers.
14384 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
14387 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14389 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
14392 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
14394 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
14397 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
14399 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
14402 * Checks if the given object is currently in the success state
14404 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
14407 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
14409 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
14412 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
14413 * but with all dynamically-allocated buffers duplicated in new buffers.
14415 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
14418 * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
14420 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
14423 * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
14425 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
14428 * Checks if the given object is currently in the success state
14430 bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
14433 * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
14435 void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
14438 * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
14439 * but with all dynamically-allocated buffers duplicated in new buffers.
14441 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
14444 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14446 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
14449 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
14451 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
14454 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
14456 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
14459 * Checks if the given object is currently in the success state
14461 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
14464 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
14466 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
14469 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
14470 * but with all dynamically-allocated buffers duplicated in new buffers.
14472 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
14475 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
14477 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
14480 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
14482 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
14485 * Checks if the given object is currently in the success state
14487 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
14490 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
14492 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
14495 * Constructs a new COption_CVec_NetAddressZZ containing a crate::c_types::derived::CVec_NetAddressZ
14497 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o);
14500 * Constructs a new COption_CVec_NetAddressZZ containing nothing
14502 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void);
14505 * Frees any resources associated with the crate::c_types::derived::CVec_NetAddressZ, if we are in the Some state
14507 void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res);
14510 * Creates a new COption_CVec_NetAddressZZ which has the same data as `orig`
14511 * but with all dynamically-allocated buffers duplicated in new buffers.
14513 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig);
14516 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
14518 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
14521 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
14523 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
14526 * Checks if the given object is currently in the success state
14528 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
14531 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
14533 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
14536 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
14537 * but with all dynamically-allocated buffers duplicated in new buffers.
14539 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
14542 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
14544 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
14547 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
14549 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
14552 * Checks if the given object is currently in the success state
14554 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
14557 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
14559 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
14562 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
14563 * but with all dynamically-allocated buffers duplicated in new buffers.
14565 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
14568 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
14570 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
14573 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
14575 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
14578 * Checks if the given object is currently in the success state
14580 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
14583 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
14585 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
14588 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
14589 * but with all dynamically-allocated buffers duplicated in new buffers.
14591 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
14594 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14596 void CVec_PaymentPreimageZ_free(struct LDKCVec_PaymentPreimageZ _res);
14599 * Creates a new tuple which has the same data as `orig`
14600 * but with all dynamically-allocated buffers duplicated in new buffers.
14602 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
14605 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
14607 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
14610 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
14612 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
14615 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
14617 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
14620 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
14622 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
14625 * Checks if the given object is currently in the success state
14627 bool CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR o);
14630 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
14632 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
14635 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
14636 * but with all dynamically-allocated buffers duplicated in new buffers.
14638 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
14641 * Creates a new CResult_SignatureNoneZ in the success state.
14643 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
14646 * Creates a new CResult_SignatureNoneZ in the error state.
14648 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
14651 * Checks if the given object is currently in the success state
14653 bool CResult_SignatureNoneZ_is_ok(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR o);
14656 * Frees any resources used by the CResult_SignatureNoneZ.
14658 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
14661 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
14662 * but with all dynamically-allocated buffers duplicated in new buffers.
14664 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
14667 * Creates a new tuple which has the same data as `orig`
14668 * but with all dynamically-allocated buffers duplicated in new buffers.
14670 struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_clone(const struct LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR orig);
14673 * Creates a new C2Tuple_SignatureSignatureZ from the contained elements.
14675 struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_new(struct LDKSignature a, struct LDKSignature b);
14678 * Frees any resources used by the C2Tuple_SignatureSignatureZ.
14680 void C2Tuple_SignatureSignatureZ_free(struct LDKC2Tuple_SignatureSignatureZ _res);
14683 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the success state.
14685 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_ok(struct LDKC2Tuple_SignatureSignatureZ o);
14688 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the error state.
14690 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_err(void);
14693 * Checks if the given object is currently in the success state
14695 bool CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR o);
14698 * Frees any resources used by the CResult_C2Tuple_SignatureSignatureZNoneZ.
14700 void CResult_C2Tuple_SignatureSignatureZNoneZ_free(struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res);
14703 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ which has the same data as `orig`
14704 * but with all dynamically-allocated buffers duplicated in new buffers.
14706 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR orig);
14709 * Creates a new CResult_SecretKeyNoneZ in the success state.
14711 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_ok(struct LDKSecretKey o);
14714 * Creates a new CResult_SecretKeyNoneZ in the error state.
14716 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_err(void);
14719 * Checks if the given object is currently in the success state
14721 bool CResult_SecretKeyNoneZ_is_ok(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR o);
14724 * Frees any resources used by the CResult_SecretKeyNoneZ.
14726 void CResult_SecretKeyNoneZ_free(struct LDKCResult_SecretKeyNoneZ _res);
14729 * Creates a new CResult_SecretKeyNoneZ which has the same data as `orig`
14730 * but with all dynamically-allocated buffers duplicated in new buffers.
14732 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_clone(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR orig);
14735 * Creates a new CResult_SignDecodeErrorZ in the success state.
14737 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
14740 * Creates a new CResult_SignDecodeErrorZ in the error state.
14742 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
14745 * Checks if the given object is currently in the success state
14747 bool CResult_SignDecodeErrorZ_is_ok(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR o);
14750 * Frees any resources used by the CResult_SignDecodeErrorZ.
14752 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
14755 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
14756 * but with all dynamically-allocated buffers duplicated in new buffers.
14758 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
14761 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14763 void CVec_u5Z_free(struct LDKCVec_u5Z _res);
14766 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
14768 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
14771 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
14773 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
14776 * Checks if the given object is currently in the success state
14778 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
14781 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
14783 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
14786 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
14787 * but with all dynamically-allocated buffers duplicated in new buffers.
14789 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
14792 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14794 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
14797 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14799 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
14802 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
14804 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
14807 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
14809 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
14812 * Checks if the given object is currently in the success state
14814 bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o);
14817 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
14819 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
14822 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
14823 * but with all dynamically-allocated buffers duplicated in new buffers.
14825 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
14828 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
14830 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
14833 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
14835 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
14838 * Checks if the given object is currently in the success state
14840 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
14843 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
14845 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
14848 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
14849 * but with all dynamically-allocated buffers duplicated in new buffers.
14851 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
14854 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14856 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
14859 * Creates a new CResult_TransactionNoneZ in the success state.
14861 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
14864 * Creates a new CResult_TransactionNoneZ in the error state.
14866 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
14869 * Checks if the given object is currently in the success state
14871 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
14874 * Frees any resources used by the CResult_TransactionNoneZ.
14876 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
14879 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
14880 * but with all dynamically-allocated buffers duplicated in new buffers.
14882 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
14885 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
14887 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
14890 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
14892 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
14895 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14897 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
14900 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
14902 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
14905 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
14907 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
14910 * Checks if the given object is currently in the success state
14912 bool CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR o);
14915 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
14917 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
14920 * Constructs a new COption_u16Z containing a u16
14922 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
14925 * Constructs a new COption_u16Z containing nothing
14927 struct LDKCOption_u16Z COption_u16Z_none(void);
14930 * Frees any resources associated with the u16, if we are in the Some state
14932 void COption_u16Z_free(struct LDKCOption_u16Z _res);
14935 * Creates a new COption_u16Z which has the same data as `orig`
14936 * but with all dynamically-allocated buffers duplicated in new buffers.
14938 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
14941 * Creates a new CResult_NoneAPIErrorZ in the success state.
14943 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
14946 * Creates a new CResult_NoneAPIErrorZ in the error state.
14948 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
14951 * Checks if the given object is currently in the success state
14953 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
14956 * Frees any resources used by the CResult_NoneAPIErrorZ.
14958 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
14961 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
14962 * but with all dynamically-allocated buffers duplicated in new buffers.
14964 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
14967 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14969 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
14972 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14974 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
14977 * Creates a new CResult__u832APIErrorZ in the success state.
14979 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_ok(struct LDKThirtyTwoBytes o);
14982 * Creates a new CResult__u832APIErrorZ in the error state.
14984 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_err(struct LDKAPIError e);
14987 * Checks if the given object is currently in the success state
14989 bool CResult__u832APIErrorZ_is_ok(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR o);
14992 * Frees any resources used by the CResult__u832APIErrorZ.
14994 void CResult__u832APIErrorZ_free(struct LDKCResult__u832APIErrorZ _res);
14997 * Creates a new CResult__u832APIErrorZ which has the same data as `orig`
14998 * but with all dynamically-allocated buffers duplicated in new buffers.
15000 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig);
15003 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the success state.
15005 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
15008 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the error state.
15010 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
15013 * Checks if the given object is currently in the success state
15015 bool CResult_PaymentIdPaymentSendFailureZ_is_ok(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR o);
15018 * Frees any resources used by the CResult_PaymentIdPaymentSendFailureZ.
15020 void CResult_PaymentIdPaymentSendFailureZ_free(struct LDKCResult_PaymentIdPaymentSendFailureZ _res);
15023 * Creates a new CResult_PaymentIdPaymentSendFailureZ which has the same data as `orig`
15024 * but with all dynamically-allocated buffers duplicated in new buffers.
15026 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_clone(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR orig);
15029 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
15031 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
15034 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
15036 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
15039 * Checks if the given object is currently in the success state
15041 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
15044 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
15046 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
15049 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
15050 * but with all dynamically-allocated buffers duplicated in new buffers.
15052 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
15055 * Creates a new tuple which has the same data as `orig`
15056 * but with all dynamically-allocated buffers duplicated in new buffers.
15058 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig);
15061 * Creates a new C2Tuple_PaymentHashPaymentIdZ from the contained elements.
15063 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
15066 * Frees any resources used by the C2Tuple_PaymentHashPaymentIdZ.
15068 void C2Tuple_PaymentHashPaymentIdZ_free(struct LDKC2Tuple_PaymentHashPaymentIdZ _res);
15071 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the success state.
15073 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(struct LDKC2Tuple_PaymentHashPaymentIdZ o);
15076 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the error state.
15078 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
15081 * Checks if the given object is currently in the success state
15083 bool CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR o);
15086 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.
15088 void CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res);
15091 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ which has the same data as `orig`
15092 * but with all dynamically-allocated buffers duplicated in new buffers.
15094 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig);
15097 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15099 void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
15102 * Creates a new tuple which has the same data as `orig`
15103 * but with all dynamically-allocated buffers duplicated in new buffers.
15105 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig);
15108 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
15110 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
15113 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
15115 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
15118 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the success state.
15120 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
15123 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the error state.
15125 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(void);
15128 * Checks if the given object is currently in the success state
15130 bool CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR o);
15133 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ.
15135 void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res);
15138 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ which has the same data as `orig`
15139 * but with all dynamically-allocated buffers duplicated in new buffers.
15141 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR orig);
15144 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the success state.
15146 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
15149 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the error state.
15151 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(struct LDKAPIError e);
15154 * Checks if the given object is currently in the success state
15156 bool CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR o);
15159 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.
15161 void CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res);
15164 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ which has the same data as `orig`
15165 * but with all dynamically-allocated buffers duplicated in new buffers.
15167 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR orig);
15170 * Creates a new CResult_PaymentSecretNoneZ in the success state.
15172 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
15175 * Creates a new CResult_PaymentSecretNoneZ in the error state.
15177 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_err(void);
15180 * Checks if the given object is currently in the success state
15182 bool CResult_PaymentSecretNoneZ_is_ok(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR o);
15185 * Frees any resources used by the CResult_PaymentSecretNoneZ.
15187 void CResult_PaymentSecretNoneZ_free(struct LDKCResult_PaymentSecretNoneZ _res);
15190 * Creates a new CResult_PaymentSecretNoneZ which has the same data as `orig`
15191 * but with all dynamically-allocated buffers duplicated in new buffers.
15193 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_clone(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR orig);
15196 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
15198 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
15201 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
15203 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
15206 * Checks if the given object is currently in the success state
15208 bool CResult_PaymentSecretAPIErrorZ_is_ok(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR o);
15211 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
15213 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
15216 * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig`
15217 * but with all dynamically-allocated buffers duplicated in new buffers.
15219 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig);
15222 * Creates a new CResult_PaymentPreimageAPIErrorZ in the success state.
15224 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
15227 * Creates a new CResult_PaymentPreimageAPIErrorZ in the error state.
15229 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_err(struct LDKAPIError e);
15232 * Checks if the given object is currently in the success state
15234 bool CResult_PaymentPreimageAPIErrorZ_is_ok(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR o);
15237 * Frees any resources used by the CResult_PaymentPreimageAPIErrorZ.
15239 void CResult_PaymentPreimageAPIErrorZ_free(struct LDKCResult_PaymentPreimageAPIErrorZ _res);
15242 * Creates a new CResult_PaymentPreimageAPIErrorZ which has the same data as `orig`
15243 * but with all dynamically-allocated buffers duplicated in new buffers.
15245 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_clone(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR orig);
15248 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
15250 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
15253 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
15255 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
15258 * Checks if the given object is currently in the success state
15260 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
15263 * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
15265 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
15268 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
15269 * but with all dynamically-allocated buffers duplicated in new buffers.
15271 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
15274 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
15276 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
15279 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
15281 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
15284 * Checks if the given object is currently in the success state
15286 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
15289 * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
15291 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
15294 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
15295 * but with all dynamically-allocated buffers duplicated in new buffers.
15297 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
15300 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
15302 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
15305 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
15307 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
15310 * Checks if the given object is currently in the success state
15312 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
15315 * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
15317 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
15320 * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
15321 * but with all dynamically-allocated buffers duplicated in new buffers.
15323 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
15326 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
15328 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
15331 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
15333 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
15336 * Checks if the given object is currently in the success state
15338 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
15341 * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
15343 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
15346 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
15347 * but with all dynamically-allocated buffers duplicated in new buffers.
15349 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
15352 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15354 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
15357 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
15359 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
15362 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
15364 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
15367 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
15369 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
15372 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
15374 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
15377 * Checks if the given object is currently in the success state
15379 bool CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR o);
15382 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
15384 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
15387 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
15389 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
15392 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
15394 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
15397 * Checks if the given object is currently in the success state
15399 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
15402 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
15404 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
15407 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
15408 * but with all dynamically-allocated buffers duplicated in new buffers.
15410 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
15413 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
15415 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
15418 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
15420 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
15423 * Checks if the given object is currently in the success state
15425 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
15428 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
15430 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
15433 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
15434 * but with all dynamically-allocated buffers duplicated in new buffers.
15436 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
15439 * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
15441 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
15444 * Constructs a new COption_TypeZ containing nothing
15446 struct LDKCOption_TypeZ COption_TypeZ_none(void);
15449 * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
15451 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
15454 * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
15456 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
15459 * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
15461 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
15464 * Checks if the given object is currently in the success state
15466 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
15469 * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
15471 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
15474 * Creates a new CResult_PaymentIdPaymentErrorZ in the success state.
15476 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
15479 * Creates a new CResult_PaymentIdPaymentErrorZ in the error state.
15481 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e);
15484 * Checks if the given object is currently in the success state
15486 bool CResult_PaymentIdPaymentErrorZ_is_ok(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR o);
15489 * Frees any resources used by the CResult_PaymentIdPaymentErrorZ.
15491 void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res);
15494 * Creates a new CResult_PaymentIdPaymentErrorZ which has the same data as `orig`
15495 * but with all dynamically-allocated buffers duplicated in new buffers.
15497 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig);
15500 * Creates a new CResult_SiPrefixParseErrorZ in the success state.
15502 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_ok(enum LDKSiPrefix o);
15505 * Creates a new CResult_SiPrefixParseErrorZ in the error state.
15507 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_err(struct LDKParseError e);
15510 * Checks if the given object is currently in the success state
15512 bool CResult_SiPrefixParseErrorZ_is_ok(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR o);
15515 * Frees any resources used by the CResult_SiPrefixParseErrorZ.
15517 void CResult_SiPrefixParseErrorZ_free(struct LDKCResult_SiPrefixParseErrorZ _res);
15520 * Creates a new CResult_SiPrefixParseErrorZ which has the same data as `orig`
15521 * but with all dynamically-allocated buffers duplicated in new buffers.
15523 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_clone(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR orig);
15526 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the success state.
15528 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_ok(struct LDKInvoice o);
15531 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the error state.
15533 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
15536 * Checks if the given object is currently in the success state
15538 bool CResult_InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
15541 * Frees any resources used by the CResult_InvoiceParseOrSemanticErrorZ.
15543 void CResult_InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_InvoiceParseOrSemanticErrorZ _res);
15546 * Creates a new CResult_InvoiceParseOrSemanticErrorZ which has the same data as `orig`
15547 * but with all dynamically-allocated buffers duplicated in new buffers.
15549 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
15552 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the success state.
15554 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_ok(struct LDKSignedRawInvoice o);
15557 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the error state.
15559 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_err(struct LDKParseError e);
15562 * Checks if the given object is currently in the success state
15564 bool CResult_SignedRawInvoiceParseErrorZ_is_ok(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR o);
15567 * Frees any resources used by the CResult_SignedRawInvoiceParseErrorZ.
15569 void CResult_SignedRawInvoiceParseErrorZ_free(struct LDKCResult_SignedRawInvoiceParseErrorZ _res);
15572 * Creates a new CResult_SignedRawInvoiceParseErrorZ which has the same data as `orig`
15573 * but with all dynamically-allocated buffers duplicated in new buffers.
15575 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_clone(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR orig);
15578 * Creates a new tuple which has the same data as `orig`
15579 * but with all dynamically-allocated buffers duplicated in new buffers.
15581 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig);
15584 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
15586 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
15589 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
15591 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
15594 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
15596 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
15599 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
15601 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
15604 * Checks if the given object is currently in the success state
15606 bool CResult_PayeePubKeyErrorZ_is_ok(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR o);
15609 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
15611 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
15614 * Creates a new CResult_PayeePubKeyErrorZ which has the same data as `orig`
15615 * but with all dynamically-allocated buffers duplicated in new buffers.
15617 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig);
15620 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15622 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
15625 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
15627 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
15630 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
15632 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
15635 * Checks if the given object is currently in the success state
15637 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
15640 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
15642 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
15645 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
15646 * but with all dynamically-allocated buffers duplicated in new buffers.
15648 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
15651 * Creates a new CResult_NoneSemanticErrorZ in the success state.
15653 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
15656 * Creates a new CResult_NoneSemanticErrorZ in the error state.
15658 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
15661 * Checks if the given object is currently in the success state
15663 bool CResult_NoneSemanticErrorZ_is_ok(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR o);
15666 * Frees any resources used by the CResult_NoneSemanticErrorZ.
15668 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
15671 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
15672 * but with all dynamically-allocated buffers duplicated in new buffers.
15674 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
15677 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
15679 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
15682 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
15684 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
15687 * Checks if the given object is currently in the success state
15689 bool CResult_InvoiceSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR o);
15692 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
15694 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
15697 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
15698 * but with all dynamically-allocated buffers duplicated in new buffers.
15700 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
15703 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
15705 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
15708 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
15710 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
15713 * Checks if the given object is currently in the success state
15715 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
15718 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
15720 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
15723 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
15724 * but with all dynamically-allocated buffers duplicated in new buffers.
15726 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
15729 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
15731 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
15734 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
15736 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
15739 * Checks if the given object is currently in the success state
15741 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
15744 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
15746 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
15749 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
15750 * but with all dynamically-allocated buffers duplicated in new buffers.
15752 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
15755 * Creates a new CResult_StringErrorZ in the success state.
15757 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
15760 * Creates a new CResult_StringErrorZ in the error state.
15762 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
15765 * Checks if the given object is currently in the success state
15767 bool CResult_StringErrorZ_is_ok(const struct LDKCResult_StringErrorZ *NONNULL_PTR o);
15770 * Frees any resources used by the CResult_StringErrorZ.
15772 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
15775 * Creates a new CResult_StringErrorZ which has the same data as `orig`
15776 * but with all dynamically-allocated buffers duplicated in new buffers.
15778 struct LDKCResult_StringErrorZ CResult_StringErrorZ_clone(const struct LDKCResult_StringErrorZ *NONNULL_PTR orig);
15781 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
15783 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
15786 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
15788 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
15791 * Checks if the given object is currently in the success state
15793 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
15796 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
15798 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
15801 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
15802 * but with all dynamically-allocated buffers duplicated in new buffers.
15804 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
15807 * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
15809 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
15812 * Constructs a new COption_MonitorEventZ containing nothing
15814 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
15817 * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
15819 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
15822 * Creates a new COption_MonitorEventZ which has the same data as `orig`
15823 * but with all dynamically-allocated buffers duplicated in new buffers.
15825 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
15828 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
15830 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
15833 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
15835 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
15838 * Checks if the given object is currently in the success state
15840 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
15843 * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
15845 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
15848 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
15849 * but with all dynamically-allocated buffers duplicated in new buffers.
15851 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
15854 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
15856 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
15859 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
15861 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
15864 * Checks if the given object is currently in the success state
15866 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
15869 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
15871 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
15874 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
15875 * but with all dynamically-allocated buffers duplicated in new buffers.
15877 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
15880 * Creates a new tuple which has the same data as `orig`
15881 * but with all dynamically-allocated buffers duplicated in new buffers.
15883 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
15886 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
15888 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
15891 * Frees any resources used by the C2Tuple_OutPointScriptZ.
15893 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
15896 * Creates a new tuple which has the same data as `orig`
15897 * but with all dynamically-allocated buffers duplicated in new buffers.
15899 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
15902 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
15904 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
15907 * Frees any resources used by the C2Tuple_u32ScriptZ.
15909 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
15912 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15914 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
15917 * Creates a new tuple which has the same data as `orig`
15918 * but with all dynamically-allocated buffers duplicated in new buffers.
15920 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig);
15923 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
15925 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
15928 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
15930 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
15933 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15935 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
15938 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15940 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
15943 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15945 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
15948 * Creates a new tuple which has the same data as `orig`
15949 * but with all dynamically-allocated buffers duplicated in new buffers.
15951 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
15954 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
15956 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
15959 * Frees any resources used by the C2Tuple_u32TxOutZ.
15961 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
15964 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15966 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
15969 * Creates a new tuple which has the same data as `orig`
15970 * but with all dynamically-allocated buffers duplicated in new buffers.
15972 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
15975 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
15977 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
15980 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
15982 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
15985 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15987 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
15990 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15992 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
15995 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
15997 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
16000 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
16002 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
16005 * Checks if the given object is currently in the success state
16007 bool CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
16010 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
16012 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
16015 * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
16017 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
16020 * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
16022 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
16025 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16027 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
16030 * Constructs a new COption_NetAddressZ containing a crate::lightning::ln::msgs::NetAddress
16032 struct LDKCOption_NetAddressZ COption_NetAddressZ_some(struct LDKNetAddress o);
16035 * Constructs a new COption_NetAddressZ containing nothing
16037 struct LDKCOption_NetAddressZ COption_NetAddressZ_none(void);
16040 * Frees any resources associated with the crate::lightning::ln::msgs::NetAddress, if we are in the Some state
16042 void COption_NetAddressZ_free(struct LDKCOption_NetAddressZ _res);
16045 * Creates a new COption_NetAddressZ which has the same data as `orig`
16046 * but with all dynamically-allocated buffers duplicated in new buffers.
16048 struct LDKCOption_NetAddressZ COption_NetAddressZ_clone(const struct LDKCOption_NetAddressZ *NONNULL_PTR orig);
16051 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
16053 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
16056 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
16058 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
16061 * Checks if the given object is currently in the success state
16063 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
16066 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
16068 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
16071 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
16072 * but with all dynamically-allocated buffers duplicated in new buffers.
16074 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
16077 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
16079 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
16082 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
16084 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
16087 * Checks if the given object is currently in the success state
16089 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
16092 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
16094 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
16097 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
16098 * but with all dynamically-allocated buffers duplicated in new buffers.
16100 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
16103 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
16105 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
16108 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
16110 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
16113 * Checks if the given object is currently in the success state
16115 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
16118 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
16120 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
16123 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
16124 * but with all dynamically-allocated buffers duplicated in new buffers.
16126 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
16129 * Creates a new CResult_u32GraphSyncErrorZ in the success state.
16131 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
16134 * Creates a new CResult_u32GraphSyncErrorZ in the error state.
16136 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
16139 * Checks if the given object is currently in the success state
16141 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
16144 * Frees any resources used by the CResult_u32GraphSyncErrorZ.
16146 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
16149 * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
16151 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
16154 * Creates a new CResult_NetAddressDecodeErrorZ in the error state.
16156 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
16159 * Checks if the given object is currently in the success state
16161 bool CResult_NetAddressDecodeErrorZ_is_ok(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR o);
16164 * Frees any resources used by the CResult_NetAddressDecodeErrorZ.
16166 void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
16169 * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig`
16170 * but with all dynamically-allocated buffers duplicated in new buffers.
16172 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
16175 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16177 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
16180 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16182 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
16185 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16187 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
16190 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16192 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
16195 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
16197 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
16200 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
16202 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
16205 * Checks if the given object is currently in the success state
16207 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
16210 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
16212 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
16215 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
16216 * but with all dynamically-allocated buffers duplicated in new buffers.
16218 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
16221 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
16223 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
16226 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
16228 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
16231 * Checks if the given object is currently in the success state
16233 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
16236 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
16238 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
16241 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
16242 * but with all dynamically-allocated buffers duplicated in new buffers.
16244 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
16247 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
16249 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
16252 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
16254 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
16257 * Checks if the given object is currently in the success state
16259 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
16262 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
16264 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
16267 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
16268 * but with all dynamically-allocated buffers duplicated in new buffers.
16270 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
16273 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
16275 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
16278 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
16280 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
16283 * Checks if the given object is currently in the success state
16285 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
16288 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
16290 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
16293 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
16294 * but with all dynamically-allocated buffers duplicated in new buffers.
16296 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
16299 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
16301 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
16304 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
16306 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
16309 * Checks if the given object is currently in the success state
16311 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
16314 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
16316 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
16319 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
16320 * but with all dynamically-allocated buffers duplicated in new buffers.
16322 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
16325 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
16327 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
16330 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
16332 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
16335 * Checks if the given object is currently in the success state
16337 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
16340 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
16342 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
16345 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
16346 * but with all dynamically-allocated buffers duplicated in new buffers.
16348 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
16351 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
16353 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
16356 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
16358 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
16361 * Checks if the given object is currently in the success state
16363 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
16366 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
16368 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
16371 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
16372 * but with all dynamically-allocated buffers duplicated in new buffers.
16374 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
16377 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
16379 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
16382 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
16384 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
16387 * Checks if the given object is currently in the success state
16389 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
16392 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
16394 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
16397 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
16398 * but with all dynamically-allocated buffers duplicated in new buffers.
16400 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
16403 * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
16405 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
16408 * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
16410 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
16413 * Checks if the given object is currently in the success state
16415 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
16418 * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
16420 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
16423 * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
16424 * but with all dynamically-allocated buffers duplicated in new buffers.
16426 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
16429 * Creates a new CResult_InitDecodeErrorZ in the success state.
16431 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
16434 * Creates a new CResult_InitDecodeErrorZ in the error state.
16436 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
16439 * Checks if the given object is currently in the success state
16441 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
16444 * Frees any resources used by the CResult_InitDecodeErrorZ.
16446 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
16449 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
16450 * but with all dynamically-allocated buffers duplicated in new buffers.
16452 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
16455 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
16457 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
16460 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
16462 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
16465 * Checks if the given object is currently in the success state
16467 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
16470 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
16472 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
16475 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
16476 * but with all dynamically-allocated buffers duplicated in new buffers.
16478 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
16481 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
16483 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
16486 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
16488 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
16491 * Checks if the given object is currently in the success state
16493 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
16496 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
16498 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
16501 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
16502 * but with all dynamically-allocated buffers duplicated in new buffers.
16504 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
16507 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
16509 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
16512 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
16514 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
16517 * Checks if the given object is currently in the success state
16519 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
16522 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
16524 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
16527 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
16528 * but with all dynamically-allocated buffers duplicated in new buffers.
16530 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
16533 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
16535 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
16538 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
16540 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16543 * Checks if the given object is currently in the success state
16545 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
16548 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
16550 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
16553 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
16554 * but with all dynamically-allocated buffers duplicated in new buffers.
16556 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
16559 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
16561 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
16564 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
16566 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16569 * Checks if the given object is currently in the success state
16571 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
16574 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
16576 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
16579 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
16580 * but with all dynamically-allocated buffers duplicated in new buffers.
16582 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
16585 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
16587 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
16590 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
16592 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
16595 * Checks if the given object is currently in the success state
16597 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
16600 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
16602 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
16605 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
16606 * but with all dynamically-allocated buffers duplicated in new buffers.
16608 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
16611 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
16613 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
16616 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
16618 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16621 * Checks if the given object is currently in the success state
16623 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
16626 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
16628 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
16631 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
16632 * but with all dynamically-allocated buffers duplicated in new buffers.
16634 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
16637 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
16639 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
16642 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
16644 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16647 * Checks if the given object is currently in the success state
16649 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
16652 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
16654 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
16657 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
16658 * but with all dynamically-allocated buffers duplicated in new buffers.
16660 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
16663 * Creates a new CResult_PingDecodeErrorZ in the success state.
16665 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
16668 * Creates a new CResult_PingDecodeErrorZ in the error state.
16670 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
16673 * Checks if the given object is currently in the success state
16675 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
16678 * Frees any resources used by the CResult_PingDecodeErrorZ.
16680 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
16683 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
16684 * but with all dynamically-allocated buffers duplicated in new buffers.
16686 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
16689 * Creates a new CResult_PongDecodeErrorZ in the success state.
16691 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
16694 * Creates a new CResult_PongDecodeErrorZ in the error state.
16696 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
16699 * Checks if the given object is currently in the success state
16701 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
16704 * Frees any resources used by the CResult_PongDecodeErrorZ.
16706 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
16709 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
16710 * but with all dynamically-allocated buffers duplicated in new buffers.
16712 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
16715 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
16717 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
16720 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
16722 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
16725 * Checks if the given object is currently in the success state
16727 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
16730 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
16732 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
16735 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
16736 * but with all dynamically-allocated buffers duplicated in new buffers.
16738 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
16741 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
16743 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
16746 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
16748 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
16751 * Checks if the given object is currently in the success state
16753 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
16756 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
16758 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
16761 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
16762 * but with all dynamically-allocated buffers duplicated in new buffers.
16764 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
16767 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
16769 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
16772 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
16774 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
16777 * Checks if the given object is currently in the success state
16779 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
16782 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
16784 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
16787 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
16788 * but with all dynamically-allocated buffers duplicated in new buffers.
16790 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
16793 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
16795 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
16798 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
16800 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
16803 * Checks if the given object is currently in the success state
16805 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
16808 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
16810 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
16813 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
16814 * but with all dynamically-allocated buffers duplicated in new buffers.
16816 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
16819 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
16821 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
16824 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
16826 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
16829 * Checks if the given object is currently in the success state
16831 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
16834 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
16836 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
16839 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
16840 * but with all dynamically-allocated buffers duplicated in new buffers.
16842 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
16845 * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
16847 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
16850 * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
16852 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
16855 * Checks if the given object is currently in the success state
16857 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
16860 * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
16862 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
16865 * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
16866 * but with all dynamically-allocated buffers duplicated in new buffers.
16868 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
16871 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
16873 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
16876 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
16878 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
16881 * Checks if the given object is currently in the success state
16883 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
16886 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
16888 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
16891 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
16892 * but with all dynamically-allocated buffers duplicated in new buffers.
16894 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
16897 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
16899 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
16902 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
16904 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
16907 * Checks if the given object is currently in the success state
16909 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
16912 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
16914 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
16917 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
16918 * but with all dynamically-allocated buffers duplicated in new buffers.
16920 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
16923 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
16925 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
16928 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
16930 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
16933 * Checks if the given object is currently in the success state
16935 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
16938 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
16940 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
16943 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
16944 * but with all dynamically-allocated buffers duplicated in new buffers.
16946 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
16949 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
16951 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
16954 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
16956 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
16959 * Checks if the given object is currently in the success state
16961 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
16964 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
16966 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
16969 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
16970 * but with all dynamically-allocated buffers duplicated in new buffers.
16972 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
16975 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
16977 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
16980 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
16982 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
16985 * Checks if the given object is currently in the success state
16987 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
16990 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
16992 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
16995 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
16996 * but with all dynamically-allocated buffers duplicated in new buffers.
16998 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
17001 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
17003 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
17006 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
17008 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
17011 * Checks if the given object is currently in the success state
17013 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
17016 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
17018 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
17021 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
17022 * but with all dynamically-allocated buffers duplicated in new buffers.
17024 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
17027 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
17029 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
17032 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
17034 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
17037 * Checks if the given object is currently in the success state
17039 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
17042 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
17044 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
17047 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
17048 * but with all dynamically-allocated buffers duplicated in new buffers.
17050 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
17053 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17055 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
17058 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state.
17060 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o);
17063 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state.
17065 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
17068 * Checks if the given object is currently in the success state
17070 bool CResult_InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
17073 * Frees any resources used by the CResult_InvoiceSignOrCreationErrorZ.
17075 void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res);
17078 * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig`
17079 * but with all dynamically-allocated buffers duplicated in new buffers.
17081 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
17084 * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
17086 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
17089 * Constructs a new COption_FilterZ containing nothing
17091 struct LDKCOption_FilterZ COption_FilterZ_none(void);
17094 * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
17096 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
17099 * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
17101 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
17104 * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
17106 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
17109 * Checks if the given object is currently in the success state
17111 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
17114 * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
17116 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
17119 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17121 void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
17124 * Frees any resources used by the PaymentPurpose
17126 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
17129 * Creates a copy of the PaymentPurpose
17131 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
17134 * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
17136 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret);
17139 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
17141 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
17144 * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
17146 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
17149 * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
17151 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
17154 * Frees any resources used by the ClosureReason
17156 void ClosureReason_free(struct LDKClosureReason this_ptr);
17159 * Creates a copy of the ClosureReason
17161 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
17164 * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
17166 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKStr peer_msg);
17169 * Utility method to constructs a new HolderForceClosed-variant ClosureReason
17171 struct LDKClosureReason ClosureReason_holder_force_closed(void);
17174 * Utility method to constructs a new CooperativeClosure-variant ClosureReason
17176 struct LDKClosureReason ClosureReason_cooperative_closure(void);
17179 * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
17181 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
17184 * Utility method to constructs a new FundingTimedOut-variant ClosureReason
17186 struct LDKClosureReason ClosureReason_funding_timed_out(void);
17189 * Utility method to constructs a new ProcessingError-variant ClosureReason
17191 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
17194 * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
17196 struct LDKClosureReason ClosureReason_disconnected_peer(void);
17199 * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
17201 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
17204 * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
17206 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
17209 * Read a ClosureReason from a byte array, created by ClosureReason_write
17211 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
17214 * Frees any resources used by the Event
17216 void Event_free(struct LDKEvent this_ptr);
17219 * Creates a copy of the Event
17221 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
17224 * Utility method to constructs a new FundingGenerationReady-variant Event
17226 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);
17229 * Utility method to constructs a new PaymentReceived-variant Event
17231 struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose);
17234 * Utility method to constructs a new PaymentClaimed-variant Event
17236 struct LDKEvent Event_payment_claimed(struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose);
17239 * Utility method to constructs a new PaymentSent-variant Event
17241 struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
17244 * Utility method to constructs a new PaymentFailed-variant Event
17246 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
17249 * Utility method to constructs a new PaymentPathSuccessful-variant Event
17251 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
17254 * Utility method to constructs a new PaymentPathFailed-variant Event
17256 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);
17259 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
17261 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
17264 * Utility method to constructs a new SpendableOutputs-variant Event
17266 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs);
17269 * Utility method to constructs a new PaymentForwarded-variant Event
17271 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);
17274 * Utility method to constructs a new ChannelClosed-variant Event
17276 struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, uint64_t user_channel_id, struct LDKClosureReason reason);
17279 * Utility method to constructs a new DiscardFunding-variant Event
17281 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
17284 * Utility method to constructs a new OpenChannelRequest-variant Event
17286 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);
17289 * Serialize the Event object into a byte array which can be read by Event_read
17291 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
17294 * Read a Event from a byte array, created by Event_write
17296 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
17299 * Frees any resources used by the MessageSendEvent
17301 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
17304 * Creates a copy of the MessageSendEvent
17306 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
17309 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
17311 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
17314 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
17316 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
17319 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
17321 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
17324 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
17326 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
17329 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
17331 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
17334 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
17336 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
17339 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
17341 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
17344 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
17346 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
17349 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
17351 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
17354 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
17356 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
17359 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
17361 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
17364 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
17366 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
17369 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
17371 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
17374 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
17376 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
17379 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
17381 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
17384 * Utility method to constructs a new HandleError-variant MessageSendEvent
17386 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
17389 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
17391 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
17394 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
17396 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
17399 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
17401 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
17404 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
17406 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
17409 * Calls the free function if one is set
17411 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
17414 * Calls the free function if one is set
17416 void EventsProvider_free(struct LDKEventsProvider this_ptr);
17419 * Calls the free function if one is set
17421 void EventHandler_free(struct LDKEventHandler this_ptr);
17424 * Frees any resources used by the APIError
17426 void APIError_free(struct LDKAPIError this_ptr);
17429 * Creates a copy of the APIError
17431 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
17434 * Utility method to constructs a new APIMisuseError-variant APIError
17436 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
17439 * Utility method to constructs a new FeeRateTooHigh-variant APIError
17441 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
17444 * Utility method to constructs a new RouteError-variant APIError
17446 struct LDKAPIError APIError_route_error(struct LDKStr err);
17449 * Utility method to constructs a new ChannelUnavailable-variant APIError
17451 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
17454 * Utility method to constructs a new MonitorUpdateFailed-variant APIError
17456 struct LDKAPIError APIError_monitor_update_failed(void);
17459 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
17461 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
17464 * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
17466 void BigSize_free(struct LDKBigSize this_obj);
17468 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
17470 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
17473 * Constructs a new BigSize given each field
17475 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
17478 * Creates a digital signature of a message given a SecretKey, like the node's secret.
17479 * 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.
17480 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
17482 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
17485 * Recovers the PublicKey of the signer of the message given the message and the signature.
17487 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
17490 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
17491 * and the PublicKey.
17493 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
17496 * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
17498 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z data_without_signature);
17501 * Calls the free function if one is set
17503 void Persister_free(struct LDKPersister this_ptr);
17506 * Creates a copy of the Level
17508 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
17511 * Utility method to constructs a new Gossip-variant Level
17513 enum LDKLevel Level_gossip(void);
17516 * Utility method to constructs a new Trace-variant Level
17518 enum LDKLevel Level_trace(void);
17521 * Utility method to constructs a new Debug-variant Level
17523 enum LDKLevel Level_debug(void);
17526 * Utility method to constructs a new Info-variant Level
17528 enum LDKLevel Level_info(void);
17531 * Utility method to constructs a new Warn-variant Level
17533 enum LDKLevel Level_warn(void);
17536 * Utility method to constructs a new Error-variant Level
17538 enum LDKLevel Level_error(void);
17541 * Checks if two Levels contain equal inner contents.
17542 * This ignores pointers and is_owned flags and looks at the values in fields.
17544 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
17547 * Checks if two Levels contain equal inner contents.
17549 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
17552 * Returns the most verbose logging level.
17554 MUST_USE_RES enum LDKLevel Level_max(void);
17557 * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
17559 void Record_free(struct LDKRecord this_obj);
17562 * The verbosity level of the message.
17564 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
17567 * The verbosity level of the message.
17569 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
17572 * The message body.
17574 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
17577 * The message body.
17579 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
17582 * The module path of the message.
17584 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
17587 * The module path of the message.
17589 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
17592 * The source file containing the message.
17594 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
17597 * The source file containing the message.
17599 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
17602 * The line containing the message.
17604 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
17607 * The line containing the message.
17609 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
17612 * Creates a copy of the Record
17614 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
17617 * Calls the free function if one is set
17619 void Logger_free(struct LDKLogger this_ptr);
17622 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
17624 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
17627 * Confirmations we will wait for before considering the channel locked in.
17628 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
17629 * equivalent limit applied to outbound channels).
17631 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
17632 * transaction before operation. If you wish to accept channels with zero confirmations, see
17633 * [`UserConfig::manually_accept_inbound_channels`] and
17634 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
17636 * Default value: 6.
17638 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
17639 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
17641 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17644 * Confirmations we will wait for before considering the channel locked in.
17645 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
17646 * equivalent limit applied to outbound channels).
17648 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
17649 * transaction before operation. If you wish to accept channels with zero confirmations, see
17650 * [`UserConfig::manually_accept_inbound_channels`] and
17651 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
17653 * Default value: 6.
17655 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
17656 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
17658 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
17661 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
17662 * the number of blocks we have to punish our counterparty if they broadcast a revoked
17665 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
17666 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
17667 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
17668 * possibly with time in between to RBF the spending transaction).
17670 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
17671 * case of an honest unilateral channel close, which implicitly decrease the economic value of
17674 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
17675 * can tweak config to ask for more security, not less.
17677 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17680 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
17681 * the number of blocks we have to punish our counterparty if they broadcast a revoked
17684 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
17685 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
17686 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
17687 * possibly with time in between to RBF the spending transaction).
17689 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
17690 * case of an honest unilateral channel close, which implicitly decrease the economic value of
17693 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
17694 * can tweak config to ask for more security, not less.
17696 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
17699 * Set to the smallest value HTLC we will accept to process.
17701 * This value is sent to our counterparty on channel-open and we close the channel any time
17702 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
17704 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
17707 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17710 * Set to the smallest value HTLC we will accept to process.
17712 * This value is sent to our counterparty on channel-open and we close the channel any time
17713 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
17715 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
17718 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
17721 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
17724 * This can be set to a value between 1-100, where the value corresponds to the percent of the
17725 * channel value in whole percentages.
17728 * * If configured to another value than the default value 10, any new channels created with
17729 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
17730 * `ChannelManager`.
17732 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
17733 * no way to configure the cap for the total value of outbound HTLCs in-flight.
17735 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
17736 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
17737 * restrict exposure to loss due to being offline for too long.
17738 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
17739 * for more information.
17741 * Default value: 10.
17742 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
17743 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
17745 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17748 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
17751 * This can be set to a value between 1-100, where the value corresponds to the percent of the
17752 * channel value in whole percentages.
17755 * * If configured to another value than the default value 10, any new channels created with
17756 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
17757 * `ChannelManager`.
17759 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
17760 * no way to configure the cap for the total value of outbound HTLCs in-flight.
17762 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
17763 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
17764 * restrict exposure to loss due to being offline for too long.
17765 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
17766 * for more information.
17768 * Default value: 10.
17769 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
17770 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
17772 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
17775 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
17776 * BOLTs) option for outbound private channels. This provides better privacy by not including
17777 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
17778 * relay HTLCs to us using the channel's SCID alias.
17780 * If this option is set, channels may be created that will not be readable by LDK versions
17781 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
17782 * [`DecodeError::InvalidValue`].
17784 * Note that setting this to true does *not* prevent us from opening channels with
17785 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
17786 * private channel without that option.
17788 * Ignored if the channel is negotiated to be announced, see
17789 * [`ChannelHandshakeConfig::announced_channel`] and
17790 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
17792 * Default value: false. This value is likely to change to true in the future.
17794 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17795 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
17797 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17800 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
17801 * BOLTs) option for outbound private channels. This provides better privacy by not including
17802 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
17803 * relay HTLCs to us using the channel's SCID alias.
17805 * If this option is set, channels may be created that will not be readable by LDK versions
17806 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
17807 * [`DecodeError::InvalidValue`].
17809 * Note that setting this to true does *not* prevent us from opening channels with
17810 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
17811 * private channel without that option.
17813 * Ignored if the channel is negotiated to be announced, see
17814 * [`ChannelHandshakeConfig::announced_channel`] and
17815 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
17817 * Default value: false. This value is likely to change to true in the future.
17819 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17820 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
17822 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
17825 * Set to announce the channel publicly and notify all nodes that they can route via this
17828 * This should only be set to true for nodes which expect to be online reliably.
17830 * As the node which funds a channel picks this value this will only apply for new outbound
17831 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
17833 * Default value: false.
17835 bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17838 * Set to announce the channel publicly and notify all nodes that they can route via this
17841 * This should only be set to true for nodes which expect to be online reliably.
17843 * As the node which funds a channel picks this value this will only apply for new outbound
17844 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
17846 * Default value: false.
17848 void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
17851 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
17852 * supports it, they will then enforce the mutual-close output to us matches what we provided
17853 * at intialization, preventing us from closing to an alternate pubkey.
17855 * This is set to true by default to provide a slight increase in security, though ultimately
17856 * any attacker who is able to take control of a channel can just as easily send the funds via
17857 * lightning payments, so we never require that our counterparties support this option.
17859 * The upfront key committed is provided from [`KeysInterface::get_shutdown_scriptpubkey`].
17861 * Default value: true.
17863 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
17865 bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17868 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
17869 * supports it, they will then enforce the mutual-close output to us matches what we provided
17870 * at intialization, preventing us from closing to an alternate pubkey.
17872 * This is set to true by default to provide a slight increase in security, though ultimately
17873 * any attacker who is able to take control of a channel can just as easily send the funds via
17874 * lightning payments, so we never require that our counterparties support this option.
17876 * The upfront key committed is provided from [`KeysInterface::get_shutdown_scriptpubkey`].
17878 * Default value: true.
17880 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
17882 void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
17885 * Constructs a new ChannelHandshakeConfig given each field
17887 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, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
17890 * Creates a copy of the ChannelHandshakeConfig
17892 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
17895 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
17897 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
17900 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
17902 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
17905 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
17906 * only applies to inbound channels.
17908 * Default value: 0.
17910 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17913 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
17914 * only applies to inbound channels.
17916 * Default value: 0.
17918 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17921 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
17922 * only applies to inbound channels.
17924 * Default value: 2^24 - 1.
17926 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17929 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
17930 * only applies to inbound channels.
17932 * Default value: 2^24 - 1.
17934 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17937 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
17938 * you to limit the maximum minimum-size they can require.
17940 * Default value: u64::max_value.
17942 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17945 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
17946 * you to limit the maximum minimum-size they can require.
17948 * Default value: u64::max_value.
17950 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17953 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
17954 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
17956 * Default value: 0.
17958 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17961 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
17962 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
17964 * Default value: 0.
17966 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17969 * The remote node will require we keep a certain amount in direct payment to ourselves at all
17970 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
17971 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
17973 * Default value: u64::max_value.
17975 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17978 * The remote node will require we keep a certain amount in direct payment to ourselves at all
17979 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
17980 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
17982 * Default value: u64::max_value.
17984 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17987 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
17988 * time. This allows you to set a minimum such value.
17990 * Default value: 0.
17992 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17995 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
17996 * time. This allows you to set a minimum such value.
17998 * Default value: 0.
18000 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
18003 * Before a channel is usable the funding transaction will need to be confirmed by at least a
18004 * certain number of blocks, specified by the node which is not the funder (as the funder can
18005 * assume they aren't going to double-spend themselves).
18006 * This config allows you to set a limit on the maximum amount of time to wait.
18008 * Default value: 144, or roughly one day and only applies to outbound channels.
18010 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18013 * Before a channel is usable the funding transaction will need to be confirmed by at least a
18014 * certain number of blocks, specified by the node which is not the funder (as the funder can
18015 * assume they aren't going to double-spend themselves).
18016 * This config allows you to set a limit on the maximum amount of time to wait.
18018 * Default value: 144, or roughly one day and only applies to outbound channels.
18020 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
18023 * Whether we implicitly trust funding transactions generated by us for our own outbound
18024 * channels to not be double-spent.
18026 * If this is set, we assume that our own funding transactions are *never* double-spent, and
18027 * thus we can trust them without any confirmations. This is generally a reasonable
18028 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
18029 * control of the signing keys).
18031 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
18032 * double-spend the funding transaction to RBF with an alternative channel open.
18034 * This only applies if our counterparty set their confirmations-required value to 0, and we
18035 * always trust our own funding transaction at 1 confirmation irrespective of this value.
18036 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
18037 * `true` (0) and `false` (1).
18039 * Default value: true
18041 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18044 * Whether we implicitly trust funding transactions generated by us for our own outbound
18045 * channels to not be double-spent.
18047 * If this is set, we assume that our own funding transactions are *never* double-spent, and
18048 * thus we can trust them without any confirmations. This is generally a reasonable
18049 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
18050 * control of the signing keys).
18052 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
18053 * double-spend the funding transaction to RBF with an alternative channel open.
18055 * This only applies if our counterparty set their confirmations-required value to 0, and we
18056 * always trust our own funding transaction at 1 confirmation irrespective of this value.
18057 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
18058 * `true` (0) and `false` (1).
18060 * Default value: true
18062 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
18065 * Set to force an incoming channel to match our announced channel preference in
18066 * [`ChannelHandshakeConfig::announced_channel`].
18068 * For a node which is not online reliably, this should be set to true and
18069 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
18070 * channels will ever be opened.
18072 * Default value: true.
18074 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18077 * Set to force an incoming channel to match our announced channel preference in
18078 * [`ChannelHandshakeConfig::announced_channel`].
18080 * For a node which is not online reliably, this should be set to true and
18081 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
18082 * channels will ever be opened.
18084 * Default value: true.
18086 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
18089 * Set to the amount of time we're willing to wait to claim money back to us.
18091 * Not checking this value would be a security issue, as our peer would be able to set it to
18092 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
18094 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
18095 * reduce the loss of having useless locked funds (if your peer accepts)
18097 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18100 * Set to the amount of time we're willing to wait to claim money back to us.
18102 * Not checking this value would be a security issue, as our peer would be able to set it to
18103 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
18105 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
18106 * reduce the loss of having useless locked funds (if your peer accepts)
18108 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
18111 * Constructs a new ChannelHandshakeLimits given each field
18113 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);
18116 * Creates a copy of the ChannelHandshakeLimits
18118 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
18121 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
18123 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
18126 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
18128 void ChannelConfig_free(struct LDKChannelConfig this_obj);
18131 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
18132 * over the channel.
18133 * This may be allowed to change at runtime in a later update, however doing so must result in
18134 * update messages sent to notify all nodes of our updated relay fee.
18136 * Default value: 0.
18138 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18141 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
18142 * over the channel.
18143 * This may be allowed to change at runtime in a later update, however doing so must result in
18144 * update messages sent to notify all nodes of our updated relay fee.
18146 * Default value: 0.
18148 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
18151 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
18152 * excess of [`forwarding_fee_proportional_millionths`].
18153 * This may be allowed to change at runtime in a later update, however doing so must result in
18154 * update messages sent to notify all nodes of our updated relay fee.
18156 * The default value of a single satoshi roughly matches the market rate on many routing nodes
18157 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
18160 * Default value: 1000.
18162 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
18164 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18167 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
18168 * excess of [`forwarding_fee_proportional_millionths`].
18169 * This may be allowed to change at runtime in a later update, however doing so must result in
18170 * update messages sent to notify all nodes of our updated relay fee.
18172 * The default value of a single satoshi roughly matches the market rate on many routing nodes
18173 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
18176 * Default value: 1000.
18178 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
18180 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
18183 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
18184 * the channel this config applies to.
18186 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
18187 * HTLC balance when a channel appears on-chain whereas
18188 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
18189 * (non-HTLC-encumbered) balance.
18191 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
18192 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
18193 * commitment transaction at least once per this many blocks (minus some margin to allow us
18194 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
18195 * the spending transaction).
18197 * Default value: 72 (12 hours at an average of 6 blocks/hour).
18198 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
18199 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
18201 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
18203 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18206 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
18207 * the channel this config applies to.
18209 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
18210 * HTLC balance when a channel appears on-chain whereas
18211 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
18212 * (non-HTLC-encumbered) balance.
18214 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
18215 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
18216 * commitment transaction at least once per this many blocks (minus some margin to allow us
18217 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
18218 * the spending transaction).
18220 * Default value: 72 (12 hours at an average of 6 blocks/hour).
18221 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
18222 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
18224 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
18226 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
18229 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
18230 * small to claim on-chain.
18232 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
18233 * not be claimable on-chain, instead being turned into additional miner fees if either
18234 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
18235 * to such payments may be sustantial if there are many dust HTLCs present when the
18236 * channel is force-closed.
18238 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
18239 * exposure across all three types per-channel. Setting this too low may prevent the
18240 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
18241 * important to prevent stealing of dust HTLCs by miners.
18243 * Default value: 5_000_000 msat.
18245 uint64_t ChannelConfig_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18248 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
18249 * small to claim on-chain.
18251 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
18252 * not be claimable on-chain, instead being turned into additional miner fees if either
18253 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
18254 * to such payments may be sustantial if there are many dust HTLCs present when the
18255 * channel is force-closed.
18257 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
18258 * exposure across all three types per-channel. Setting this too low may prevent the
18259 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
18260 * important to prevent stealing of dust HTLCs by miners.
18262 * Default value: 5_000_000 msat.
18264 void ChannelConfig_set_max_dust_htlc_exposure_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
18267 * The additional fee we're willing to pay to avoid waiting for the counterparty's
18268 * `to_self_delay` to reclaim funds.
18270 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
18271 * closing transaction which both sides find acceptable, ultimately paid by the channel
18272 * funder/initiator.
18274 * When we are the funder, because we have to pay the channel closing fee, we bound the
18275 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
18276 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
18277 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
18278 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
18281 * When we are not the funder, we require the closing transaction fee pay at least our
18282 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
18283 * Thus, this value is ignored when we are not the funder.
18285 * Default value: 1000 satoshis.
18287 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
18288 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
18290 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18293 * The additional fee we're willing to pay to avoid waiting for the counterparty's
18294 * `to_self_delay` to reclaim funds.
18296 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
18297 * closing transaction which both sides find acceptable, ultimately paid by the channel
18298 * funder/initiator.
18300 * When we are the funder, because we have to pay the channel closing fee, we bound the
18301 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
18302 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
18303 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
18304 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
18307 * When we are not the funder, we require the closing transaction fee pay at least our
18308 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
18309 * Thus, this value is ignored when we are not the funder.
18311 * Default value: 1000 satoshis.
18313 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
18314 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
18316 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
18319 * Constructs a new ChannelConfig given each field
18321 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, uint64_t max_dust_htlc_exposure_msat_arg, uint64_t force_close_avoidance_max_fee_satoshis_arg);
18324 * Creates a copy of the ChannelConfig
18326 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
18329 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
18331 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
18334 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
18336 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
18339 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
18341 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
18344 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
18346 void UserConfig_free(struct LDKUserConfig this_obj);
18349 * Channel handshake config that we propose to our counterparty.
18351 struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18354 * Channel handshake config that we propose to our counterparty.
18356 void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
18359 * Limits applied to our counterparty's proposed channel handshake config settings.
18361 struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18364 * Limits applied to our counterparty's proposed channel handshake config settings.
18366 void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
18369 * Channel config which affects behavior during channel lifetime.
18371 struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18374 * Channel config which affects behavior during channel lifetime.
18376 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
18379 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
18380 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
18381 * node which is not online reliably.
18383 * For nodes which are not online reliably, you should set all channels to *not* be announced
18384 * (using [`ChannelHandshakeConfig::announced_channel`] and
18385 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
18386 * ensure you are not exposed to any forwarding risk.
18388 * Note that because you cannot change a channel's announced state after creation, there is no
18389 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
18390 * from a publicly-announced forwarding node to a private non-forwarding node you must close
18391 * all your channels and open new ones. For privacy, you should also change your node_id
18392 * (swapping all private and public key material for new ones) at that time.
18394 * Default value: false.
18396 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18399 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
18400 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
18401 * node which is not online reliably.
18403 * For nodes which are not online reliably, you should set all channels to *not* be announced
18404 * (using [`ChannelHandshakeConfig::announced_channel`] and
18405 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
18406 * ensure you are not exposed to any forwarding risk.
18408 * Note that because you cannot change a channel's announced state after creation, there is no
18409 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
18410 * from a publicly-announced forwarding node to a private non-forwarding node you must close
18411 * all your channels and open new ones. For privacy, you should also change your node_id
18412 * (swapping all private and public key material for new ones) at that time.
18414 * Default value: false.
18416 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
18419 * If this is set to false, we do not accept inbound requests to open a new channel.
18420 * Default value: true.
18422 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18425 * If this is set to false, we do not accept inbound requests to open a new channel.
18426 * Default value: true.
18428 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
18431 * If this is set to true, the user needs to manually accept inbound requests to open a new
18434 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
18435 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
18436 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
18437 * user explicitly chooses to accept the request.
18439 * Default value: false.
18441 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
18442 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
18443 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
18445 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18448 * If this is set to true, the user needs to manually accept inbound requests to open a new
18451 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
18452 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
18453 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
18454 * user explicitly chooses to accept the request.
18456 * Default value: false.
18458 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
18459 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
18460 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
18462 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
18465 * Constructs a new UserConfig given each field
18467 MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig channel_handshake_config_arg, struct LDKChannelHandshakeLimits channel_handshake_limits_arg, struct LDKChannelConfig channel_config_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg, bool manually_accept_inbound_channels_arg);
18470 * Creates a copy of the UserConfig
18472 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
18475 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
18477 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
18480 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
18482 void BestBlock_free(struct LDKBestBlock this_obj);
18485 * Creates a copy of the BestBlock
18487 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
18490 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
18493 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
18496 * Returns a `BestBlock` as identified by the given block hash and height.
18498 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
18501 * Returns the best block hash.
18503 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
18506 * Returns the best block height.
18508 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
18511 * Creates a copy of the AccessError
18513 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
18516 * Utility method to constructs a new UnknownChain-variant AccessError
18518 enum LDKAccessError AccessError_unknown_chain(void);
18521 * Utility method to constructs a new UnknownTx-variant AccessError
18523 enum LDKAccessError AccessError_unknown_tx(void);
18526 * Calls the free function if one is set
18528 void Access_free(struct LDKAccess this_ptr);
18531 * Calls the free function if one is set
18533 void Listen_free(struct LDKListen this_ptr);
18536 * Calls the free function if one is set
18538 void Confirm_free(struct LDKConfirm this_ptr);
18541 * Creates a copy of the ChannelMonitorUpdateErr
18543 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
18546 * Utility method to constructs a new TemporaryFailure-variant ChannelMonitorUpdateErr
18548 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_temporary_failure(void);
18551 * Utility method to constructs a new PermanentFailure-variant ChannelMonitorUpdateErr
18553 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_permanent_failure(void);
18556 * Calls the free function if one is set
18558 void Watch_free(struct LDKWatch this_ptr);
18561 * Calls the free function if one is set
18563 void Filter_free(struct LDKFilter this_ptr);
18566 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
18568 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
18571 * First block where the transaction output may have been spent.
18573 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18575 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
18578 * First block where the transaction output may have been spent.
18580 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
18582 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18585 * Outpoint identifying the transaction output.
18587 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
18590 * Outpoint identifying the transaction output.
18592 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
18595 * Spending condition of the transaction output.
18597 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
18600 * Spending condition of the transaction output.
18602 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
18605 * Constructs a new WatchedOutput given each field
18607 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
18610 * Creates a copy of the WatchedOutput
18612 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
18615 * Checks if two WatchedOutputs contain equal inner contents.
18617 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
18620 * Calls the free function if one is set
18622 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
18625 * Creates a copy of the ConfirmationTarget
18627 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
18630 * Utility method to constructs a new Background-variant ConfirmationTarget
18632 enum LDKConfirmationTarget ConfirmationTarget_background(void);
18635 * Utility method to constructs a new Normal-variant ConfirmationTarget
18637 enum LDKConfirmationTarget ConfirmationTarget_normal(void);
18640 * Utility method to constructs a new HighPriority-variant ConfirmationTarget
18642 enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
18645 * Checks if two ConfirmationTargets contain equal inner contents.
18646 * This ignores pointers and is_owned flags and looks at the values in fields.
18648 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
18651 * Calls the free function if one is set
18653 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
18656 * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
18658 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
18661 * Creates a copy of the MonitorUpdateId
18663 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
18666 * Checks if two MonitorUpdateIds contain equal inner contents.
18668 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
18671 * Checks if two MonitorUpdateIds contain equal inner contents.
18672 * This ignores pointers and is_owned flags and looks at the values in fields.
18673 * Two objects with NULL inner values will be considered "equal" here.
18675 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
18678 * Calls the free function if one is set
18680 void Persist_free(struct LDKPersist this_ptr);
18683 * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
18685 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
18688 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
18690 void ChainMonitor_free(struct LDKChainMonitor this_obj);
18693 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
18695 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
18696 * will call back to it indicating transactions and outputs of interest. This allows clients to
18697 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
18698 * always need to fetch full blocks absent another means for determining which blocks contain
18699 * transactions relevant to the watched channels.
18701 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
18704 * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
18705 * claims which are awaiting confirmation.
18707 * Includes the balances from each [`ChannelMonitor`] *except* those included in
18708 * `ignored_channels`, allowing you to filter out balances from channels which are still open
18709 * (and whose balance should likely be pulled from the [`ChannelDetails`]).
18711 * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
18712 * inclusion in the return value.
18714 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
18717 * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
18718 * such [`ChannelMonitor`] is currently being monitored for.
18720 * Note that the result holds a mutex over our monitor set, and should not be held
18723 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
18726 * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
18728 * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
18729 * monitoring for on-chain state resolutions.
18731 MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
18734 * Indicates the persistence of a [`ChannelMonitor`] has completed after
18735 * [`ChannelMonitorUpdateErr::TemporaryFailure`] was returned from an update operation.
18737 * Thus, the anticipated use is, at a high level:
18738 * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
18739 * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
18740 * returning [`ChannelMonitorUpdateErr::TemporaryFailure`],
18741 * 2) once all remote copies are updated, you call this function with the
18742 * `completed_update_id` that completed, and once all pending updates have completed the
18743 * channel will be re-enabled.
18745 * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
18746 * registered [`ChannelMonitor`]s.
18748 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);
18751 * Constructs a new Listen which calls the relevant methods on this_arg.
18752 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
18754 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
18757 * Constructs a new Confirm which calls the relevant methods on this_arg.
18758 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
18760 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
18763 * Constructs a new Watch which calls the relevant methods on this_arg.
18764 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
18766 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
18769 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
18770 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
18772 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
18775 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
18777 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
18780 * The sequence number of this update. Updates *must* be replayed in-order according to this
18781 * sequence number (and updates may panic if they are not). The update_id values are strictly
18782 * increasing and increase by one for each new update, with one exception specified below.
18784 * This sequence number is also used to track up to which points updates which returned
18785 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
18786 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
18788 * The only instance where update_id values are not strictly increasing is the case where we
18789 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
18790 * its docs for more details.
18792 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
18795 * The sequence number of this update. Updates *must* be replayed in-order according to this
18796 * sequence number (and updates may panic if they are not). The update_id values are strictly
18797 * increasing and increase by one for each new update, with one exception specified below.
18799 * This sequence number is also used to track up to which points updates which returned
18800 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
18801 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
18803 * The only instance where update_id values are not strictly increasing is the case where we
18804 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
18805 * its docs for more details.
18807 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
18810 * Creates a copy of the ChannelMonitorUpdate
18812 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
18815 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
18817 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
18820 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
18822 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
18825 * Frees any resources used by the MonitorEvent
18827 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
18830 * Creates a copy of the MonitorEvent
18832 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
18835 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
18837 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
18840 * Utility method to constructs a new CommitmentTxConfirmed-variant MonitorEvent
18842 struct LDKMonitorEvent MonitorEvent_commitment_tx_confirmed(struct LDKOutPoint a);
18845 * Utility method to constructs a new UpdateCompleted-variant MonitorEvent
18847 struct LDKMonitorEvent MonitorEvent_update_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
18850 * Utility method to constructs a new UpdateFailed-variant MonitorEvent
18852 struct LDKMonitorEvent MonitorEvent_update_failed(struct LDKOutPoint a);
18855 * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
18857 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
18860 * Read a MonitorEvent from a byte array, created by MonitorEvent_write
18862 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
18865 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
18867 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
18870 * Creates a copy of the HTLCUpdate
18872 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
18875 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
18877 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
18880 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
18882 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
18885 * Frees any resources used by the Balance
18887 void Balance_free(struct LDKBalance this_ptr);
18890 * Creates a copy of the Balance
18892 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
18895 * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
18897 struct LDKBalance Balance_claimable_on_channel_close(uint64_t claimable_amount_satoshis);
18900 * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
18902 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t claimable_amount_satoshis, uint32_t confirmation_height);
18905 * Utility method to constructs a new ContentiousClaimable-variant Balance
18907 struct LDKBalance Balance_contentious_claimable(uint64_t claimable_amount_satoshis, uint32_t timeout_height);
18910 * Utility method to constructs a new MaybeClaimableHTLCAwaitingTimeout-variant Balance
18912 struct LDKBalance Balance_maybe_claimable_htlcawaiting_timeout(uint64_t claimable_amount_satoshis, uint32_t claimable_height);
18915 * Checks if two Balances contain equal inner contents.
18916 * This ignores pointers and is_owned flags and looks at the values in fields.
18918 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
18921 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
18923 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
18926 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
18928 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
18931 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
18934 * panics if the given update is not the next update by update_id.
18936 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);
18939 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
18942 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18945 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
18947 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18950 * Gets a list of txids, with their output scripts (in the order they appear in the
18951 * transaction), which we must learn about spends of via block_connected().
18953 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18956 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
18957 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
18958 * have been registered.
18960 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
18963 * Get the list of HTLCs who's status has been updated on chain. This should be called by
18964 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
18966 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18969 * Gets the list of pending events which were generated by previous actions, clearing the list
18972 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
18973 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
18974 * no internal locking in ChannelMonitors.
18976 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18979 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
18980 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
18981 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
18982 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
18983 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
18984 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
18985 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
18986 * out-of-band the other node operator to coordinate with him if option is available to you.
18987 * In any-case, choice is up to the user.
18989 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);
18992 * Processes transactions in a newly connected block, which may result in any of the following:
18993 * - update the monitor's state against resolved HTLCs
18994 * - punish the counterparty in the case of seeing a revoked commitment transaction
18995 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
18996 * - detect settled outputs for later spending
18997 * - schedule and bump any in-flight claims
18999 * Returns any new outputs to watch from `txdata`; after called, these are also included in
19000 * [`get_outputs_to_watch`].
19002 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
19004 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);
19007 * Determines if the disconnected block contained any transactions of interest and updates
19010 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);
19013 * Processes transactions confirmed in a block with the given header and height, returning new
19014 * outputs to watch. See [`block_connected`] for details.
19016 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
19017 * blocks. See [`chain::Confirm`] for calling expectations.
19019 * [`block_connected`]: Self::block_connected
19021 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);
19024 * Processes a transaction that was reorganized out of the chain.
19026 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
19027 * than blocks. See [`chain::Confirm`] for calling expectations.
19029 * [`block_disconnected`]: Self::block_disconnected
19031 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);
19034 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
19035 * [`block_connected`] for details.
19037 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
19038 * blocks. See [`chain::Confirm`] for calling expectations.
19040 * [`block_connected`]: Self::block_connected
19042 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);
19045 * Returns the set of txids that should be monitored for re-organization out of the chain.
19047 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19050 * Gets the latest best block which was connected either via the [`chain::Listen`] or
19051 * [`chain::Confirm`] interfaces.
19053 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19056 * Gets the balances in this channel which are either claimable by us if we were to
19057 * force-close the channel now or which are claimable on-chain (possibly awaiting
19060 * Any balances in the channel which are available on-chain (excluding on-chain fees) are
19061 * included here until an [`Event::SpendableOutputs`] event has been generated for the
19062 * balance, or until our counterparty has claimed the balance and accrued several
19063 * confirmations on the claim transaction.
19065 * Note that the balances available when you or your counterparty have broadcasted revoked
19066 * state(s) may not be fully captured here.
19068 * See [`Balance`] for additional details on the types of claimable balances which
19069 * may be returned here and their meanings.
19071 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19074 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
19076 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
19079 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
19081 void OutPoint_free(struct LDKOutPoint this_obj);
19084 * The referenced transaction's txid.
19086 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
19089 * The referenced transaction's txid.
19091 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19094 * The index of the referenced output in its transaction's vout.
19096 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
19099 * The index of the referenced output in its transaction's vout.
19101 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
19104 * Constructs a new OutPoint given each field
19106 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
19109 * Creates a copy of the OutPoint
19111 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
19114 * Checks if two OutPoints contain equal inner contents.
19115 * This ignores pointers and is_owned flags and looks at the values in fields.
19116 * Two objects with NULL inner values will be considered "equal" here.
19118 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
19121 * Checks if two OutPoints contain equal inner contents.
19123 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
19126 * Convert an `OutPoint` to a lightning channel id.
19128 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
19131 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
19133 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
19136 * Read a OutPoint from a byte array, created by OutPoint_write
19138 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
19141 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
19143 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
19146 * The outpoint which is spendable
19148 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19151 * The outpoint which is spendable
19153 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
19156 * Per commitment point to derive delayed_payment_key by key holder
19158 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19161 * Per commitment point to derive delayed_payment_key by key holder
19163 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19166 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
19167 * the witness_script.
19169 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19172 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
19173 * the witness_script.
19175 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
19178 * The output which is referenced by the given outpoint
19180 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
19183 * The revocation point specific to the commitment transaction which was broadcast. Used to
19184 * derive the witnessScript for this output.
19186 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19189 * The revocation point specific to the commitment transaction which was broadcast. Used to
19190 * derive the witnessScript for this output.
19192 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19195 * Arbitrary identification information returned by a call to
19196 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
19197 * the channel to spend the output.
19199 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
19202 * Arbitrary identification information returned by a call to
19203 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
19204 * the channel to spend the output.
19206 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19209 * The value of the channel which this output originated from, possibly indirectly.
19211 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19214 * The value of the channel which this output originated from, possibly indirectly.
19216 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
19219 * Constructs a new DelayedPaymentOutputDescriptor given each field
19221 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);
19224 * Creates a copy of the DelayedPaymentOutputDescriptor
19226 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
19229 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
19231 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
19234 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
19236 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
19239 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
19241 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
19244 * The outpoint which is spendable
19246 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19249 * The outpoint which is spendable
19251 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
19254 * The output which is referenced by the given outpoint
19256 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
19259 * Arbitrary identification information returned by a call to
19260 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
19261 * the channel to spend the output.
19263 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
19266 * Arbitrary identification information returned by a call to
19267 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
19268 * the channel to spend the output.
19270 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19273 * The value of the channel which this transactions spends.
19275 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19278 * The value of the channel which this transactions spends.
19280 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
19283 * Constructs a new StaticPaymentOutputDescriptor given each field
19285 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);
19288 * Creates a copy of the StaticPaymentOutputDescriptor
19290 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
19293 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
19295 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
19298 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
19300 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
19303 * Frees any resources used by the SpendableOutputDescriptor
19305 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
19308 * Creates a copy of the SpendableOutputDescriptor
19310 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
19313 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
19315 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
19318 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
19320 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
19323 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
19325 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
19328 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
19330 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
19333 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
19335 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
19338 * Calls the free function if one is set
19340 void BaseSign_free(struct LDKBaseSign this_ptr);
19343 * Creates a copy of a Sign
19345 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
19348 * Calls the free function if one is set
19350 void Sign_free(struct LDKSign this_ptr);
19353 * Creates a copy of the Recipient
19355 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
19358 * Utility method to constructs a new Node-variant Recipient
19360 enum LDKRecipient Recipient_node(void);
19363 * Utility method to constructs a new PhantomNode-variant Recipient
19365 enum LDKRecipient Recipient_phantom_node(void);
19368 * Calls the free function if one is set
19370 void KeysInterface_free(struct LDKKeysInterface this_ptr);
19373 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
19375 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
19378 * Private key of anchor tx
19380 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19383 * Private key of anchor tx
19385 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19388 * Holder secret key for blinded revocation pubkey
19390 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19393 * Holder secret key for blinded revocation pubkey
19395 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19398 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
19400 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19403 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
19405 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19408 * Holder secret key used in HTLC tx
19410 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19413 * Holder secret key used in HTLC tx
19415 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19418 * Holder htlc secret key used in commitment tx htlc outputs
19420 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19423 * Holder htlc secret key used in commitment tx htlc outputs
19425 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19430 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19435 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19438 * Creates a copy of the InMemorySigner
19440 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
19443 * Create a new InMemorySigner
19445 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);
19448 * Counterparty pubkeys.
19449 * Will panic if ready_channel wasn't called.
19451 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19454 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
19455 * transactions, ie the amount of time that we have to wait to recover our funds if we
19456 * broadcast a transaction.
19457 * Will panic if ready_channel wasn't called.
19459 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19462 * The contest_delay value specified by us and applied on transactions broadcastable
19463 * by our counterparty, ie the amount of time that they have to wait to recover their funds
19464 * if they broadcast a transaction.
19465 * Will panic if ready_channel wasn't called.
19467 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19470 * Whether the holder is the initiator
19471 * Will panic if ready_channel wasn't called.
19473 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19477 * Will panic if ready_channel wasn't called.
19479 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19482 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
19483 * building transactions.
19485 * Will panic if ready_channel wasn't called.
19487 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19490 * Whether anchors should be used.
19491 * Will panic if ready_channel wasn't called.
19493 MUST_USE_RES bool InMemorySigner_opt_anchors(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19496 * Sign the single input of spend_tx at index `input_idx` which spends the output
19497 * described by descriptor, returning the witness stack for the input.
19499 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
19500 * is not spending the outpoint described by `descriptor.outpoint`,
19501 * or if an output descriptor script_pubkey does not match the one we can spend.
19503 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);
19506 * Sign the single input of spend_tx at index `input_idx` which spends the output
19507 * described by descriptor, returning the witness stack for the input.
19509 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
19510 * is not spending the outpoint described by `descriptor.outpoint`, does not have a
19511 * sequence set to `descriptor.to_self_delay`, or if an output descriptor
19512 * script_pubkey does not match the one we can spend.
19514 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);
19517 * Constructs a new BaseSign which calls the relevant methods on this_arg.
19518 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
19520 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19523 * Constructs a new Sign which calls the relevant methods on this_arg.
19524 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
19526 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19529 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
19531 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
19534 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
19536 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKSecretKey arg);
19539 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
19541 void KeysManager_free(struct LDKKeysManager this_obj);
19544 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
19545 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
19546 * starting_time isn't strictly required to actually be a time, but it must absolutely,
19547 * without a doubt, be unique to this instance. ie if you start multiple times with the same
19548 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
19549 * simply use the current time (with very high precision).
19551 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
19552 * obviously, starting_time should be unique every time you reload the library - it is only
19553 * used to generate new ephemeral key data (which will be stored by the individual channel if
19556 * Note that the seed is required to recover certain on-chain funds independent of
19557 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
19558 * channel, and some on-chain during-closing funds.
19560 * Note that until the 0.1 release there is no guarantee of backward compatibility between
19561 * versions. Once the library is more fully supported, the docs will be updated to include a
19562 * detailed description of the guarantee.
19564 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
19567 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
19569 * Key derivation parameters are accessible through a per-channel secrets
19570 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
19571 * onchain output detection for which a corresponding delayed_payment_key must be derived.
19573 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]);
19576 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
19577 * output to the given change destination (if sufficient change value remains). The
19578 * transaction will have a feerate, at least, of the given value.
19580 * Returns `Err(())` if the output value is greater than the input value minus required fee,
19581 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
19582 * does not match the one we can spend.
19584 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
19586 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
19587 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
19589 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);
19592 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
19593 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
19595 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
19598 * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
19600 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
19603 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
19604 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
19606 struct LDKKeysInterface PhantomKeysManager_as_KeysInterface(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
19609 * Constructs a `PhantomKeysManager` given a 32-byte seed and an additional `cross_node_seed`
19610 * that is shared across all nodes that intend to participate in [phantom node payments] together.
19612 * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
19613 * `starting_time_nanos`.
19615 * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
19616 * same across restarts, or else inbound payments may fail.
19618 * [phantom node payments]: PhantomKeysManager
19620 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]);
19623 * See [`KeysManager::spend_spendable_outputs`] for documentation on this method.
19625 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);
19628 * See [`KeysManager::derive_channel_keys`] for documentation on this method.
19630 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]);
19633 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
19635 void ChannelManager_free(struct LDKChannelManager this_obj);
19638 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
19640 void ChainParameters_free(struct LDKChainParameters this_obj);
19643 * The network for determining the `chain_hash` in Lightning messages.
19645 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
19648 * The network for determining the `chain_hash` in Lightning messages.
19650 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
19653 * The hash and height of the latest block successfully connected.
19655 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
19657 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
19660 * The hash and height of the latest block successfully connected.
19662 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
19664 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
19667 * Constructs a new ChainParameters given each field
19669 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
19672 * Creates a copy of the ChainParameters
19674 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
19677 * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
19679 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
19682 * Base routing fee in millisatoshis.
19684 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
19687 * Base routing fee in millisatoshis.
19689 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
19692 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
19694 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
19697 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
19699 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
19702 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
19703 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
19704 * `cltv_expiry_delta` for more details.
19706 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
19709 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
19710 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
19711 * `cltv_expiry_delta` for more details.
19713 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
19716 * Constructs a new CounterpartyForwardingInfo given each field
19718 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);
19721 * Creates a copy of the CounterpartyForwardingInfo
19723 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
19726 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
19728 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
19731 * The node_id of our counterparty
19733 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19736 * The node_id of our counterparty
19738 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19741 * The Features the channel counterparty provided upon last connection.
19742 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
19743 * many routing-relevant features are present in the init context.
19745 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19748 * The Features the channel counterparty provided upon last connection.
19749 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
19750 * many routing-relevant features are present in the init context.
19752 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
19755 * The value, in satoshis, that must always be held in the channel for our counterparty. This
19756 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
19757 * claiming at least this value on chain.
19759 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
19761 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
19763 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19766 * The value, in satoshis, that must always be held in the channel for our counterparty. This
19767 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
19768 * claiming at least this value on chain.
19770 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
19772 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
19774 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
19777 * Information on the fees and requirements that the counterparty requires when forwarding
19778 * payments to us through this channel.
19780 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19782 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19785 * Information on the fees and requirements that the counterparty requires when forwarding
19786 * payments to us through this channel.
19788 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
19790 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
19793 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
19794 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
19795 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
19797 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19800 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
19801 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
19802 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
19804 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
19807 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
19809 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19812 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
19814 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
19817 * Constructs a new ChannelCounterparty given each field
19819 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);
19822 * Creates a copy of the ChannelCounterparty
19824 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
19827 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
19829 void ChannelDetails_free(struct LDKChannelDetails this_obj);
19832 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
19833 * thereafter this is the txid of the funding transaction xor the funding transaction output).
19834 * Note that this means this value is *not* persistent - it can change once during the
19835 * lifetime of the channel.
19837 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
19840 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
19841 * thereafter this is the txid of the funding transaction xor the funding transaction output).
19842 * Note that this means this value is *not* persistent - it can change once during the
19843 * lifetime of the channel.
19845 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19848 * Parameters which apply to our counterparty. See individual fields for more information.
19850 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19853 * Parameters which apply to our counterparty. See individual fields for more information.
19855 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
19858 * The Channel's funding transaction output, if we've negotiated the funding transaction with
19859 * our counterparty already.
19861 * Note that, if this has been set, `channel_id` will be equivalent to
19862 * `funding_txo.unwrap().to_channel_id()`.
19864 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19866 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19869 * The Channel's funding transaction output, if we've negotiated the funding transaction with
19870 * our counterparty already.
19872 * Note that, if this has been set, `channel_id` will be equivalent to
19873 * `funding_txo.unwrap().to_channel_id()`.
19875 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
19877 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
19880 * The features which this channel operates with. See individual features for more info.
19882 * `None` until negotiation completes and the channel type is finalized.
19884 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19886 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19889 * The features which this channel operates with. See individual features for more info.
19891 * `None` until negotiation completes and the channel type is finalized.
19893 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
19895 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
19898 * The position of the funding transaction in the chain. None if the funding transaction has
19899 * not yet been confirmed and the channel fully opened.
19901 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
19902 * payments instead of this. See [`get_inbound_payment_scid`].
19904 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
19905 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
19907 * [`inbound_scid_alias`]: Self::inbound_scid_alias
19908 * [`outbound_scid_alias`]: Self::outbound_scid_alias
19909 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
19910 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
19911 * [`confirmations_required`]: Self::confirmations_required
19913 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19916 * The position of the funding transaction in the chain. None if the funding transaction has
19917 * not yet been confirmed and the channel fully opened.
19919 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
19920 * payments instead of this. See [`get_inbound_payment_scid`].
19922 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
19923 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
19925 * [`inbound_scid_alias`]: Self::inbound_scid_alias
19926 * [`outbound_scid_alias`]: Self::outbound_scid_alias
19927 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
19928 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
19929 * [`confirmations_required`]: Self::confirmations_required
19931 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
19934 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
19935 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
19936 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
19939 * This will be `None` as long as the channel is not available for routing outbound payments.
19941 * [`short_channel_id`]: Self::short_channel_id
19942 * [`confirmations_required`]: Self::confirmations_required
19944 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19947 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
19948 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
19949 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
19952 * This will be `None` as long as the channel is not available for routing outbound payments.
19954 * [`short_channel_id`]: Self::short_channel_id
19955 * [`confirmations_required`]: Self::confirmations_required
19957 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
19960 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
19961 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
19962 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
19963 * when they see a payment to be routed to us.
19965 * Our counterparty may choose to rotate this value at any time, though will always recognize
19966 * previous values for inbound payment forwarding.
19968 * [`short_channel_id`]: Self::short_channel_id
19970 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19973 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
19974 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
19975 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
19976 * when they see a payment to be routed to us.
19978 * Our counterparty may choose to rotate this value at any time, though will always recognize
19979 * previous values for inbound payment forwarding.
19981 * [`short_channel_id`]: Self::short_channel_id
19983 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
19986 * The value, in satoshis, of this channel as appears in the funding output
19988 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19991 * The value, in satoshis, of this channel as appears in the funding output
19993 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19996 * The value, in satoshis, that must always be held in the channel for us. This value ensures
19997 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
19998 * this value on chain.
20000 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
20002 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20004 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
20006 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20009 * The value, in satoshis, that must always be held in the channel for us. This value ensures
20010 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
20011 * this value on chain.
20013 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
20015 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20017 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
20019 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20022 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
20024 uint64_t ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20027 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
20029 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
20032 * Our total balance. This is the amount we would get if we close the channel.
20033 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
20034 * amount is not likely to be recoverable on close.
20036 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
20037 * balance is not available for inclusion in new outbound HTLCs). This further does not include
20038 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
20039 * This does not consider any on-chain fees.
20041 * See also [`ChannelDetails::outbound_capacity_msat`]
20043 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20046 * Our total balance. This is the amount we would get if we close the channel.
20047 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
20048 * amount is not likely to be recoverable on close.
20050 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
20051 * balance is not available for inclusion in new outbound HTLCs). This further does not include
20052 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
20053 * This does not consider any on-chain fees.
20055 * See also [`ChannelDetails::outbound_capacity_msat`]
20057 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
20060 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
20061 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
20062 * available for inclusion in new outbound HTLCs). This further does not include any pending
20063 * outgoing HTLCs which are awaiting some other resolution to be sent.
20065 * See also [`ChannelDetails::balance_msat`]
20067 * This value is not exact. Due to various in-flight changes, feerate changes, and our
20068 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
20069 * should be able to spend nearly this amount.
20071 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20074 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
20075 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
20076 * available for inclusion in new outbound HTLCs). This further does not include any pending
20077 * outgoing HTLCs which are awaiting some other resolution to be sent.
20079 * See also [`ChannelDetails::balance_msat`]
20081 * This value is not exact. Due to various in-flight changes, feerate changes, and our
20082 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
20083 * should be able to spend nearly this amount.
20085 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
20088 * The available outbound capacity for sending a single HTLC to the remote peer. This is
20089 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
20090 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
20091 * to use a limit as close as possible to the HTLC limit we can currently send.
20093 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
20095 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20098 * The available outbound capacity for sending a single HTLC to the remote peer. This is
20099 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
20100 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
20101 * to use a limit as close as possible to the HTLC limit we can currently send.
20103 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
20105 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
20108 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
20109 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
20110 * available for inclusion in new inbound HTLCs).
20111 * Note that there are some corner cases not fully handled here, so the actual available
20112 * inbound capacity may be slightly higher than this.
20114 * This value is not exact. Due to various in-flight changes, feerate changes, and our
20115 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
20116 * However, our counterparty should be able to spend nearly this amount.
20118 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20121 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
20122 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
20123 * available for inclusion in new inbound HTLCs).
20124 * Note that there are some corner cases not fully handled here, so the actual available
20125 * inbound capacity may be slightly higher than this.
20127 * This value is not exact. Due to various in-flight changes, feerate changes, and our
20128 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
20129 * However, our counterparty should be able to spend nearly this amount.
20131 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
20134 * The number of required confirmations on the funding transaction before the funding will be
20135 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
20136 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
20137 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
20138 * [`ChannelHandshakeLimits::max_minimum_depth`].
20140 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20142 * [`is_outbound`]: ChannelDetails::is_outbound
20143 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
20144 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
20146 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20149 * The number of required confirmations on the funding transaction before the funding will be
20150 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
20151 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
20152 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
20153 * [`ChannelHandshakeLimits::max_minimum_depth`].
20155 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20157 * [`is_outbound`]: ChannelDetails::is_outbound
20158 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
20159 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
20161 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
20164 * The number of blocks (after our commitment transaction confirms) that we will need to wait
20165 * until we can claim our funds after we force-close the channel. During this time our
20166 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
20167 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
20168 * time to claim our non-HTLC-encumbered funds.
20170 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20172 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20175 * The number of blocks (after our commitment transaction confirms) that we will need to wait
20176 * until we can claim our funds after we force-close the channel. During this time our
20177 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
20178 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
20179 * time to claim our non-HTLC-encumbered funds.
20181 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20183 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
20186 * True if the channel was initiated (and thus funded) by us.
20188 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20191 * True if the channel was initiated (and thus funded) by us.
20193 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
20196 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
20197 * channel is not currently being shut down. `channel_ready` message exchange implies the
20198 * required confirmation count has been reached (and we were connected to the peer at some
20199 * point after the funding transaction received enough confirmations). The required
20200 * confirmation count is provided in [`confirmations_required`].
20202 * [`confirmations_required`]: ChannelDetails::confirmations_required
20204 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20207 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
20208 * channel is not currently being shut down. `channel_ready` message exchange implies the
20209 * required confirmation count has been reached (and we were connected to the peer at some
20210 * point after the funding transaction received enough confirmations). The required
20211 * confirmation count is provided in [`confirmations_required`].
20213 * [`confirmations_required`]: ChannelDetails::confirmations_required
20215 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
20218 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
20219 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
20221 * This is a strict superset of `is_channel_ready`.
20223 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20226 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
20227 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
20229 * This is a strict superset of `is_channel_ready`.
20231 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
20234 * True if this channel is (or will be) publicly-announced.
20236 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20239 * True if this channel is (or will be) publicly-announced.
20241 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
20244 * The smallest value HTLC (in msat) we will accept, for this channel. This field
20245 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
20247 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20250 * The smallest value HTLC (in msat) we will accept, for this channel. This field
20251 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
20253 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20256 * The largest value HTLC (in msat) we currently will accept, for this channel.
20258 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20261 * The largest value HTLC (in msat) we currently will accept, for this channel.
20263 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20266 * Set of configurable parameters that affect channel operation.
20268 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
20270 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20272 struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20275 * Set of configurable parameters that affect channel operation.
20277 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
20279 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
20281 void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
20284 * Constructs a new ChannelDetails given each field
20286 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, struct LDKChannelConfig config_arg);
20289 * Creates a copy of the ChannelDetails
20291 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
20294 * Gets the current SCID which should be used to identify this channel for inbound payments.
20295 * This should be used for providing invoice hints or in any other context where our
20296 * counterparty will forward a payment to us.
20298 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
20299 * [`ChannelDetails::short_channel_id`]. See those for more information.
20301 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
20304 * Gets the current SCID which should be used to identify this channel for outbound payments.
20305 * This should be used in [`Route`]s to describe the first hop or in other contexts where
20306 * we're sending or forwarding a payment outbound over this channel.
20308 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
20309 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
20311 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
20314 * Frees any resources used by the PaymentSendFailure
20316 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
20319 * Creates a copy of the PaymentSendFailure
20321 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
20324 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
20326 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
20329 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
20331 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
20334 * Utility method to constructs a new AllFailedRetrySafe-variant PaymentSendFailure
20336 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_retry_safe(struct LDKCVec_APIErrorZ a);
20339 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
20341 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
20344 * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
20346 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
20349 * The list of channels to be included in the invoice route hints.
20351 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
20354 * The list of channels to be included in the invoice route hints.
20356 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
20359 * A fake scid used for representing the phantom node's fake channel in generating the invoice
20362 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
20365 * A fake scid used for representing the phantom node's fake channel in generating the invoice
20368 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
20371 * The pubkey of the real backing node that would ultimately receive the payment.
20373 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
20376 * The pubkey of the real backing node that would ultimately receive the payment.
20378 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20381 * Constructs a new PhantomRouteHints given each field
20383 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
20386 * Creates a copy of the PhantomRouteHints
20388 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
20391 * Constructs a new ChannelManager to hold several channels and route between them.
20393 * This is the main \"logic hub\" for all channel-related actions, and implements
20394 * ChannelMessageHandler.
20396 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
20398 * Users need to notify the new ChannelManager when a new block is connected or
20399 * disconnected using its `block_connected` and `block_disconnected` methods, starting
20400 * from after `params.latest_hash`.
20402 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);
20405 * Gets the current configuration applied to all new channels, as
20407 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
20410 * Creates a new outbound channel to the given remote node and with the given value.
20412 * `user_channel_id` will be provided back as in
20413 * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
20414 * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to 0
20415 * for inbound channels, so you may wish to avoid using 0 for `user_channel_id` here.
20416 * `user_channel_id` has no meaning inside of LDK, it is simply copied to events and otherwise
20419 * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
20420 * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
20422 * Note that we do not check if you are currently connected to the given peer. If no
20423 * connection is available, the outbound `open_channel` message may fail to send, resulting in
20424 * the channel eventually being silently forgotten (dropped on reload).
20426 * Returns the new Channel's temporary `channel_id`. This ID will appear as
20427 * [`Event::FundingGenerationReady::temporary_channel_id`] and in
20428 * [`ChannelDetails::channel_id`] until after
20429 * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
20430 * one derived from the funding transaction's TXID. If the counterparty rejects the channel
20431 * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
20433 * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
20434 * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
20435 * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
20437 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
20439 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);
20442 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
20443 * more information.
20445 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
20448 * Gets the list of usable channels, in random order. Useful as an argument to [`find_route`]
20449 * to ensure non-announced channels are used.
20451 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
20452 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
20455 * [`find_route`]: crate::routing::router::find_route
20457 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
20460 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
20461 * will be accepted on the given channel, and after additional timeout/the closing of all
20462 * pending HTLCs, the channel will be closed on chain.
20464 * * If we are the channel initiator, we will pay between our [`Background`] and
20465 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
20467 * * If our counterparty is the channel initiator, we will require a channel closing
20468 * transaction feerate of at least our [`Background`] feerate or the feerate which
20469 * would appear on a force-closure transaction, whichever is lower. We will allow our
20470 * counterparty to pay as much fee as they'd like, however.
20472 * May generate a SendShutdown message event on success, which should be relayed.
20474 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
20475 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
20476 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
20478 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);
20481 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
20482 * will be accepted on the given channel, and after additional timeout/the closing of all
20483 * pending HTLCs, the channel will be closed on chain.
20485 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
20486 * the channel being closed or not:
20487 * * If we are the channel initiator, we will pay at least this feerate on the closing
20488 * transaction. The upper-bound is set by
20489 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
20490 * estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
20491 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
20492 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
20493 * will appear on a force-closure transaction, whichever is lower).
20495 * May generate a SendShutdown message event on success, which should be relayed.
20497 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
20498 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
20499 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
20501 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);
20504 * Force closes a channel, immediately broadcasting the latest local transaction(s) and
20505 * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
20506 * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
20509 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id);
20512 * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
20513 * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
20514 * `counterparty_node_id` isn't the counterparty of the corresponding channel.
20516 * You can always get the latest local transaction(s) to broadcast from
20517 * [`ChannelMonitor::get_latest_holder_commitment_txn`].
20519 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id);
20522 * Force close all channels, immediately broadcasting the latest local commitment transaction
20523 * for each to the chain and rejecting new HTLCs on each.
20525 void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
20528 * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
20529 * local transaction(s).
20531 void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
20534 * Sends a payment along a given route.
20536 * Value parameters are provided via the last hop in route, see documentation for RouteHop
20537 * fields for more info.
20539 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
20540 * payment), we don't do anything to stop you! We always try to ensure that if the provided
20541 * next hop knows the preimage to payment_hash they can claim an additional amount as
20542 * specified in the last hop in the route! Thus, you should probably do your own
20543 * payment_preimage tracking (which you should already be doing as they represent \"proof of
20544 * payment\") and prevent double-sends yourself.
20546 * May generate SendHTLCs message(s) event on success, which should be relayed.
20548 * Each path may have a different return value, and PaymentSendValue may return a Vec with
20549 * each entry matching the corresponding-index entry in the route paths, see
20550 * PaymentSendFailure for more info.
20552 * In general, a path may raise:
20553 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
20554 * node public key) is specified.
20555 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
20556 * (including due to previous monitor update failure or new permanent monitor update
20558 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
20559 * relevant updates.
20561 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
20562 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
20563 * different route unless you intend to pay twice!
20565 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
20566 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
20567 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
20568 * must not contain multiple paths as multi-path payments require a recipient-provided
20570 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
20571 * bit set (either as required or as available). If multiple paths are present in the Route,
20572 * we assume the invoice had the basic_mpp feature set.
20574 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
20576 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);
20579 * Retries a payment along the given [`Route`].
20581 * Errors returned are a superset of those returned from [`send_payment`], so see
20582 * [`send_payment`] documentation for more details on errors. This method will also error if the
20583 * retry amount puts the payment more than 10% over the payment's total amount, if the payment
20584 * for the given `payment_id` cannot be found (likely due to timeout or success), or if
20585 * further retries have been disabled with [`abandon_payment`].
20587 * [`send_payment`]: [`ChannelManager::send_payment`]
20588 * [`abandon_payment`]: [`ChannelManager::abandon_payment`]
20590 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);
20593 * Signals that no further retries for the given payment will occur.
20595 * After this method returns, any future calls to [`retry_payment`] for the given `payment_id`
20596 * will fail with [`PaymentSendFailure::ParameterError`]. If no such event has been generated,
20597 * an [`Event::PaymentFailed`] event will be generated as soon as there are no remaining
20598 * pending HTLCs for this payment.
20600 * Note that calling this method does *not* prevent a payment from succeeding. You must still
20601 * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
20602 * determine the ultimate status of a payment.
20604 * [`retry_payment`]: Self::retry_payment
20605 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
20606 * [`Event::PaymentSent`]: events::Event::PaymentSent
20608 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
20611 * Send a spontaneous payment, which is a payment that does not require the recipient to have
20612 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
20613 * the preimage, it must be a cryptographically secure random value that no intermediate node
20614 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
20615 * never reach the recipient.
20617 * See [`send_payment`] documentation for more details on the return value of this function.
20619 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
20620 * [`send_payment`] for more information about the risks of duplicate preimage usage.
20622 * Note that `route` must have exactly one path.
20624 * [`send_payment`]: Self::send_payment
20626 * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
20628 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);
20631 * Call this upon creation of a funding transaction for the given channel.
20633 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
20634 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
20636 * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
20637 * across the p2p network.
20639 * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
20640 * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
20642 * May panic if the output found in the funding transaction is duplicative with some other
20643 * channel (note that this should be trivially prevented by using unique funding transaction
20644 * keys per-channel).
20646 * Do NOT broadcast the funding transaction yourself. When we have safely received our
20647 * counterparty's signature the funding transaction will automatically be broadcast via the
20648 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
20650 * Note that this includes RBF or similar transaction replacement strategies - lightning does
20651 * not currently support replacing a funding transaction on an existing channel. Instead,
20652 * create a new channel with a conflicting funding transaction.
20654 * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
20655 * the wallet software generating the funding transaction to apply anti-fee sniping as
20656 * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
20657 * for more details.
20659 * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
20660 * [`Event::ChannelClosed`]: crate::util::events::Event::ChannelClosed
20662 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);
20665 * Regenerates channel_announcements and generates a signed node_announcement from the given
20666 * arguments, providing them in corresponding events via
20667 * [`get_and_clear_pending_msg_events`], if at least one public channel has been confirmed
20668 * on-chain. This effectively re-broadcasts all channel announcements and sends our node
20669 * announcement to ensure that the lightning P2P network is aware of the channels we have and
20670 * our network addresses.
20672 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
20673 * node to humans. They carry no in-protocol meaning.
20675 * `addresses` represent the set (possibly empty) of socket addresses on which this node
20676 * accepts incoming connections. These will be included in the node_announcement, publicly
20677 * tying these addresses together and to this node. If you wish to preserve user privacy,
20678 * addresses should likely contain only Tor Onion addresses.
20680 * Panics if `addresses` is absurdly large (more than 500).
20682 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
20684 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
20687 * Atomically updates the [`ChannelConfig`] for the given channels.
20689 * Once the updates are applied, each eligible channel (advertised with a known short channel
20690 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
20691 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
20692 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
20694 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
20695 * `counterparty_node_id` is provided.
20697 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
20698 * below [`MIN_CLTV_EXPIRY_DELTA`].
20700 * If an error is returned, none of the updates should be considered applied.
20702 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
20703 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
20704 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
20705 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
20706 * [`ChannelUpdate`]: msgs::ChannelUpdate
20707 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
20708 * [`APIMisuseError`]: APIError::APIMisuseError
20710 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ThirtyTwoBytesZ channel_ids, const struct LDKChannelConfig *NONNULL_PTR config);
20713 * Processes HTLCs which are pending waiting on random forward delay.
20715 * Should only really ever be called in response to a PendingHTLCsForwardable event.
20716 * Will likely generate further events.
20718 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
20721 * Performs actions which should happen on startup and roughly once per minute thereafter.
20723 * This currently includes:
20724 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
20725 * * Broadcasting `ChannelUpdate` messages if we've been disconnected from our peer for more
20726 * than a minute, informing the network that they should no longer attempt to route over
20728 * * Expiring a channel's previous `ChannelConfig` if necessary to only allow forwarding HTLCs
20729 * with the current `ChannelConfig`.
20731 * Note that this may cause reentrancy through `chain::Watch::update_channel` calls or feerate
20732 * estimate fetches.
20734 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
20737 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
20738 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
20739 * along the path (including in our own channel on which we received it).
20741 * Note that in some cases around unclean shutdown, it is possible the payment may have
20742 * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
20743 * second copy of) the [`events::Event::PaymentReceived`] event. Alternatively, the payment
20744 * may have already been failed automatically by LDK if it was nearing its expiration time.
20746 * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
20747 * [`ChannelManager::claim_funds`]), you should still monitor for
20748 * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
20749 * startup during which time claims that were in-progress at shutdown may be replayed.
20751 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
20754 * Provides a payment preimage in response to [`Event::PaymentReceived`], generating any
20755 * [`MessageSendEvent`]s needed to claim the payment.
20757 * Note that calling this method does *not* guarantee that the payment has been claimed. You
20758 * *must* wait for an [`Event::PaymentClaimed`] event which upon a successful claim will be
20759 * provided to your [`EventHandler`] when [`process_pending_events`] is next called.
20761 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
20762 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
20763 * event matches your expectation. If you fail to do so and call this method, you may provide
20764 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
20766 * [`Event::PaymentReceived`]: crate::util::events::Event::PaymentReceived
20767 * [`Event::PaymentClaimed`]: crate::util::events::Event::PaymentClaimed
20768 * [`process_pending_events`]: EventsProvider::process_pending_events
20769 * [`create_inbound_payment`]: Self::create_inbound_payment
20770 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
20771 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
20773 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
20776 * Gets the node_id held by this ChannelManager
20778 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
20781 * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
20783 * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
20784 * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
20787 * The `user_channel_id` parameter will be provided back in
20788 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
20789 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
20791 * Note that this method will return an error and reject the channel, if it requires support
20792 * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
20793 * used to accept such channels.
20795 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
20796 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
20798 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);
20801 * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
20802 * it as confirmed immediately.
20804 * The `user_channel_id` parameter will be provided back in
20805 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
20806 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
20808 * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
20809 * and (if the counterparty agrees), enables forwarding of payments immediately.
20811 * This fully trusts that the counterparty has honestly and correctly constructed the funding
20812 * transaction and blindly assumes that it will eventually confirm.
20814 * If it does not confirm before we decide to close the channel, or if the funding transaction
20815 * does not pay to the correct script the correct amount, *you will lose funds*.
20817 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
20818 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
20820 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);
20823 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
20826 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
20827 * [`PaymentHash`] and [`PaymentPreimage`] for you.
20829 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
20830 * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
20831 * passed directly to [`claim_funds`].
20833 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
20835 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
20836 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
20840 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
20841 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
20843 * Errors if `min_value_msat` is greater than total bitcoin supply.
20845 * [`claim_funds`]: Self::claim_funds
20846 * [`PaymentReceived`]: events::Event::PaymentReceived
20847 * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
20848 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
20850 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);
20853 * Legacy version of [`create_inbound_payment`]. Use this method if you wish to share
20854 * serialized state with LDK node(s) running 0.0.103 and earlier.
20856 * May panic if `invoice_expiry_delta_secs` is greater than one year.
20859 * This method is deprecated and will be removed soon.
20861 * [`create_inbound_payment`]: Self::create_inbound_payment
20863 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);
20866 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
20867 * stored external to LDK.
20869 * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a
20870 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
20871 * the `min_value_msat` provided here, if one is provided.
20873 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
20874 * note that LDK will not stop you from registering duplicate payment hashes for inbound
20877 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
20878 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
20879 * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the
20880 * sender \"proof-of-payment\" unless they have paid the required amount.
20882 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
20883 * in excess of the current time. This should roughly match the expiry time set in the invoice.
20884 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
20885 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
20886 * invoices when no timeout is set.
20888 * Note that we use block header time to time-out pending inbound payments (with some margin
20889 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
20890 * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry.
20891 * If you need exact expiry semantics, you should enforce them upon receipt of
20892 * [`PaymentReceived`].
20894 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
20895 * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
20897 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
20898 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
20902 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
20903 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
20905 * Errors if `min_value_msat` is greater than total bitcoin supply.
20907 * [`create_inbound_payment`]: Self::create_inbound_payment
20908 * [`PaymentReceived`]: events::Event::PaymentReceived
20910 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);
20913 * Legacy version of [`create_inbound_payment_for_hash`]. Use this method if you wish to share
20914 * serialized state with LDK node(s) running 0.0.103 and earlier.
20916 * May panic if `invoice_expiry_delta_secs` is greater than one year.
20919 * This method is deprecated and will be removed soon.
20921 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
20923 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);
20926 * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
20927 * previously returned from [`create_inbound_payment`].
20929 * [`create_inbound_payment`]: Self::create_inbound_payment
20931 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);
20934 * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
20935 * are used when constructing the phantom invoice's route hints.
20937 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
20939 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
20942 * Gets route hints for use in receiving [phantom node payments].
20944 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
20946 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
20949 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
20950 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
20952 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
20955 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
20956 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
20958 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
20961 * Constructs a new Listen which calls the relevant methods on this_arg.
20962 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
20964 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
20967 * Constructs a new Confirm which calls the relevant methods on this_arg.
20968 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
20970 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
20973 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
20974 * indicating whether persistence is necessary. Only one listener on
20975 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
20978 * Note that this method is not available with the `no-std` feature.
20980 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
20983 * Blocks until ChannelManager needs to be persisted. Only one listener on
20984 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
20987 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
20990 * Gets the latest best block which was connected either via the [`chain::Listen`] or
20991 * [`chain::Confirm`] interfaces.
20993 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
20996 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
20997 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
20999 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
21002 * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
21004 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
21007 * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
21009 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
21012 * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
21014 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
21017 * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
21019 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
21022 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
21024 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
21027 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
21029 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
21032 * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
21034 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
21037 * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
21039 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
21042 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
21044 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
21047 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
21049 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
21052 * The keys provider which will give us relevant keys. Some keys will be loaded during
21053 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
21056 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
21059 * The keys provider which will give us relevant keys. Some keys will be loaded during
21060 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
21063 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
21066 * The fee_estimator for use in the ChannelManager in the future.
21068 * No calls to the FeeEstimator will be made during deserialization.
21070 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
21073 * The fee_estimator for use in the ChannelManager in the future.
21075 * No calls to the FeeEstimator will be made during deserialization.
21077 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
21080 * The chain::Watch for use in the ChannelManager in the future.
21082 * No calls to the chain::Watch will be made during deserialization. It is assumed that
21083 * you have deserialized ChannelMonitors separately and will add them to your
21084 * chain::Watch after deserializing this ChannelManager.
21086 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
21089 * The chain::Watch for use in the ChannelManager in the future.
21091 * No calls to the chain::Watch will be made during deserialization. It is assumed that
21092 * you have deserialized ChannelMonitors separately and will add them to your
21093 * chain::Watch after deserializing this ChannelManager.
21095 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
21098 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
21099 * used to broadcast the latest local commitment transactions of channels which must be
21100 * force-closed during deserialization.
21102 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
21105 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
21106 * used to broadcast the latest local commitment transactions of channels which must be
21107 * force-closed during deserialization.
21109 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
21112 * The Logger for use in the ChannelManager and which may be used to log information during
21115 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
21118 * The Logger for use in the ChannelManager and which may be used to log information during
21121 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
21124 * Default settings used for new channels. Any existing channels will continue to use the
21125 * runtime settings which were stored when the ChannelManager was serialized.
21127 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
21130 * Default settings used for new channels. Any existing channels will continue to use the
21131 * runtime settings which were stored when the ChannelManager was serialized.
21133 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
21136 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
21137 * HashMap for you. This is primarily useful for C bindings where it is not practical to
21138 * populate a HashMap directly from C.
21140 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);
21143 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
21145 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
21148 * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
21150 void ExpandedKey_free(struct LDKExpandedKey this_obj);
21153 * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret.
21155 * It is recommended to cache this value and not regenerate it for each new inbound payment.
21157 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
21160 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
21161 * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
21162 * a `ChannelManager`.
21164 * `keys` is generated by calling [`KeysInterface::get_inbound_payment_key_material`] and then
21165 * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
21166 * regenerate it for each new inbound payment.
21168 * `current_time` is a Unix timestamp representing the current time.
21170 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
21172 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);
21175 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
21176 * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
21177 * without a `ChannelManager`.
21179 * See [`create`] for information on the `keys` and `current_time` parameters.
21181 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
21183 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);
21186 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
21188 void DecodeError_free(struct LDKDecodeError this_obj);
21191 * Creates a copy of the DecodeError
21193 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
21196 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
21198 void Init_free(struct LDKInit this_obj);
21201 * The relevant features which the sender supports
21203 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
21206 * The relevant features which the sender supports
21208 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
21211 * The receipient's network address. This adds the option to report a remote IP address
21212 * back to a connecting peer using the init message. A node can decide to use that information
21213 * to discover a potential update to its public IPv4 address (NAT) and use
21214 * that for a node_announcement update message containing the new address.
21216 struct LDKCOption_NetAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
21219 * The receipient's network address. This adds the option to report a remote IP address
21220 * back to a connecting peer using the init message. A node can decide to use that information
21221 * to discover a potential update to its public IPv4 address (NAT) and use
21222 * that for a node_announcement update message containing the new address.
21224 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_NetAddressZ val);
21227 * Constructs a new Init given each field
21229 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_NetAddressZ remote_network_address_arg);
21232 * Creates a copy of the Init
21234 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
21237 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
21239 void ErrorMessage_free(struct LDKErrorMessage this_obj);
21242 * The channel ID involved in the error.
21244 * All-0s indicates a general error unrelated to a specific channel, after which all channels
21245 * with the sending peer should be closed.
21247 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
21250 * The channel ID involved in the error.
21252 * All-0s indicates a general error unrelated to a specific channel, after which all channels
21253 * with the sending peer should be closed.
21255 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21258 * A possibly human-readable error description.
21259 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
21260 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
21261 * the terminal emulator or the logging subsystem.
21263 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
21266 * A possibly human-readable error description.
21267 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
21268 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
21269 * the terminal emulator or the logging subsystem.
21271 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
21274 * Constructs a new ErrorMessage given each field
21276 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
21279 * Creates a copy of the ErrorMessage
21281 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
21284 * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
21286 void WarningMessage_free(struct LDKWarningMessage this_obj);
21289 * The channel ID involved in the warning.
21291 * All-0s indicates a warning unrelated to a specific channel.
21293 const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32];
21296 * The channel ID involved in the warning.
21298 * All-0s indicates a warning unrelated to a specific channel.
21300 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21303 * A possibly human-readable warning description.
21304 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
21305 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
21306 * the terminal emulator or the logging subsystem.
21308 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
21311 * A possibly human-readable warning description.
21312 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
21313 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
21314 * the terminal emulator or the logging subsystem.
21316 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
21319 * Constructs a new WarningMessage given each field
21321 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
21324 * Creates a copy of the WarningMessage
21326 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
21329 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
21331 void Ping_free(struct LDKPing this_obj);
21334 * The desired response length
21336 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
21339 * The desired response length
21341 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
21344 * The ping packet size.
21345 * This field is not sent on the wire. byteslen zeros are sent.
21347 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
21350 * The ping packet size.
21351 * This field is not sent on the wire. byteslen zeros are sent.
21353 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
21356 * Constructs a new Ping given each field
21358 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
21361 * Creates a copy of the Ping
21363 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
21366 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
21368 void Pong_free(struct LDKPong this_obj);
21371 * The pong packet size.
21372 * This field is not sent on the wire. byteslen zeros are sent.
21374 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
21377 * The pong packet size.
21378 * This field is not sent on the wire. byteslen zeros are sent.
21380 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
21383 * Constructs a new Pong given each field
21385 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
21388 * Creates a copy of the Pong
21390 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
21393 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
21395 void OpenChannel_free(struct LDKOpenChannel this_obj);
21398 * The genesis hash of the blockchain where the channel is to be opened
21400 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
21403 * The genesis hash of the blockchain where the channel is to be opened
21405 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21408 * A temporary channel ID, until the funding outpoint is announced
21410 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
21413 * A temporary channel ID, until the funding outpoint is announced
21415 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21418 * The channel value
21420 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21423 * The channel value
21425 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21428 * The amount to push to the counterparty as part of the open, in milli-satoshi
21430 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21433 * The amount to push to the counterparty as part of the open, in milli-satoshi
21435 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21438 * The threshold below which outputs on transactions broadcast by sender will be omitted
21440 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21443 * The threshold below which outputs on transactions broadcast by sender will be omitted
21445 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21448 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
21450 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21453 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
21455 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21458 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
21460 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21463 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
21465 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21468 * The minimum HTLC size incoming to sender, in milli-satoshi
21470 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21473 * The minimum HTLC size incoming to sender, in milli-satoshi
21475 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21478 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
21480 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21483 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
21485 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
21488 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
21490 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21493 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
21495 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
21498 * The maximum number of inbound HTLCs towards sender
21500 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21503 * The maximum number of inbound HTLCs towards sender
21505 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
21508 * The sender's key controlling the funding transaction
21510 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21513 * The sender's key controlling the funding transaction
21515 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21518 * Used to derive a revocation key for transactions broadcast by counterparty
21520 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21523 * Used to derive a revocation key for transactions broadcast by counterparty
21525 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21528 * A payment key to sender for transactions broadcast by counterparty
21530 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21533 * A payment key to sender for transactions broadcast by counterparty
21535 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21538 * Used to derive a payment key to sender for transactions broadcast by sender
21540 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21543 * Used to derive a payment key to sender for transactions broadcast by sender
21545 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21548 * Used to derive an HTLC payment key to sender
21550 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21553 * Used to derive an HTLC payment key to sender
21555 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21558 * The first to-be-broadcast-by-sender transaction's per commitment point
21560 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21563 * The first to-be-broadcast-by-sender transaction's per commitment point
21565 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21570 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21575 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
21578 * The channel type that this channel will represent. If none is set, we derive the channel
21579 * type from the intersection of our feature bits with our counterparty's feature bits from
21580 * the Init message.
21582 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21584 struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21587 * The channel type that this channel will represent. If none is set, we derive the channel
21588 * type from the intersection of our feature bits with our counterparty's feature bits from
21589 * the Init message.
21591 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21593 void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
21596 * Creates a copy of the OpenChannel
21598 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
21601 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
21603 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
21606 * A temporary channel ID, until the funding outpoint is announced
21608 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
21611 * A temporary channel ID, until the funding outpoint is announced
21613 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21616 * The threshold below which outputs on transactions broadcast by sender will be omitted
21618 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21621 * The threshold below which outputs on transactions broadcast by sender will be omitted
21623 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
21626 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
21628 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21631 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
21633 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
21636 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
21638 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21641 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
21643 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
21646 * The minimum HTLC size incoming to sender, in milli-satoshi
21648 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21651 * The minimum HTLC size incoming to sender, in milli-satoshi
21653 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
21656 * Minimum depth of the funding transaction before the channel is considered open
21658 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21661 * Minimum depth of the funding transaction before the channel is considered open
21663 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
21666 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
21668 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21671 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
21673 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
21676 * The maximum number of inbound HTLCs towards sender
21678 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21681 * The maximum number of inbound HTLCs towards sender
21683 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
21686 * The sender's key controlling the funding transaction
21688 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21691 * The sender's key controlling the funding transaction
21693 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21696 * Used to derive a revocation key for transactions broadcast by counterparty
21698 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21701 * Used to derive a revocation key for transactions broadcast by counterparty
21703 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21706 * A payment key to sender for transactions broadcast by counterparty
21708 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21711 * A payment key to sender for transactions broadcast by counterparty
21713 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21716 * Used to derive a payment key to sender for transactions broadcast by sender
21718 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21721 * Used to derive a payment key to sender for transactions broadcast by sender
21723 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21726 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
21728 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21731 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
21733 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21736 * The first to-be-broadcast-by-sender transaction's per commitment point
21738 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21741 * The first to-be-broadcast-by-sender transaction's per commitment point
21743 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21746 * The channel type that this channel will represent. If none is set, we derive the channel
21747 * type from the intersection of our feature bits with our counterparty's feature bits from
21748 * the Init message.
21750 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
21752 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21754 struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21757 * The channel type that this channel will represent. If none is set, we derive the channel
21758 * type from the intersection of our feature bits with our counterparty's feature bits from
21759 * the Init message.
21761 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
21763 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21765 void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
21768 * Creates a copy of the AcceptChannel
21770 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
21773 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
21775 void FundingCreated_free(struct LDKFundingCreated this_obj);
21778 * A temporary channel ID, until the funding is established
21780 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
21783 * A temporary channel ID, until the funding is established
21785 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21788 * The funding transaction ID
21790 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
21793 * The funding transaction ID
21795 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21798 * The specific output index funding this channel
21800 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
21803 * The specific output index funding this channel
21805 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
21808 * The signature of the channel initiator (funder) on the initial commitment transaction
21810 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
21813 * The signature of the channel initiator (funder) on the initial commitment transaction
21815 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
21818 * Constructs a new FundingCreated given each field
21820 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);
21823 * Creates a copy of the FundingCreated
21825 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
21828 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
21830 void FundingSigned_free(struct LDKFundingSigned this_obj);
21835 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
21840 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21843 * The signature of the channel acceptor (fundee) on the initial commitment transaction
21845 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
21848 * The signature of the channel acceptor (fundee) on the initial commitment transaction
21850 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
21853 * Constructs a new FundingSigned given each field
21855 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
21858 * Creates a copy of the FundingSigned
21860 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
21863 * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
21865 void ChannelReady_free(struct LDKChannelReady this_obj);
21870 const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32];
21875 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21878 * The per-commitment point of the second commitment transaction
21880 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
21883 * The per-commitment point of the second commitment transaction
21885 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21888 * If set, provides a short_channel_id alias for this channel. The sender will accept payments
21889 * to be forwarded over this SCID and forward them to this messages' recipient.
21891 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
21894 * If set, provides a short_channel_id alias for this channel. The sender will accept payments
21895 * to be forwarded over this SCID and forward them to this messages' recipient.
21897 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
21900 * Constructs a new ChannelReady given each field
21902 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);
21905 * Creates a copy of the ChannelReady
21907 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
21910 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
21912 void Shutdown_free(struct LDKShutdown this_obj);
21917 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
21922 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21925 * The destination of this peer's funds on closing.
21926 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
21928 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
21931 * The destination of this peer's funds on closing.
21932 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
21934 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
21937 * Constructs a new Shutdown given each field
21939 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
21942 * Creates a copy of the Shutdown
21944 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
21947 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
21949 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
21952 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
21955 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
21958 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
21961 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
21964 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
21967 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
21970 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
21973 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
21976 * Constructs a new ClosingSignedFeeRange given each field
21978 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
21981 * Creates a copy of the ClosingSignedFeeRange
21983 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
21986 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
21988 void ClosingSigned_free(struct LDKClosingSigned this_obj);
21993 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
21998 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22001 * The proposed total fee for the closing transaction
22003 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
22006 * The proposed total fee for the closing transaction
22008 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
22011 * A signature on the closing transaction
22013 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
22016 * A signature on the closing transaction
22018 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
22021 * The minimum and maximum fees which the sender is willing to accept, provided only by new
22024 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22026 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
22029 * The minimum and maximum fees which the sender is willing to accept, provided only by new
22032 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22034 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
22037 * Constructs a new ClosingSigned given each field
22039 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);
22042 * Creates a copy of the ClosingSigned
22044 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
22047 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
22049 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
22054 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
22059 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22064 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
22069 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
22072 * The HTLC value in milli-satoshi
22074 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
22077 * The HTLC value in milli-satoshi
22079 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
22082 * The payment hash, the pre-image of which controls HTLC redemption
22084 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
22087 * The payment hash, the pre-image of which controls HTLC redemption
22089 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22092 * The expiry height of the HTLC
22094 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
22097 * The expiry height of the HTLC
22099 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
22102 * Creates a copy of the UpdateAddHTLC
22104 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
22107 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
22109 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
22114 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
22119 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22124 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
22129 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
22132 * The pre-image of the payment hash, allowing HTLC redemption
22134 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
22137 * The pre-image of the payment hash, allowing HTLC redemption
22139 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22142 * Constructs a new UpdateFulfillHTLC given each field
22144 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
22147 * Creates a copy of the UpdateFulfillHTLC
22149 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
22152 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
22154 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
22159 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
22164 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22169 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
22174 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
22177 * Creates a copy of the UpdateFailHTLC
22179 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
22182 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
22184 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
22189 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
22194 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22199 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
22204 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
22209 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
22214 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
22217 * Creates a copy of the UpdateFailMalformedHTLC
22219 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
22222 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
22224 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
22229 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
22234 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22237 * A signature on the commitment transaction
22239 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
22242 * A signature on the commitment transaction
22244 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
22247 * Signatures on the HTLC transactions
22249 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
22252 * Constructs a new CommitmentSigned given each field
22254 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
22257 * Creates a copy of the CommitmentSigned
22259 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
22262 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
22264 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
22269 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
22274 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22277 * The secret corresponding to the per-commitment point
22279 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
22282 * The secret corresponding to the per-commitment point
22284 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22287 * The next sender-broadcast commitment transaction's per-commitment point
22289 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
22292 * The next sender-broadcast commitment transaction's per-commitment point
22294 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22297 * Constructs a new RevokeAndACK given each field
22299 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);
22302 * Creates a copy of the RevokeAndACK
22304 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
22307 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
22309 void UpdateFee_free(struct LDKUpdateFee this_obj);
22314 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
22319 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22322 * Fee rate per 1000-weight of the transaction
22324 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
22327 * Fee rate per 1000-weight of the transaction
22329 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
22332 * Constructs a new UpdateFee given each field
22334 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
22337 * Creates a copy of the UpdateFee
22339 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
22342 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
22344 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
22347 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
22348 * belonging to the recipient
22350 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
22353 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
22354 * belonging to the recipient
22356 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22359 * The sender's per-commitment point for their current commitment transaction
22361 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
22364 * The sender's per-commitment point for their current commitment transaction
22366 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22369 * Constructs a new DataLossProtect given each field
22371 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
22374 * Creates a copy of the DataLossProtect
22376 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
22379 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
22381 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
22386 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
22391 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22394 * The next commitment number for the sender
22396 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
22399 * The next commitment number for the sender
22401 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
22404 * The next commitment number for the recipient
22406 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
22409 * The next commitment number for the recipient
22411 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
22414 * Creates a copy of the ChannelReestablish
22416 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
22419 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
22421 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
22426 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
22431 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22434 * The short channel ID
22436 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
22439 * The short channel ID
22441 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
22444 * A signature by the node key
22446 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
22449 * A signature by the node key
22451 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
22454 * A signature by the funding key
22456 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
22459 * A signature by the funding key
22461 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
22464 * Constructs a new AnnouncementSignatures given each field
22466 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);
22469 * Creates a copy of the AnnouncementSignatures
22471 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
22474 * Frees any resources used by the NetAddress
22476 void NetAddress_free(struct LDKNetAddress this_ptr);
22479 * Creates a copy of the NetAddress
22481 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
22484 * Utility method to constructs a new IPv4-variant NetAddress
22486 struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port);
22489 * Utility method to constructs a new IPv6-variant NetAddress
22491 struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port);
22494 * Utility method to constructs a new OnionV2-variant NetAddress
22496 struct LDKNetAddress NetAddress_onion_v2(struct LDKTwelveBytes a);
22499 * Utility method to constructs a new OnionV3-variant NetAddress
22501 struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
22504 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
22506 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
22509 * Read a NetAddress from a byte array, created by NetAddress_write
22511 struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
22514 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
22516 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
22519 * The advertised features
22521 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
22524 * The advertised features
22526 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
22529 * A strictly monotonic announcement counter, with gaps allowed
22531 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
22534 * A strictly monotonic announcement counter, with gaps allowed
22536 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
22539 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
22542 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
22545 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
22548 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22551 * An RGB color for UI purposes
22553 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
22556 * An RGB color for UI purposes
22558 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
22561 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
22564 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
22567 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
22570 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22573 * List of addresses on which this node is reachable
22575 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
22578 * Creates a copy of the UnsignedNodeAnnouncement
22580 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
22583 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
22585 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
22588 * The signature by the node key
22590 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
22593 * The signature by the node key
22595 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
22598 * The actual content of the announcement
22600 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
22603 * The actual content of the announcement
22605 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
22608 * Constructs a new NodeAnnouncement given each field
22610 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
22613 * Creates a copy of the NodeAnnouncement
22615 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
22618 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
22620 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
22623 * The advertised channel features
22625 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
22628 * The advertised channel features
22630 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
22633 * The genesis hash of the blockchain where the channel is to be opened
22635 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
22638 * The genesis hash of the blockchain where the channel is to be opened
22640 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22643 * The short channel ID
22645 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
22648 * The short channel ID
22650 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
22653 * One of the two node_ids which are endpoints of this channel
22655 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
22658 * One of the two node_ids which are endpoints of this channel
22660 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22663 * The other of the two node_ids which are endpoints of this channel
22665 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
22668 * The other of the two node_ids which are endpoints of this channel
22670 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22673 * The funding key for the first node
22675 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
22678 * The funding key for the first node
22680 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22683 * The funding key for the second node
22685 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
22688 * The funding key for the second node
22690 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22693 * Creates a copy of the UnsignedChannelAnnouncement
22695 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
22698 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
22700 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
22703 * Authentication of the announcement by the first public node
22705 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
22708 * Authentication of the announcement by the first public node
22710 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
22713 * Authentication of the announcement by the second public node
22715 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
22718 * Authentication of the announcement by the second public node
22720 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
22723 * Proof of funding UTXO ownership by the first public node
22725 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
22728 * Proof of funding UTXO ownership by the first public node
22730 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
22733 * Proof of funding UTXO ownership by the second public node
22735 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
22738 * Proof of funding UTXO ownership by the second public node
22740 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
22743 * The actual announcement
22745 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
22748 * The actual announcement
22750 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
22753 * Constructs a new ChannelAnnouncement given each field
22755 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);
22758 * Creates a copy of the ChannelAnnouncement
22760 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
22763 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
22765 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
22768 * The genesis hash of the blockchain where the channel is to be opened
22770 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
22773 * The genesis hash of the blockchain where the channel is to be opened
22775 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22778 * The short channel ID
22780 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22783 * The short channel ID
22785 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
22788 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
22790 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22793 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
22795 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
22800 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22805 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
22808 * The number of blocks such that if:
22809 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
22810 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
22811 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
22812 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
22813 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
22814 * forwarding. Note that the HTLC sender is the one who originally sets this value when
22815 * constructing the route.
22817 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22820 * The number of blocks such that if:
22821 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
22822 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
22823 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
22824 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
22825 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
22826 * forwarding. Note that the HTLC sender is the one who originally sets this value when
22827 * constructing the route.
22829 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
22832 * The minimum HTLC size incoming to sender, in milli-satoshi
22834 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22837 * The minimum HTLC size incoming to sender, in milli-satoshi
22839 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
22842 * The base HTLC fee charged by sender, in milli-satoshi
22844 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22847 * The base HTLC fee charged by sender, in milli-satoshi
22849 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
22852 * The amount to fee multiplier, in micro-satoshi
22854 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22857 * The amount to fee multiplier, in micro-satoshi
22859 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
22862 * Excess data which was signed as a part of the message which we do not (yet) understand how
22863 * to decode. This is stored to ensure forward-compatibility as new fields are added to the
22866 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
22869 * Creates a copy of the UnsignedChannelUpdate
22871 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
22874 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
22876 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
22879 * A signature of the channel update
22881 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
22884 * A signature of the channel update
22886 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
22889 * The actual channel update
22891 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
22894 * The actual channel update
22896 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
22899 * Constructs a new ChannelUpdate given each field
22901 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
22904 * Creates a copy of the ChannelUpdate
22906 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
22909 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
22911 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
22914 * The genesis hash of the blockchain being queried
22916 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
22919 * The genesis hash of the blockchain being queried
22921 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22924 * The height of the first block for the channel UTXOs being queried
22926 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
22929 * The height of the first block for the channel UTXOs being queried
22931 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
22934 * The number of blocks to include in the query results
22936 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
22939 * The number of blocks to include in the query results
22941 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
22944 * Constructs a new QueryChannelRange given each field
22946 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
22949 * Creates a copy of the QueryChannelRange
22951 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
22954 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
22956 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
22959 * The genesis hash of the blockchain being queried
22961 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
22964 * The genesis hash of the blockchain being queried
22966 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22969 * The height of the first block in the range of the reply
22971 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
22974 * The height of the first block in the range of the reply
22976 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
22979 * The number of blocks included in the range of the reply
22981 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
22984 * The number of blocks included in the range of the reply
22986 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
22989 * True when this is the final reply for a query
22991 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
22994 * True when this is the final reply for a query
22996 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
22999 * The short_channel_ids in the channel range
23001 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
23004 * Constructs a new ReplyChannelRange given each field
23006 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);
23009 * Creates a copy of the ReplyChannelRange
23011 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
23014 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
23016 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
23019 * The genesis hash of the blockchain being queried
23021 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
23024 * The genesis hash of the blockchain being queried
23026 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23029 * The short_channel_ids that are being queried
23031 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
23034 * Constructs a new QueryShortChannelIds given each field
23036 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
23039 * Creates a copy of the QueryShortChannelIds
23041 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
23044 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
23046 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
23049 * The genesis hash of the blockchain that was queried
23051 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
23054 * The genesis hash of the blockchain that was queried
23056 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23059 * Indicates if the query recipient maintains up-to-date channel
23060 * information for the chain_hash
23062 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
23065 * Indicates if the query recipient maintains up-to-date channel
23066 * information for the chain_hash
23068 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
23071 * Constructs a new ReplyShortChannelIdsEnd given each field
23073 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
23076 * Creates a copy of the ReplyShortChannelIdsEnd
23078 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
23081 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
23083 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
23086 * The genesis hash of the blockchain for channel and node information
23088 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
23091 * The genesis hash of the blockchain for channel and node information
23093 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23096 * The starting unix timestamp
23098 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
23101 * The starting unix timestamp
23103 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
23106 * The range of information in seconds
23108 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
23111 * The range of information in seconds
23113 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
23116 * Constructs a new GossipTimestampFilter given each field
23118 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
23121 * Creates a copy of the GossipTimestampFilter
23123 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
23126 * Frees any resources used by the ErrorAction
23128 void ErrorAction_free(struct LDKErrorAction this_ptr);
23131 * Creates a copy of the ErrorAction
23133 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
23136 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
23138 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
23141 * Utility method to constructs a new IgnoreError-variant ErrorAction
23143 struct LDKErrorAction ErrorAction_ignore_error(void);
23146 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
23148 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
23151 * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
23153 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
23156 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
23158 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
23161 * Utility method to constructs a new SendWarningMessage-variant ErrorAction
23163 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
23166 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
23168 void LightningError_free(struct LDKLightningError this_obj);
23171 * A human-readable message describing the error
23173 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
23176 * A human-readable message describing the error
23178 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
23181 * The action which should be taken against the offending peer.
23183 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
23186 * The action which should be taken against the offending peer.
23188 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
23191 * Constructs a new LightningError given each field
23193 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
23196 * Creates a copy of the LightningError
23198 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
23201 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
23203 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
23206 * update_add_htlc messages which should be sent
23208 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23211 * update_add_htlc messages which should be sent
23213 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
23216 * update_fulfill_htlc messages which should be sent
23218 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23221 * update_fulfill_htlc messages which should be sent
23223 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
23226 * update_fail_htlc messages which should be sent
23228 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23231 * update_fail_htlc messages which should be sent
23233 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
23236 * update_fail_malformed_htlc messages which should be sent
23238 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23241 * update_fail_malformed_htlc messages which should be sent
23243 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
23246 * An update_fee message which should be sent
23248 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23250 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23253 * An update_fee message which should be sent
23255 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23257 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
23260 * Finally, the commitment_signed message which should be sent
23262 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23265 * Finally, the commitment_signed message which should be sent
23267 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
23270 * Constructs a new CommitmentUpdate given each field
23272 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);
23275 * Creates a copy of the CommitmentUpdate
23277 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
23280 * Calls the free function if one is set
23282 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
23285 * Calls the free function if one is set
23287 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
23290 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
23292 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
23295 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
23297 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
23300 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
23302 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
23305 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
23307 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
23310 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
23312 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
23315 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
23317 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
23320 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
23322 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
23325 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
23327 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
23330 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
23332 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
23335 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
23337 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
23340 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
23342 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
23345 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
23347 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
23350 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
23352 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
23355 * Read a FundingCreated from a byte array, created by FundingCreated_write
23357 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
23360 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
23362 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
23365 * Read a FundingSigned from a byte array, created by FundingSigned_write
23367 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
23370 * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
23372 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
23375 * Read a ChannelReady from a byte array, created by ChannelReady_write
23377 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
23380 * Serialize the Init object into a byte array which can be read by Init_read
23382 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
23385 * Read a Init from a byte array, created by Init_write
23387 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
23390 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
23392 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
23395 * Read a OpenChannel from a byte array, created by OpenChannel_write
23397 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
23400 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
23402 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
23405 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
23407 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
23410 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
23412 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
23415 * Read a Shutdown from a byte array, created by Shutdown_write
23417 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
23420 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
23422 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
23425 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
23427 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
23430 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
23432 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
23435 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
23437 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
23440 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
23442 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
23445 * Read a UpdateFee from a byte array, created by UpdateFee_write
23447 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
23450 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
23452 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
23455 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
23457 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
23460 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
23462 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
23465 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
23467 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
23470 * Serialize the Ping object into a byte array which can be read by Ping_read
23472 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
23475 * Read a Ping from a byte array, created by Ping_write
23477 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
23480 * Serialize the Pong object into a byte array which can be read by Pong_read
23482 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
23485 * Read a Pong from a byte array, created by Pong_write
23487 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
23490 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
23492 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
23495 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
23497 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
23500 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
23502 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
23505 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
23507 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
23510 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
23512 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
23515 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
23517 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
23520 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
23522 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
23525 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
23527 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
23530 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
23532 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
23535 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
23537 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
23540 * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
23542 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
23545 * Read a WarningMessage from a byte array, created by WarningMessage_write
23547 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
23550 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
23552 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
23555 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
23557 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
23560 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
23562 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
23565 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
23567 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
23570 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
23572 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
23575 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
23577 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
23580 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
23582 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
23585 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
23587 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
23590 *\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
23592 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
23595 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
23597 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
23600 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
23602 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
23605 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
23607 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
23610 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
23612 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
23615 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
23617 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
23620 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
23622 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
23625 * Calls the free function if one is set
23627 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
23630 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
23632 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
23635 * Constructs a new IgnoringMessageHandler given each field
23637 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
23640 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
23641 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
23643 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
23646 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
23647 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
23649 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
23652 * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
23653 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
23655 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
23658 * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
23659 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
23661 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
23664 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
23666 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
23669 * Constructs a new ErroringMessageHandler
23671 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
23674 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
23675 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
23677 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
23680 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
23681 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
23683 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
23686 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
23688 void MessageHandler_free(struct LDKMessageHandler this_obj);
23691 * A message handler which handles messages specific to channels. Usually this is just a
23692 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
23694 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
23696 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
23699 * A message handler which handles messages specific to channels. Usually this is just a
23700 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
23702 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
23704 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
23707 * A message handler which handles messages updating our knowledge of the network channel
23708 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
23710 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
23712 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
23715 * A message handler which handles messages updating our knowledge of the network channel
23716 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
23718 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
23720 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
23723 * Constructs a new MessageHandler given each field
23725 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
23728 * Creates a copy of a SocketDescriptor
23730 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
23733 * Calls the free function if one is set
23735 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
23738 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
23740 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
23743 * Used to indicate that we probably can't make any future connections to this peer (e.g.
23744 * because we required features that our peer was missing, or vice versa).
23746 * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close
23747 * any channels with this peer or check for new versions of LDK.
23749 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
23751 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
23754 * Used to indicate that we probably can't make any future connections to this peer (e.g.
23755 * because we required features that our peer was missing, or vice versa).
23757 * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close
23758 * any channels with this peer or check for new versions of LDK.
23760 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
23762 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
23765 * Constructs a new PeerHandleError given each field
23767 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
23770 * Creates a copy of the PeerHandleError
23772 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
23775 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
23777 void PeerManager_free(struct LDKPeerManager this_obj);
23780 * Constructs a new PeerManager with the given message handlers and node_id secret key
23781 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
23782 * cryptographically secure random bytes.
23784 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);
23787 * Get the list of node ids for peers which have completed the initial handshake.
23789 * For outbound connections, this will be the same as the their_node_id parameter passed in to
23790 * new_outbound_connection, however entries will only appear once the initial handshake has
23791 * completed and we are sure the remote peer has the private key for the given node_id.
23793 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
23796 * Indicates a new outbound connection has been established to a node with the given node_id
23797 * and an optional remote network address.
23799 * The remote network address adds the option to report a remote IP address back to a connecting
23800 * peer using the init message.
23801 * The user should pass the remote network address of the host they are connected to.
23803 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
23804 * descriptor but must disconnect the connection immediately.
23806 * Returns a small number of bytes to send to the remote node (currently always 50).
23808 * Panics if descriptor is duplicative with some other descriptor which has not yet been
23809 * [`socket_disconnected()`].
23811 * [`socket_disconnected()`]: PeerManager::socket_disconnected
23813 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);
23816 * Indicates a new inbound connection has been established to a node with an optional remote
23819 * The remote network address adds the option to report a remote IP address back to a connecting
23820 * peer using the init message.
23821 * The user should pass the remote network address of the host they are connected to.
23823 * May refuse the connection by returning an Err, but will never write bytes to the remote end
23824 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
23825 * call socket_disconnected for the new descriptor but must disconnect the connection
23828 * Panics if descriptor is duplicative with some other descriptor which has not yet been
23829 * [`socket_disconnected()`].
23831 * [`socket_disconnected()`]: PeerManager::socket_disconnected
23833 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);
23836 * Indicates that there is room to write data to the given socket descriptor.
23838 * May return an Err to indicate that the connection should be closed.
23840 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
23841 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
23842 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
23843 * ready to call `[write_buffer_space_avail`] again if a write call generated here isn't
23846 * [`send_data`]: SocketDescriptor::send_data
23847 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
23849 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
23852 * Indicates that data was read from the given socket descriptor.
23854 * May return an Err to indicate that the connection should be closed.
23856 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
23857 * Thus, however, you should call [`process_events`] after any `read_event` to generate
23858 * [`send_data`] calls to handle responses.
23860 * If `Ok(true)` is returned, further read_events should not be triggered until a
23861 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
23864 * [`send_data`]: SocketDescriptor::send_data
23865 * [`process_events`]: PeerManager::process_events
23867 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);
23870 * Checks for any events generated by our handlers and processes them. Includes sending most
23871 * response messages as well as messages generated by calls to handler functions directly (eg
23872 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
23874 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
23877 * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
23878 * or one of the other clients provided in our language bindings.
23880 * Note that if there are any other calls to this function waiting on lock(s) this may return
23881 * without doing any work. All available events that need handling will be handled before the
23882 * other calls return.
23884 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
23885 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
23886 * [`send_data`]: SocketDescriptor::send_data
23888 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
23891 * Indicates that the given socket descriptor's connection is now closed.
23893 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
23896 * Disconnect a peer given its node id.
23898 * Set `no_connection_possible` to true to prevent any further connection with this peer,
23899 * force-closing any channels we have with it.
23901 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
23902 * peer. Thus, be very careful about reentrancy issues.
23904 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
23906 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
23909 * Disconnects all currently-connected peers. This is useful on platforms where there may be
23910 * an indication that TCP sockets have stalled even if we weren't around to time them out
23911 * using regular ping/pongs.
23913 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
23916 * Send pings to each peer and disconnect those which did not respond to the last round of
23919 * This may be called on any timescale you want, however, roughly once every ten seconds is
23920 * preferred. The call rate determines both how often we send a ping to our peers and how much
23921 * time they have to respond before we disconnect them.
23923 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
23926 * [`send_data`]: SocketDescriptor::send_data
23928 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
23931 * Gets the weight for an HTLC-Success transaction.
23933 uint64_t htlc_success_tx_weight(bool opt_anchors);
23936 * Gets the weight for an HTLC-Timeout transaction.
23938 uint64_t htlc_timeout_tx_weight(bool opt_anchors);
23941 * Build the commitment secret from the seed and the commitment number
23943 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
23946 * Build a closing transaction
23948 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);
23951 * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
23953 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
23956 * Creates a copy of the CounterpartyCommitmentSecrets
23958 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
23961 * Creates a new empty `CounterpartyCommitmentSecrets` structure.
23963 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
23966 * Returns the minimum index of all stored secrets. Note that indexes start
23967 * at 1 << 48 and get decremented by one for each new secret.
23969 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
23972 * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
23973 * was generated in accordance with BOLT 3 and is consistent with previous secrets.
23975 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
23978 * Returns the secret at `idx`.
23979 * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
23981 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23983 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
23986 * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
23988 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
23991 * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
23993 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
23996 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
23997 * from the base secret and the per_commitment_point.
23999 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
24000 * generated (ie our own).
24002 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
24005 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
24006 * from the base point and the per_commitment_key. This is the public equivalent of
24007 * derive_private_key - using only public keys to derive a public key instead of private keys.
24009 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
24010 * generated (ie our own).
24012 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
24015 * Derives a per-commitment-transaction revocation key from its constituent parts.
24017 * Only the cheating participant owns a valid witness to propagate a revoked
24018 * commitment transaction, thus per_commitment_secret always come from cheater
24019 * and revocation_base_secret always come from punisher, which is the broadcaster
24020 * of the transaction spending with this key knowledge.
24022 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
24023 * generated (ie our own).
24025 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
24028 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
24029 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
24030 * public key instead of private keys.
24032 * Only the cheating participant owns a valid witness to propagate a revoked
24033 * commitment transaction, thus per_commitment_point always come from cheater
24034 * and revocation_base_point always come from punisher, which is the broadcaster
24035 * of the transaction spending with this key knowledge.
24037 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
24038 * generated (ie our own).
24040 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
24043 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
24045 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
24048 * The broadcaster's per-commitment public key which was used to derive the other keys.
24050 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
24053 * The broadcaster's per-commitment public key which was used to derive the other keys.
24055 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24058 * The revocation key which is used to allow the broadcaster of the commitment
24059 * transaction to provide their counterparty the ability to punish them if they broadcast
24062 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
24065 * The revocation key which is used to allow the broadcaster of the commitment
24066 * transaction to provide their counterparty the ability to punish them if they broadcast
24069 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24072 * Broadcaster's HTLC Key
24074 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
24077 * Broadcaster's HTLC Key
24079 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24082 * Countersignatory's HTLC Key
24084 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
24087 * Countersignatory's HTLC Key
24089 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24092 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
24094 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
24097 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
24099 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24102 * Constructs a new TxCreationKeys given each field
24104 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);
24107 * Creates a copy of the TxCreationKeys
24109 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
24112 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
24114 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
24117 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
24119 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
24122 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
24124 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
24127 * The public key which is used to sign all commitment transactions, as it appears in the
24128 * on-chain channel lock-in 2-of-2 multisig output.
24130 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
24133 * The public key which is used to sign all commitment transactions, as it appears in the
24134 * on-chain channel lock-in 2-of-2 multisig output.
24136 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24139 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
24140 * revocation keys. This is combined with the per-commitment-secret generated by the
24141 * counterparty to create a secret which the counterparty can reveal to revoke previous
24144 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
24147 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
24148 * revocation keys. This is combined with the per-commitment-secret generated by the
24149 * counterparty to create a secret which the counterparty can reveal to revoke previous
24152 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24155 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
24156 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
24157 * static across every commitment transaction.
24159 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
24162 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
24163 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
24164 * static across every commitment transaction.
24166 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24169 * The base point which is used (with derive_public_key) to derive a per-commitment payment
24170 * public key which receives non-HTLC-encumbered funds which are only available for spending
24171 * after some delay (or can be claimed via the revocation path).
24173 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
24176 * The base point which is used (with derive_public_key) to derive a per-commitment payment
24177 * public key which receives non-HTLC-encumbered funds which are only available for spending
24178 * after some delay (or can be claimed via the revocation path).
24180 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24183 * The base point which is used (with derive_public_key) to derive a per-commitment public key
24184 * which is used to encumber HTLC-in-flight outputs.
24186 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
24189 * The base point which is used (with derive_public_key) to derive a per-commitment public key
24190 * which is used to encumber HTLC-in-flight outputs.
24192 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24195 * Constructs a new ChannelPublicKeys given each field
24197 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);
24200 * Creates a copy of the ChannelPublicKeys
24202 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
24205 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
24207 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
24210 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
24212 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
24215 * Create per-state keys from channel base points and the per-commitment point.
24216 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
24218 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);
24221 * Generate per-state keys from channel static keys.
24222 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
24224 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);
24227 * A script either spendable by the revocation
24228 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
24229 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
24231 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
24234 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
24236 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
24239 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
24240 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
24241 * need to compare this value to whether the commitment transaction in question is that of
24242 * the counterparty or our own.
24244 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
24247 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
24248 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
24249 * need to compare this value to whether the commitment transaction in question is that of
24250 * the counterparty or our own.
24252 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
24255 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
24256 * this divided by 1000.
24258 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
24261 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
24262 * this divided by 1000.
24264 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
24267 * The CLTV lock-time at which this HTLC expires.
24269 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
24272 * The CLTV lock-time at which this HTLC expires.
24274 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
24277 * The hash of the preimage which unlocks this HTLC.
24279 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
24282 * The hash of the preimage which unlocks this HTLC.
24284 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24287 * The position within the commitment transactions' outputs. This may be None if the value is
24288 * below the dust limit (in which case no output appears in the commitment transaction and the
24289 * value is spent to additional transaction fees).
24291 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
24294 * The position within the commitment transactions' outputs. This may be None if the value is
24295 * below the dust limit (in which case no output appears in the commitment transaction and the
24296 * value is spent to additional transaction fees).
24298 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
24301 * Constructs a new HTLCOutputInCommitment given each field
24303 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);
24306 * Creates a copy of the HTLCOutputInCommitment
24308 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
24311 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
24313 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
24316 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
24318 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
24321 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
24322 * does not need to have its previous_output_index filled.
24324 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, const struct LDKTxCreationKeys *NONNULL_PTR keys);
24327 * Gets the redeemscript for a funding output from the two funding public keys.
24328 * Note that the order of funding public keys does not matter.
24330 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
24333 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
24334 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
24335 * transaction which needs signing, and can be used to construct an HTLC transaction which is
24336 * broadcastable given a counterparty HTLC signature.
24338 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
24339 * commitment transaction).
24341 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);
24344 * Gets the witnessScript for an anchor output from the funding public key.
24345 * The witness in the spending input must be:
24346 * <BIP 143 funding_signature>
24347 * After 16 blocks of confirmation, an alternative satisfying witness could be:
24349 * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
24351 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
24354 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
24356 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
24359 * Holder public keys
24361 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24364 * Holder public keys
24366 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
24369 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
24371 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24374 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
24376 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
24379 * Whether the holder is the initiator of this channel.
24380 * This is an input to the commitment number obscure factor computation.
24382 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24385 * Whether the holder is the initiator of this channel.
24386 * This is an input to the commitment number obscure factor computation.
24388 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
24391 * The late-bound counterparty channel transaction parameters.
24392 * These parameters are populated at the point in the protocol where the counterparty provides them.
24394 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24396 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24399 * The late-bound counterparty channel transaction parameters.
24400 * These parameters are populated at the point in the protocol where the counterparty provides them.
24402 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24404 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
24407 * The late-bound funding outpoint
24409 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24411 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24414 * The late-bound funding outpoint
24416 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24418 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
24421 * Are anchors used for this channel. Boolean is serialization backwards-compatible
24423 enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24426 * Are anchors used for this channel. Boolean is serialization backwards-compatible
24428 void ChannelTransactionParameters_set_opt_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
24431 * Constructs a new ChannelTransactionParameters given each field
24433 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);
24436 * Creates a copy of the ChannelTransactionParameters
24438 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
24441 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
24443 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
24446 * Counter-party public keys
24448 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
24451 * Counter-party public keys
24453 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
24456 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
24458 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
24461 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
24463 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
24466 * Constructs a new CounterpartyChannelTransactionParameters given each field
24468 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
24471 * Creates a copy of the CounterpartyChannelTransactionParameters
24473 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
24476 * Whether the late bound parameters are populated.
24478 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
24481 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
24482 * given that the holder is the broadcaster.
24484 * self.is_populated() must be true before calling this function.
24486 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
24489 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
24490 * given that the counterparty is the broadcaster.
24492 * self.is_populated() must be true before calling this function.
24494 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
24497 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
24499 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
24502 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
24504 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
24507 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
24509 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
24512 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
24514 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
24517 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
24519 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
24522 * Get the channel pubkeys for the broadcaster
24524 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24527 * Get the channel pubkeys for the countersignatory
24529 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24532 * Get the contest delay applicable to the transactions.
24533 * Note that the contest delay was selected by the countersignatory.
24535 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24538 * Whether the channel is outbound from the broadcaster.
24540 * The boolean representing the side that initiated the channel is
24541 * an input to the commitment number obscure factor computation.
24543 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24546 * The funding outpoint
24548 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24551 * Whether to use anchors for this channel
24553 MUST_USE_RES bool DirectedChannelTransactionParameters_opt_anchors(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24556 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
24558 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
24561 * Our counterparty's signature for the transaction
24563 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
24566 * Our counterparty's signature for the transaction
24568 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
24571 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
24573 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
24576 * Creates a copy of the HolderCommitmentTransaction
24578 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
24581 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
24583 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
24586 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
24588 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
24591 * Create a new holder transaction with the given counterparty signatures.
24592 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
24594 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);
24597 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
24599 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
24602 * The commitment transaction
24604 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
24607 * The commitment transaction
24609 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
24612 * The txid for the commitment transaction.
24614 * This is provided as a performance optimization, instead of calling transaction.txid()
24617 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
24620 * The txid for the commitment transaction.
24622 * This is provided as a performance optimization, instead of calling transaction.txid()
24625 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24628 * Constructs a new BuiltCommitmentTransaction given each field
24630 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
24633 * Creates a copy of the BuiltCommitmentTransaction
24635 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
24638 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
24640 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
24643 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
24645 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
24648 * Get the SIGHASH_ALL sighash value of the transaction.
24650 * This can be used to verify a signature.
24652 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);
24655 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
24656 * because we are about to broadcast a holder transaction.
24658 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);
24661 * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
24663 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
24666 * Creates a copy of the ClosingTransaction
24668 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
24671 * Checks if two ClosingTransactions contain equal inner contents.
24673 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
24676 * Construct an object of the class
24678 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);
24681 * Trust our pre-built transaction.
24683 * Applies a wrapper which allows access to the transaction.
24685 * This should only be used if you fully trust the builder of this object. It should not
24686 * be used by an external signer - instead use the verify function.
24688 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
24691 * Verify our pre-built transaction.
24693 * Applies a wrapper which allows access to the transaction.
24695 * An external validating signer must call this method before signing
24696 * or using the built transaction.
24698 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
24701 * The value to be sent to the holder, or zero if the output will be omitted
24703 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
24706 * The value to be sent to the counterparty, or zero if the output will be omitted
24708 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
24711 * The destination of the holder's output
24713 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
24716 * The destination of the counterparty's output
24718 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
24721 * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
24723 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
24726 * The pre-built Bitcoin commitment transaction
24728 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
24731 * Get the SIGHASH_ALL sighash value of the transaction.
24733 * This can be used to verify a signature.
24735 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);
24738 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
24739 * because we are about to broadcast a holder transaction.
24741 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);
24744 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
24746 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
24749 * Creates a copy of the CommitmentTransaction
24751 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
24754 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
24756 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
24759 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
24761 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
24764 * The backwards-counting commitment number
24766 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
24769 * The value to be sent to the broadcaster
24771 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
24774 * The value to be sent to the counterparty
24776 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
24779 * The feerate paid per 1000-weight-unit in this commitment transaction.
24781 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
24784 * Trust our pre-built transaction and derived transaction creation public keys.
24786 * Applies a wrapper which allows access to these fields.
24788 * This should only be used if you fully trust the builder of this object. It should not
24789 * be used by an external signer - instead use the verify function.
24791 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
24794 * Verify our pre-built transaction and derived transaction creation public keys.
24796 * Applies a wrapper which allows access to these fields.
24798 * An external validating signer must call this method before signing
24799 * or using the built transaction.
24801 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);
24804 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
24806 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
24809 * The transaction ID of the built Bitcoin transaction
24811 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
24814 * The pre-built Bitcoin commitment transaction
24816 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
24819 * The pre-calculated transaction creation public keys.
24821 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
24824 * Should anchors be used.
24826 MUST_USE_RES bool TrustedCommitmentTransaction_opt_anchors(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
24829 * Get a signature for each HTLC which was included in the commitment transaction (ie for
24830 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
24832 * The returned Vec has one entry for each HTLC, and in the same order.
24834 * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
24836 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);
24839 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
24840 * shared secret first. This prevents on-chain observers from discovering how many commitment
24841 * transactions occurred in a channel before it was closed.
24843 * This function gets the shared secret from relevant channel public keys and can be used to
24844 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
24846 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
24849 * Checks if two InitFeaturess contain equal inner contents.
24850 * This ignores pointers and is_owned flags and looks at the values in fields.
24851 * Two objects with NULL inner values will be considered "equal" here.
24853 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
24856 * Checks if two NodeFeaturess contain equal inner contents.
24857 * This ignores pointers and is_owned flags and looks at the values in fields.
24858 * Two objects with NULL inner values will be considered "equal" here.
24860 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
24863 * Checks if two ChannelFeaturess contain equal inner contents.
24864 * This ignores pointers and is_owned flags and looks at the values in fields.
24865 * Two objects with NULL inner values will be considered "equal" here.
24867 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
24870 * Checks if two InvoiceFeaturess contain equal inner contents.
24871 * This ignores pointers and is_owned flags and looks at the values in fields.
24872 * Two objects with NULL inner values will be considered "equal" here.
24874 bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
24877 * Checks if two ChannelTypeFeaturess contain equal inner contents.
24878 * This ignores pointers and is_owned flags and looks at the values in fields.
24879 * Two objects with NULL inner values will be considered "equal" here.
24881 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
24884 * Creates a copy of the InitFeatures
24886 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
24889 * Creates a copy of the NodeFeatures
24891 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
24894 * Creates a copy of the ChannelFeatures
24896 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
24899 * Creates a copy of the InvoiceFeatures
24901 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
24904 * Creates a copy of the ChannelTypeFeatures
24906 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
24909 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
24911 void InitFeatures_free(struct LDKInitFeatures this_obj);
24914 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
24916 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
24919 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
24921 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
24924 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
24926 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
24929 * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
24931 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
24934 * Create a blank Features with no features set
24936 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
24939 * Creates a Features with the bits set which are known by the implementation
24941 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
24944 * Returns true if this `Features` object contains unknown feature flags which are set as
24947 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24950 * Create a blank Features with no features set
24952 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
24955 * Creates a Features with the bits set which are known by the implementation
24957 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
24960 * Returns true if this `Features` object contains unknown feature flags which are set as
24963 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
24966 * Create a blank Features with no features set
24968 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
24971 * Creates a Features with the bits set which are known by the implementation
24973 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
24976 * Returns true if this `Features` object contains unknown feature flags which are set as
24979 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
24982 * Create a blank Features with no features set
24984 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
24987 * Creates a Features with the bits set which are known by the implementation
24989 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
24992 * Returns true if this `Features` object contains unknown feature flags which are set as
24995 MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
24998 * Create a blank Features with no features set
25000 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
25003 * Creates a Features with the bits set which are known by the implementation
25005 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_known(void);
25008 * Returns true if this `Features` object contains unknown feature flags which are set as
25011 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25014 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
25016 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
25019 * Read a InitFeatures from a byte array, created by InitFeatures_write
25021 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
25024 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
25026 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
25029 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
25031 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
25034 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
25036 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
25039 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
25041 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
25044 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
25046 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
25049 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
25051 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
25054 * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
25056 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
25059 * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
25061 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
25064 * Set this feature as optional.
25066 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25069 * Set this feature as required.
25071 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25074 * Checks if this feature is supported.
25076 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25079 * Set this feature as optional.
25081 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25084 * Set this feature as required.
25086 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25089 * Checks if this feature is supported.
25091 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25094 * Checks if this feature is required.
25096 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25099 * Checks if this feature is required.
25101 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25104 * Set this feature as optional.
25106 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25109 * Set this feature as required.
25111 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25114 * Checks if this feature is supported.
25116 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25119 * Set this feature as optional.
25121 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25124 * Set this feature as required.
25126 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25129 * Checks if this feature is supported.
25131 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25134 * Set this feature as optional.
25136 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25139 * Set this feature as required.
25141 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25144 * Checks if this feature is supported.
25146 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25149 * Checks if this feature is required.
25151 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25154 * Checks if this feature is required.
25156 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25159 * Set this feature as optional.
25161 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25164 * Set this feature as required.
25166 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25169 * Checks if this feature is supported.
25171 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25174 * Set this feature as optional.
25176 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25179 * Set this feature as required.
25181 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25184 * Checks if this feature is supported.
25186 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25189 * Checks if this feature is required.
25191 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25194 * Checks if this feature is required.
25196 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25199 * Set this feature as optional.
25201 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25204 * Set this feature as required.
25206 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25209 * Checks if this feature is supported.
25211 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25214 * Set this feature as optional.
25216 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25219 * Set this feature as required.
25221 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25224 * Checks if this feature is supported.
25226 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25229 * Set this feature as optional.
25231 void InvoiceFeatures_set_variable_length_onion_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25234 * Set this feature as required.
25236 void InvoiceFeatures_set_variable_length_onion_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25239 * Checks if this feature is supported.
25241 MUST_USE_RES bool InvoiceFeatures_supports_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25244 * Checks if this feature is required.
25246 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25249 * Checks if this feature is required.
25251 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25254 * Checks if this feature is required.
25256 MUST_USE_RES bool InvoiceFeatures_requires_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25259 * Set this feature as optional.
25261 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25264 * Set this feature as required.
25266 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25269 * Checks if this feature is supported.
25271 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25274 * Set this feature as optional.
25276 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25279 * Set this feature as required.
25281 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25284 * Checks if this feature is supported.
25286 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25289 * Set this feature as optional.
25291 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25294 * Set this feature as required.
25296 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25299 * Checks if this feature is supported.
25301 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25304 * Checks if this feature is required.
25306 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25309 * Checks if this feature is required.
25311 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25314 * Checks if this feature is required.
25316 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25319 * Set this feature as optional.
25321 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25324 * Set this feature as required.
25326 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25329 * Checks if this feature is supported.
25331 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25334 * Set this feature as optional.
25336 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25339 * Set this feature as required.
25341 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25344 * Checks if this feature is supported.
25346 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25349 * Set this feature as optional.
25351 void InvoiceFeatures_set_payment_secret_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25354 * Set this feature as required.
25356 void InvoiceFeatures_set_payment_secret_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25359 * Checks if this feature is supported.
25361 MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25364 * Checks if this feature is required.
25366 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25369 * Checks if this feature is required.
25371 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25374 * Checks if this feature is required.
25376 MUST_USE_RES bool InvoiceFeatures_requires_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25379 * Set this feature as optional.
25381 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25384 * Set this feature as required.
25386 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25389 * Checks if this feature is supported.
25391 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25394 * Set this feature as optional.
25396 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25399 * Set this feature as required.
25401 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25404 * Checks if this feature is supported.
25406 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25409 * Set this feature as optional.
25411 void InvoiceFeatures_set_basic_mpp_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25414 * Set this feature as required.
25416 void InvoiceFeatures_set_basic_mpp_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25419 * Checks if this feature is supported.
25421 MUST_USE_RES bool InvoiceFeatures_supports_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25424 * Checks if this feature is required.
25426 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25429 * Checks if this feature is required.
25431 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25434 * Checks if this feature is required.
25436 MUST_USE_RES bool InvoiceFeatures_requires_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25439 * Set this feature as optional.
25441 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25444 * Set this feature as required.
25446 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25449 * Checks if this feature is supported.
25451 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25454 * Set this feature as optional.
25456 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25459 * Set this feature as required.
25461 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25464 * Checks if this feature is supported.
25466 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25469 * Checks if this feature is required.
25471 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25474 * Checks if this feature is required.
25476 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25479 * Set this feature as optional.
25481 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25484 * Set this feature as required.
25486 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25489 * Checks if this feature is supported.
25491 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25494 * Set this feature as optional.
25496 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25499 * Set this feature as required.
25501 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25504 * Checks if this feature is supported.
25506 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25509 * Checks if this feature is required.
25511 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25514 * Checks if this feature is required.
25516 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25519 * Set this feature as optional.
25521 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25524 * Set this feature as required.
25526 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25529 * Checks if this feature is supported.
25531 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25534 * Set this feature as optional.
25536 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25539 * Set this feature as required.
25541 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25544 * Checks if this feature is supported.
25546 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25549 * Checks if this feature is required.
25551 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25554 * Checks if this feature is required.
25556 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25559 * Set this feature as optional.
25561 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25564 * Set this feature as required.
25566 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25569 * Checks if this feature is supported.
25571 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25574 * Set this feature as optional.
25576 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25579 * Set this feature as required.
25581 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25584 * Checks if this feature is supported.
25586 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25589 * Set this feature as optional.
25591 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25594 * Set this feature as required.
25596 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25599 * Checks if this feature is supported.
25601 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25604 * Checks if this feature is required.
25606 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25609 * Checks if this feature is required.
25611 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25614 * Checks if this feature is required.
25616 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25619 * Set this feature as optional.
25621 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25624 * Set this feature as required.
25626 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25629 * Checks if this feature is supported.
25631 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25634 * Set this feature as optional.
25636 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25639 * Set this feature as required.
25641 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25644 * Checks if this feature is supported.
25646 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25649 * Set this feature as optional.
25651 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25654 * Set this feature as required.
25656 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25659 * Checks if this feature is supported.
25661 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25664 * Checks if this feature is required.
25666 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25669 * Checks if this feature is required.
25671 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25674 * Checks if this feature is required.
25676 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25679 * Set this feature as optional.
25681 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25684 * Set this feature as required.
25686 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25689 * Checks if this feature is supported.
25691 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25694 * Checks if this feature is required.
25696 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25699 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
25701 void ShutdownScript_free(struct LDKShutdownScript this_obj);
25704 * Creates a copy of the ShutdownScript
25706 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
25709 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
25711 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
25714 * The script that did not meet the requirements from [BOLT #2].
25716 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
25718 struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
25721 * The script that did not meet the requirements from [BOLT #2].
25723 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
25725 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
25728 * Constructs a new InvalidShutdownScript given each field
25730 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
25733 * Creates a copy of the InvalidShutdownScript
25735 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
25738 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
25740 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
25743 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
25745 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
25748 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
25750 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
25753 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
25755 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
25758 * Generates a witness script pubkey from the given segwit version and program.
25760 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
25761 * [`ShutdownScript::new_p2wsh`] instead.
25765 * This function may return an error if `program` is invalid for the segwit `version`.
25767 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessVersion version, struct LDKu8slice program);
25770 * Converts the shutdown script into the underlying [`Script`].
25772 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
25775 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
25777 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25779 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
25782 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
25784 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
25786 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
25789 * Calls the free function if one is set
25791 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
25794 * Calls the free function if one is set
25796 void Type_free(struct LDKType this_ptr);
25799 * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
25801 void NodeId_free(struct LDKNodeId this_obj);
25804 * Creates a copy of the NodeId
25806 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
25809 * Create a new NodeId from a public key
25811 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
25814 * Get the public key slice from this NodeId
25816 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
25819 * Checks if two NodeIds contain equal inner contents.
25821 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
25824 * Serialize the NodeId object into a byte array which can be read by NodeId_read
25826 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
25829 * Read a NodeId from a byte array, created by NodeId_write
25831 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
25834 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
25836 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
25839 * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
25841 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
25844 * Frees any resources used by the NetworkUpdate
25846 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
25849 * Creates a copy of the NetworkUpdate
25851 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
25854 * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
25856 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
25859 * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
25861 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
25864 * Utility method to constructs a new NodeFailure-variant NetworkUpdate
25866 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
25869 * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
25871 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
25874 * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
25876 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
25879 * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
25881 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
25884 * Creates a new tracker of the actual state of the network of channels and nodes,
25885 * assuming an existing Network Graph.
25886 * Chain monitor is used to make sure announced channels exist on-chain,
25887 * channel data is correct, and that the announcement is signed with
25888 * channel owners' keys.
25890 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger);
25893 * Adds a provider used to check new announcements. Does not affect
25894 * existing announcements unless they are updated.
25895 * Add, update or remove the provider would replace the current one.
25897 void P2PGossipSync_add_chain_access(struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_AccessZ chain_access);
25900 * Constructs a new EventHandler which calls the relevant methods on this_arg.
25901 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
25903 struct LDKEventHandler NetworkGraph_as_EventHandler(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
25906 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
25907 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
25909 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
25912 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
25913 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
25915 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
25918 * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
25920 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
25923 * When the last update to the channel direction was issued.
25924 * Value is opaque, as set in the announcement.
25926 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25929 * When the last update to the channel direction was issued.
25930 * Value is opaque, as set in the announcement.
25932 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
25935 * Whether the channel can be currently used for payments (in this one direction).
25937 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25940 * Whether the channel can be currently used for payments (in this one direction).
25942 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
25945 * The difference in CLTV values that you must have when routing through this channel.
25947 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25950 * The difference in CLTV values that you must have when routing through this channel.
25952 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
25955 * The minimum value, which must be relayed to the next hop via the channel
25957 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25960 * The minimum value, which must be relayed to the next hop via the channel
25962 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
25965 * The maximum value which may be relayed to the next hop via the channel.
25967 struct LDKCOption_u64Z ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25970 * The maximum value which may be relayed to the next hop via the channel.
25972 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
25975 * Fees charged when the channel is used for routing
25977 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25980 * Fees charged when the channel is used for routing
25982 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
25985 * Most recent update for the channel received from the network
25986 * Mostly redundant with the data we store in fields explicitly.
25987 * Everything else is useful only for sending out for initial routing sync.
25988 * Not stored if contains excess data to prevent DoS.
25990 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25992 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25995 * Most recent update for the channel received from the network
25996 * Mostly redundant with the data we store in fields explicitly.
25997 * Everything else is useful only for sending out for initial routing sync.
25998 * Not stored if contains excess data to prevent DoS.
26000 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26002 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
26005 * Constructs a new ChannelUpdateInfo given each field
26007 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);
26010 * Creates a copy of the ChannelUpdateInfo
26012 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
26015 * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
26017 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
26020 * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
26022 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
26025 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
26027 void ChannelInfo_free(struct LDKChannelInfo this_obj);
26030 * Protocol features of a channel communicated during its announcement
26032 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26035 * Protocol features of a channel communicated during its announcement
26037 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
26040 * Source node of the first direction of a channel
26042 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26045 * Source node of the first direction of a channel
26047 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
26050 * Details about the first direction of a channel
26052 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26054 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26057 * Details about the first direction of a channel
26059 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26061 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
26064 * Source node of the second direction of a channel
26066 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26069 * Source node of the second direction of a channel
26071 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
26074 * Details about the second direction of a channel
26076 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26078 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26081 * Details about the second direction of a channel
26083 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26085 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
26088 * The channel capacity as seen on-chain, if chain lookup is available.
26090 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26093 * The channel capacity as seen on-chain, if chain lookup is available.
26095 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
26098 * An initial announcement of the channel
26099 * Mostly redundant with the data we store in fields explicitly.
26100 * Everything else is useful only for sending out for initial routing sync.
26101 * Not stored if contains excess data to prevent DoS.
26103 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26105 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26108 * An initial announcement of the channel
26109 * Mostly redundant with the data we store in fields explicitly.
26110 * Everything else is useful only for sending out for initial routing sync.
26111 * Not stored if contains excess data to prevent DoS.
26113 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26115 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
26118 * Creates a copy of the ChannelInfo
26120 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
26123 * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
26125 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26127 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
26130 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
26132 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
26135 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
26137 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
26140 * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
26142 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
26145 * Creates a copy of the DirectedChannelInfo
26147 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
26150 * Returns information for the channel.
26152 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
26155 * Returns information for the direction.
26157 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26159 MUST_USE_RES struct LDKChannelUpdateInfo DirectedChannelInfo_direction(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
26162 * Returns the maximum HTLC amount allowed over the channel in the direction.
26164 MUST_USE_RES uint64_t DirectedChannelInfo_htlc_maximum_msat(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
26167 * Returns the [`EffectiveCapacity`] of the channel in the direction.
26169 * This is either the total capacity from the funding transaction, if known, or the
26170 * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
26173 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
26176 * Frees any resources used by the EffectiveCapacity
26178 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
26181 * Creates a copy of the EffectiveCapacity
26183 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
26186 * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
26188 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
26191 * Utility method to constructs a new MaximumHTLC-variant EffectiveCapacity
26193 struct LDKEffectiveCapacity EffectiveCapacity_maximum_htlc(uint64_t amount_msat);
26196 * Utility method to constructs a new Total-variant EffectiveCapacity
26198 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, struct LDKCOption_u64Z htlc_maximum_msat);
26201 * Utility method to constructs a new Infinite-variant EffectiveCapacity
26203 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
26206 * Utility method to constructs a new Unknown-variant EffectiveCapacity
26208 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
26211 * Returns the effective capacity denominated in millisatoshi.
26213 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
26216 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
26218 void RoutingFees_free(struct LDKRoutingFees this_obj);
26221 * Flat routing fee in satoshis
26223 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
26226 * Flat routing fee in satoshis
26228 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
26231 * Liquidity-based routing fee in millionths of a routed amount.
26232 * In other words, 10000 is 1%.
26234 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
26237 * Liquidity-based routing fee in millionths of a routed amount.
26238 * In other words, 10000 is 1%.
26240 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
26243 * Constructs a new RoutingFees given each field
26245 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
26248 * Checks if two RoutingFeess contain equal inner contents.
26249 * This ignores pointers and is_owned flags and looks at the values in fields.
26250 * Two objects with NULL inner values will be considered "equal" here.
26252 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
26255 * Creates a copy of the RoutingFees
26257 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
26260 * Checks if two RoutingFeess contain equal inner contents.
26262 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
26265 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
26267 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
26270 * Read a RoutingFees from a byte array, created by RoutingFees_write
26272 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
26275 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
26277 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
26280 * Protocol features the node announced support for
26282 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
26285 * Protocol features the node announced support for
26287 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
26290 * When the last known update to the node state was issued.
26291 * Value is opaque, as set in the announcement.
26293 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
26296 * When the last known update to the node state was issued.
26297 * Value is opaque, as set in the announcement.
26299 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
26302 * Color assigned to the node
26304 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
26307 * Color assigned to the node
26309 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
26312 * Moniker assigned to the node.
26313 * May be invalid or malicious (eg control chars),
26314 * should not be exposed to the user.
26316 struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
26319 * Moniker assigned to the node.
26320 * May be invalid or malicious (eg control chars),
26321 * should not be exposed to the user.
26323 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
26326 * Internet-level addresses via which one can connect to the node
26328 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
26331 * An initial announcement of the node
26332 * Mostly redundant with the data we store in fields explicitly.
26333 * Everything else is useful only for sending out for initial routing sync.
26334 * Not stored if contains excess data to prevent DoS.
26336 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26338 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
26341 * An initial announcement of the node
26342 * Mostly redundant with the data we store in fields explicitly.
26343 * Everything else is useful only for sending out for initial routing sync.
26344 * Not stored if contains excess data to prevent DoS.
26346 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26348 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
26351 * Constructs a new NodeAnnouncementInfo given each field
26353 MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKNodeAlias alias_arg, struct LDKCVec_NetAddressZ addresses_arg, struct LDKNodeAnnouncement announcement_message_arg);
26356 * Creates a copy of the NodeAnnouncementInfo
26358 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
26361 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
26363 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
26366 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
26368 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
26371 * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
26373 void NodeAlias_free(struct LDKNodeAlias this_obj);
26375 const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
26377 void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26380 * Constructs a new NodeAlias given each field
26382 MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
26385 * Creates a copy of the NodeAlias
26387 struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
26390 * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
26392 struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
26395 * Read a NodeAlias from a byte array, created by NodeAlias_write
26397 struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
26400 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
26402 void NodeInfo_free(struct LDKNodeInfo this_obj);
26405 * All valid channels a node has announced
26407 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
26410 * Lowest fees enabling routing via any of the enabled, known channels to a node.
26411 * The two fields (flat and proportional fee) are independent,
26412 * meaning they don't have to refer to the same channel.
26414 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26416 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
26419 * Lowest fees enabling routing via any of the enabled, known channels to a node.
26420 * The two fields (flat and proportional fee) are independent,
26421 * meaning they don't have to refer to the same channel.
26423 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26425 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
26428 * More information about a node from node_announcement.
26429 * Optional because we store a Node entry after learning about it from
26430 * a channel announcement, but before receiving a node announcement.
26432 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26434 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
26437 * More information about a node from node_announcement.
26438 * Optional because we store a Node entry after learning about it from
26439 * a channel announcement, but before receiving a node announcement.
26441 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26443 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
26446 * Constructs a new NodeInfo given each field
26448 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
26451 * Creates a copy of the NodeInfo
26453 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
26456 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
26458 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
26461 * Read a NodeInfo from a byte array, created by NodeInfo_write
26463 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
26466 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
26468 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
26471 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
26473 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
26476 * Creates a new, empty, network graph.
26478 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKLogger logger);
26481 * Returns a read-only view of the network graph.
26483 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
26486 * The unix timestamp provided by the most recent rapid gossip sync.
26487 * It will be set by the rapid sync process after every sync completion.
26489 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
26492 * Update the unix timestamp provided by the most recent rapid gossip sync.
26493 * This should be done automatically by the rapid sync process after every sync completion.
26495 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
26498 * For an already known node (from channel announcements), update its stored properties from a
26499 * given node announcement.
26501 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
26502 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
26503 * routing messages from a source using a protocol other than the lightning P2P protocol.
26505 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
26508 * For an already known node (from channel announcements), update its stored properties from a
26509 * given node announcement without verifying the associated signatures. Because we aren't
26510 * given the associated signatures here we cannot relay the node announcement to any of our
26513 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);
26516 * Store or update channel info from a channel announcement.
26518 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
26519 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
26520 * routing messages from a source using a protocol other than the lightning P2P protocol.
26522 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
26523 * the corresponding UTXO exists on chain and is correctly-formatted.
26525 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);
26528 * Store or update channel info from a channel announcement without verifying the associated
26529 * signatures. Because we aren't given the associated signatures here we cannot relay the
26530 * channel announcement to any of our peers.
26532 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
26533 * the corresponding UTXO exists on chain and is correctly-formatted.
26535 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);
26538 * Update channel from partial announcement data received via rapid gossip sync
26540 * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
26541 * rapid gossip sync server)
26543 * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
26545 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);
26548 * Marks a channel in the graph as failed if a corresponding HTLC fail was sent.
26549 * If permanent, removes a channel from the local storage.
26550 * May cause the removal of nodes too, if this was their last channel.
26551 * If not permanent, makes channels unavailable for routing.
26553 void NetworkGraph_channel_failed(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
26556 * Marks a node in the graph as failed.
26558 void NetworkGraph_node_failed(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey _node_id, bool is_permanent);
26561 * Removes information about channels that we haven't heard any updates about in some time.
26562 * This can be used regularly to prune the network graph of channels that likely no longer
26565 * While there is no formal requirement that nodes regularly re-broadcast their channel
26566 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
26567 * pruning occur for updates which are at least two weeks old, which we implement here.
26569 * Note that for users of the `lightning-background-processor` crate this method may be
26570 * automatically called regularly for you.
26572 * This method is only available with the `std` feature. See
26573 * [`NetworkGraph::remove_stale_channels_with_time`] for `no-std` use.
26575 void NetworkGraph_remove_stale_channels(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
26578 * Removes information about channels that we haven't heard any updates about in some time.
26579 * This can be used regularly to prune the network graph of channels that likely no longer
26582 * While there is no formal requirement that nodes regularly re-broadcast their channel
26583 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
26584 * pruning occur for updates which are at least two weeks old, which we implement here.
26586 * This function takes the current unix time as an argument. For users with the `std` feature
26587 * enabled, [`NetworkGraph::remove_stale_channels`] may be preferable.
26589 void NetworkGraph_remove_stale_channels_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
26592 * For an already known (from announcement) channel, update info about one of the directions
26595 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
26596 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
26597 * routing messages from a source using a protocol other than the lightning P2P protocol.
26599 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
26600 * materially in the future will be rejected.
26602 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
26605 * For an already known (from announcement) channel, update info about one of the directions
26606 * of the channel without verifying the associated signatures. Because we aren't given the
26607 * associated signatures here we cannot relay the channel update to any of our peers.
26609 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
26610 * materially in the future will be rejected.
26612 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
26615 * Get network addresses by node id.
26616 * Returns None if the requested node is completely unknown,
26617 * or if node announcement for the node was never received.
26619 MUST_USE_RES struct LDKCOption_CVec_NetAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
26622 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
26624 void RouteHop_free(struct LDKRouteHop this_obj);
26627 * The node_id of the node at this hop.
26629 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
26632 * The node_id of the node at this hop.
26634 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26637 * The node_announcement features of the node at this hop. For the last hop, these may be
26638 * amended to match the features present in the invoice this node generated.
26640 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
26643 * The node_announcement features of the node at this hop. For the last hop, these may be
26644 * amended to match the features present in the invoice this node generated.
26646 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
26649 * The channel that should be used from the previous hop to reach this node.
26651 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
26654 * The channel that should be used from the previous hop to reach this node.
26656 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
26659 * The channel_announcement features of the channel that should be used from the previous hop
26660 * to reach this node.
26662 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
26665 * The channel_announcement features of the channel that should be used from the previous hop
26666 * to reach this node.
26668 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
26671 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
26672 * For the last hop, this should be the full value of the payment (might be more than
26673 * requested if we had to match htlc_minimum_msat).
26675 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
26678 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
26679 * For the last hop, this should be the full value of the payment (might be more than
26680 * requested if we had to match htlc_minimum_msat).
26682 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
26685 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
26686 * expected at the destination, in excess of the current block height.
26688 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
26691 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
26692 * expected at the destination, in excess of the current block height.
26694 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
26697 * Constructs a new RouteHop given each field
26699 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);
26702 * Creates a copy of the RouteHop
26704 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
26707 * Checks if two RouteHops contain equal inner contents.
26709 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
26712 * Checks if two RouteHops contain equal inner contents.
26713 * This ignores pointers and is_owned flags and looks at the values in fields.
26714 * Two objects with NULL inner values will be considered "equal" here.
26716 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
26719 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
26721 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
26724 * Read a RouteHop from a byte array, created by RouteHop_write
26726 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
26729 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
26731 void Route_free(struct LDKRoute this_obj);
26734 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
26735 * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT
26736 * INCLUDING our own, where the last hop is the destination. Thus, this must always be at
26737 * least length one. While the maximum length of any given path is variable, keeping the length
26738 * of any path less or equal to 19 should currently ensure it is viable.
26740 struct LDKCVec_CVec_RouteHopZZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
26743 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
26744 * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT
26745 * INCLUDING our own, where the last hop is the destination. Thus, this must always be at
26746 * least length one. While the maximum length of any given path is variable, keeping the length
26747 * of any path less or equal to 19 should currently ensure it is viable.
26749 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
26752 * The `payment_params` parameter passed to [`find_route`].
26753 * This is used by `ChannelManager` to track information which may be required for retries,
26754 * provided back to you via [`Event::PaymentPathFailed`].
26756 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
26758 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26760 struct LDKPaymentParameters Route_get_payment_params(const struct LDKRoute *NONNULL_PTR this_ptr);
26763 * The `payment_params` parameter passed to [`find_route`].
26764 * This is used by `ChannelManager` to track information which may be required for retries,
26765 * provided back to you via [`Event::PaymentPathFailed`].
26767 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
26769 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26771 void Route_set_payment_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
26774 * Constructs a new Route given each field
26776 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg, struct LDKPaymentParameters payment_params_arg);
26779 * Creates a copy of the Route
26781 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
26784 * Checks if two Routes contain equal inner contents.
26786 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
26789 * Checks if two Routes contain equal inner contents.
26790 * This ignores pointers and is_owned flags and looks at the values in fields.
26791 * Two objects with NULL inner values will be considered "equal" here.
26793 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
26796 * Returns the total amount of fees paid on this [`Route`].
26798 * This doesn't include any extra payment made to the recipient, which can happen in excess of
26799 * the amount passed to [`find_route`]'s `params.final_value_msat`.
26801 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
26804 * Returns the total amount paid on this [`Route`], excluding the fees.
26806 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
26809 * Serialize the Route object into a byte array which can be read by Route_read
26811 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
26814 * Read a Route from a byte array, created by Route_write
26816 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
26819 * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
26821 void RouteParameters_free(struct LDKRouteParameters this_obj);
26824 * The parameters of the failed payment path.
26826 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
26829 * The parameters of the failed payment path.
26831 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
26834 * The amount in msats sent on the failed payment path.
26836 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
26839 * The amount in msats sent on the failed payment path.
26841 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
26844 * The CLTV on the final hop of the failed payment path.
26846 uint32_t RouteParameters_get_final_cltv_expiry_delta(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
26849 * The CLTV on the final hop of the failed payment path.
26851 void RouteParameters_set_final_cltv_expiry_delta(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint32_t val);
26854 * Constructs a new RouteParameters given each field
26856 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);
26859 * Creates a copy of the RouteParameters
26861 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
26864 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
26866 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
26869 * Read a RouteParameters from a byte array, created by RouteParameters_write
26871 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
26874 * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
26876 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
26879 * The node id of the payee.
26881 struct LDKPublicKey PaymentParameters_get_payee_pubkey(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
26884 * The node id of the payee.
26886 void PaymentParameters_set_payee_pubkey(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26889 * Features supported by the payee.
26891 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
26892 * does not contain any features.
26894 * [`for_keysend`]: Self::for_keysend
26896 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26898 struct LDKInvoiceFeatures PaymentParameters_get_features(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
26901 * Features supported by the payee.
26903 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
26904 * does not contain any features.
26906 * [`for_keysend`]: Self::for_keysend
26908 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26910 void PaymentParameters_set_features(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKInvoiceFeatures val);
26913 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
26915 struct LDKCVec_RouteHintZ PaymentParameters_get_route_hints(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
26918 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
26920 void PaymentParameters_set_route_hints(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintZ val);
26923 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
26925 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
26928 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
26930 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
26933 * The maximum total CLTV delta we accept for the route.
26934 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
26936 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
26939 * The maximum total CLTV delta we accept for the route.
26940 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
26942 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
26945 * The maximum number of paths that may be used by MPP payments.
26946 * Defaults to [`DEFAULT_MAX_MPP_PATH_COUNT`].
26948 uint8_t PaymentParameters_get_max_mpp_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
26951 * The maximum number of paths that may be used by MPP payments.
26952 * Defaults to [`DEFAULT_MAX_MPP_PATH_COUNT`].
26954 void PaymentParameters_set_max_mpp_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
26957 * Constructs a new PaymentParameters given each field
26959 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, uint8_t max_mpp_path_count_arg);
26962 * Creates a copy of the PaymentParameters
26964 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
26967 * Checks if two PaymentParameterss contain equal inner contents.
26969 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
26972 * Checks if two PaymentParameterss contain equal inner contents.
26973 * This ignores pointers and is_owned flags and looks at the values in fields.
26974 * Two objects with NULL inner values will be considered "equal" here.
26976 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
26979 * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
26981 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
26984 * Read a PaymentParameters from a byte array, created by PaymentParameters_write
26986 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser);
26989 * Creates a payee with the node id of the given `pubkey`.
26991 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey);
26994 * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
26996 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey);
26999 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
27001 void RouteHint_free(struct LDKRouteHint this_obj);
27003 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
27005 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
27008 * Constructs a new RouteHint given each field
27010 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
27013 * Creates a copy of the RouteHint
27015 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
27018 * Checks if two RouteHints contain equal inner contents.
27020 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
27023 * Checks if two RouteHints contain equal inner contents.
27024 * This ignores pointers and is_owned flags and looks at the values in fields.
27025 * Two objects with NULL inner values will be considered "equal" here.
27027 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
27030 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
27032 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
27035 * Read a RouteHint from a byte array, created by RouteHint_write
27037 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
27040 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
27042 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
27045 * The node_id of the non-target end of the route
27047 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
27050 * The node_id of the non-target end of the route
27052 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27055 * The short_channel_id of this channel
27057 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
27060 * The short_channel_id of this channel
27062 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
27065 * The fees which must be paid to use this channel
27067 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
27070 * The fees which must be paid to use this channel
27072 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
27075 * The difference in CLTV values between this node and the next node.
27077 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
27080 * The difference in CLTV values between this node and the next node.
27082 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
27085 * The minimum value, in msat, which must be relayed to the next hop.
27087 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
27090 * The minimum value, in msat, which must be relayed to the next hop.
27092 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
27095 * The maximum value in msat available for routing with a single HTLC.
27097 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
27100 * The maximum value in msat available for routing with a single HTLC.
27102 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
27105 * Constructs a new RouteHintHop given each field
27107 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);
27110 * Creates a copy of the RouteHintHop
27112 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
27115 * Checks if two RouteHintHops contain equal inner contents.
27117 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
27120 * Checks if two RouteHintHops contain equal inner contents.
27121 * This ignores pointers and is_owned flags and looks at the values in fields.
27122 * Two objects with NULL inner values will be considered "equal" here.
27124 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
27127 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
27129 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
27132 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
27134 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
27137 * Finds a route from us (payer) to the given target node (payee).
27139 * If the payee provided features in their invoice, they should be provided via `params.payee`.
27140 * Without this, MPP will only be used if the payee's features are available in the network graph.
27142 * Private routing paths between a public node and the target may be included in `params.payee`.
27144 * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
27145 * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
27146 * from `network_graph` will be ignored, and only those in `first_hops` will be used.
27148 * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
27149 * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
27150 * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
27154 * May be used to re-compute a [`Route`] when handling a [`Event::PaymentPathFailed`]. Any
27155 * adjustments to the [`NetworkGraph`] and channel scores should be made prior to calling this
27160 * Panics if first_hops contains channels without short_channel_ids;
27161 * [`ChannelManager::list_usable_channels`] will never include such channels.
27163 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
27164 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
27165 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
27167 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
27169 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]);
27172 * Construct a route from us (payer) to the target node (payee) via the given hops (which should
27173 * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
27175 * Re-uses logic from `find_route`, so the restrictions described there also apply here.
27177 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]);
27180 * Calls the free function if one is set
27182 void Score_free(struct LDKScore this_ptr);
27185 * Calls the free function if one is set
27187 void LockableScore_free(struct LDKLockableScore this_ptr);
27190 * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
27192 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
27195 * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
27197 struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
27200 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
27202 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
27205 * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
27207 void ChannelUsage_free(struct LDKChannelUsage this_obj);
27210 * The amount to send through the channel, denominated in millisatoshis.
27212 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
27215 * The amount to send through the channel, denominated in millisatoshis.
27217 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
27220 * Total amount, denominated in millisatoshis, already allocated to send through the channel
27221 * as part of a multi-path payment.
27223 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
27226 * Total amount, denominated in millisatoshis, already allocated to send through the channel
27227 * as part of a multi-path payment.
27229 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
27232 * The effective capacity of the channel.
27234 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
27237 * The effective capacity of the channel.
27239 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
27242 * Constructs a new ChannelUsage given each field
27244 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
27247 * Creates a copy of the ChannelUsage
27249 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
27252 * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
27254 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
27257 * Creates a copy of the FixedPenaltyScorer
27259 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
27262 * Creates a new scorer using `penalty_msat`.
27264 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
27267 * Constructs a new Score which calls the relevant methods on this_arg.
27268 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
27270 struct LDKScore FixedPenaltyScorer_as_Score(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
27273 * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
27275 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
27278 * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
27280 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
27283 * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
27285 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
27288 * Frees any resources used by the ProbabilisticScoringParameters, if is_owned is set and inner is non-NULL.
27290 void ProbabilisticScoringParameters_free(struct LDKProbabilisticScoringParameters this_obj);
27293 * A fixed penalty in msats to apply to each channel.
27295 * Default value: 500 msat
27297 uint64_t ProbabilisticScoringParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27300 * A fixed penalty in msats to apply to each channel.
27302 * Default value: 500 msat
27304 void ProbabilisticScoringParameters_set_base_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27307 * A multiplier used in conjunction with the negative `log10` of the channel's success
27308 * probability for a payment to determine the liquidity penalty.
27310 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
27311 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
27312 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
27313 * lower bounding the success probability to `0.01`) when the amount falls within the
27314 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
27315 * result in a `u64::max_value` penalty, however.
27317 * Default value: 40,000 msat
27319 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
27321 uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27324 * A multiplier used in conjunction with the negative `log10` of the channel's success
27325 * probability for a payment to determine the liquidity penalty.
27327 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
27328 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
27329 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
27330 * lower bounding the success probability to `0.01`) when the amount falls within the
27331 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
27332 * result in a `u64::max_value` penalty, however.
27334 * Default value: 40,000 msat
27336 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
27338 void ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27341 * The time required to elapse before any knowledge learned about channel liquidity balances is
27344 * The bounds are defined in terms of offsets and are initially zero. Increasing the offsets
27345 * gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases
27346 * the certainty of the channel liquidity balance.
27348 * Default value: 1 hour
27352 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
27353 * liquidity knowledge will never decay except when the bounds cross.
27355 uint64_t ProbabilisticScoringParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27358 * The time required to elapse before any knowledge learned about channel liquidity balances is
27361 * The bounds are defined in terms of offsets and are initially zero. Increasing the offsets
27362 * gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases
27363 * the certainty of the channel liquidity balance.
27365 * Default value: 1 hour
27369 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
27370 * liquidity knowledge will never decay except when the bounds cross.
27372 void ProbabilisticScoringParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27375 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
27376 * channel's success probability for the payment to determine the amount penalty.
27378 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
27379 * fees plus penalty) for large payments. The penalty is computed as the product of this
27380 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
27381 * success probability.
27383 * `-log10(success_probability) * amount_penalty_multiplier_msat * amount_msat / 2^20`
27385 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
27386 * the amount will result in a penalty of the multiplier. And, as the success probability
27387 * decreases, the negative `log10` weighting will increase dramatically. For higher success
27388 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
27391 * Default value: 256 msat
27393 uint64_t ProbabilisticScoringParameters_get_amount_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27396 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
27397 * channel's success probability for the payment to determine the amount penalty.
27399 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
27400 * fees plus penalty) for large payments. The penalty is computed as the product of this
27401 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
27402 * success probability.
27404 * `-log10(success_probability) * amount_penalty_multiplier_msat * amount_msat / 2^20`
27406 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
27407 * the amount will result in a penalty of the multiplier. And, as the success probability
27408 * decreases, the negative `log10` weighting will increase dramatically. For higher success
27409 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
27412 * Default value: 256 msat
27414 void ProbabilisticScoringParameters_set_amount_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27417 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
27418 * channel's capacity, which makes us prefer nodes with a smaller `htlc_maximum_msat`. We
27419 * treat such nodes preferentially as this makes balance discovery attacks harder to execute,
27420 * thereby creating an incentive to restrict `htlc_maximum_msat` and improve privacy.
27422 * Default value: 250 msat
27424 uint64_t ProbabilisticScoringParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27427 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
27428 * channel's capacity, which makes us prefer nodes with a smaller `htlc_maximum_msat`. We
27429 * treat such nodes preferentially as this makes balance discovery attacks harder to execute,
27430 * thereby creating an incentive to restrict `htlc_maximum_msat` and improve privacy.
27432 * Default value: 250 msat
27434 void ProbabilisticScoringParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27437 * Creates a copy of the ProbabilisticScoringParameters
27439 struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_clone(const struct LDKProbabilisticScoringParameters *NONNULL_PTR orig);
27442 * Creates a new scorer using the given scoring parameters for sending payments from a node
27443 * through a network graph.
27445 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringParameters params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
27448 * Dump the contents of this scorer into the configured logger.
27450 * Note that this writes roughly one line per channel for which we have a liquidity estimate,
27451 * which may be a substantial amount of log output.
27453 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
27456 * Query the estimated minimum and maximum liquidity available for sending a payment over the
27457 * channel with `scid` towards the given `target` node.
27459 MUST_USE_RES struct LDKCOption_C2Tuple_u64u64ZZ ProbabilisticScorer_estimated_channel_liquidity_range(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target);
27462 * Marks the node with the given `node_id` as banned, i.e.,
27463 * it will be avoided during path finding.
27465 void ProbabilisticScorer_add_banned(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
27468 * Removes the node with the given `node_id` from the list of nodes to avoid.
27470 void ProbabilisticScorer_remove_banned(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
27473 * Clears the list of nodes that are avoided during path finding.
27475 void ProbabilisticScorer_clear_banned(struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
27478 * Marks all nodes in the given list as banned, i.e.,
27479 * they will be avoided during path finding.
27481 void ProbabilisticScoringParameters_add_banned_from_list(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
27484 * Creates a "default" ProbabilisticScoringParameters. See struct and individual field documentaiton for details on which values are used.
27486 MUST_USE_RES struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_default(void);
27489 * Constructs a new Score which calls the relevant methods on this_arg.
27490 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
27492 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
27495 * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
27497 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
27500 * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
27502 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
27505 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
27507 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
27510 * Initialize a new FilesystemPersister and set the path to the individual channels'
27513 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
27516 * Get the directory which was provided when this persister was initialized.
27518 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
27521 * Read `ChannelMonitor`s from disk.
27523 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
27526 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
27528 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
27531 * Frees any resources used by the GossipSync
27533 void GossipSync_free(struct LDKGossipSync this_ptr);
27536 * Utility method to constructs a new P2P-variant GossipSync
27538 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
27541 * Utility method to constructs a new Rapid-variant GossipSync
27543 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
27546 * Utility method to constructs a new None-variant GossipSync
27548 struct LDKGossipSync GossipSync_none(void);
27551 * Start a background thread that takes care of responsibilities enumerated in the [top-level
27554 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
27555 * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
27556 * either [`join`] or [`stop`].
27558 * # Data Persistence
27560 * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
27561 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
27562 * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
27563 * provided implementation.
27565 * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
27566 * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
27567 * See the `lightning-persister` crate for LDK's provided implementation.
27569 * Typically, users should either implement [`Persister::persist_manager`] to never return an
27570 * error or call [`join`] and handle any error that may arise. For the latter case,
27571 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
27575 * `event_handler` is responsible for handling events that users should be notified of (e.g.,
27576 * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
27577 * functionality implemented by other handlers.
27578 * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
27580 * # Rapid Gossip Sync
27582 * If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
27583 * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
27584 * until the [`RapidGossipSync`] instance completes its first sync.
27586 * [top-level documentation]: BackgroundProcessor
27587 * [`join`]: Self::join
27588 * [`stop`]: Self::stop
27589 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
27590 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
27591 * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
27592 * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
27593 * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
27594 * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
27596 * Note that scorer (or a relevant inner pointer) may be NULL or all-0s to represent None
27598 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);
27601 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
27602 * [`ChannelManager`].
27606 * This function panics if the background thread has panicked such as while persisting or
27609 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
27611 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
27614 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
27615 * [`ChannelManager`].
27619 * This function panics if the background thread has panicked such as while persisting or
27622 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
27624 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
27627 * Frees any resources used by the ParseError
27629 void ParseError_free(struct LDKParseError this_ptr);
27632 * Creates a copy of the ParseError
27634 struct LDKParseError ParseError_clone(const struct LDKParseError *NONNULL_PTR orig);
27637 * Utility method to constructs a new Bech32Error-variant ParseError
27639 struct LDKParseError ParseError_bech32_error(struct LDKBech32Error a);
27642 * Utility method to constructs a new ParseAmountError-variant ParseError
27644 struct LDKParseError ParseError_parse_amount_error(struct LDKError a);
27647 * Utility method to constructs a new MalformedSignature-variant ParseError
27649 struct LDKParseError ParseError_malformed_signature(enum LDKSecp256k1Error a);
27652 * Utility method to constructs a new BadPrefix-variant ParseError
27654 struct LDKParseError ParseError_bad_prefix(void);
27657 * Utility method to constructs a new UnknownCurrency-variant ParseError
27659 struct LDKParseError ParseError_unknown_currency(void);
27662 * Utility method to constructs a new UnknownSiPrefix-variant ParseError
27664 struct LDKParseError ParseError_unknown_si_prefix(void);
27667 * Utility method to constructs a new MalformedHRP-variant ParseError
27669 struct LDKParseError ParseError_malformed_hrp(void);
27672 * Utility method to constructs a new TooShortDataPart-variant ParseError
27674 struct LDKParseError ParseError_too_short_data_part(void);
27677 * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant ParseError
27679 struct LDKParseError ParseError_unexpected_end_of_tagged_fields(void);
27682 * Utility method to constructs a new DescriptionDecodeError-variant ParseError
27684 struct LDKParseError ParseError_description_decode_error(struct LDKError a);
27687 * Utility method to constructs a new PaddingError-variant ParseError
27689 struct LDKParseError ParseError_padding_error(void);
27692 * Utility method to constructs a new IntegerOverflowError-variant ParseError
27694 struct LDKParseError ParseError_integer_overflow_error(void);
27697 * Utility method to constructs a new InvalidSegWitProgramLength-variant ParseError
27699 struct LDKParseError ParseError_invalid_seg_wit_program_length(void);
27702 * Utility method to constructs a new InvalidPubKeyHashLength-variant ParseError
27704 struct LDKParseError ParseError_invalid_pub_key_hash_length(void);
27707 * Utility method to constructs a new InvalidScriptHashLength-variant ParseError
27709 struct LDKParseError ParseError_invalid_script_hash_length(void);
27712 * Utility method to constructs a new InvalidRecoveryId-variant ParseError
27714 struct LDKParseError ParseError_invalid_recovery_id(void);
27717 * Utility method to constructs a new InvalidSliceLength-variant ParseError
27719 struct LDKParseError ParseError_invalid_slice_length(struct LDKStr a);
27722 * Utility method to constructs a new Skip-variant ParseError
27724 struct LDKParseError ParseError_skip(void);
27727 * Frees any resources used by the ParseOrSemanticError
27729 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
27732 * Creates a copy of the ParseOrSemanticError
27734 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
27737 * Utility method to constructs a new ParseError-variant ParseOrSemanticError
27739 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKParseError a);
27742 * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
27744 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKSemanticError a);
27747 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
27749 void Invoice_free(struct LDKInvoice this_obj);
27752 * Checks if two Invoices contain equal inner contents.
27753 * This ignores pointers and is_owned flags and looks at the values in fields.
27754 * Two objects with NULL inner values will be considered "equal" here.
27756 bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
27759 * Creates a copy of the Invoice
27761 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
27764 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
27766 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
27769 * Checks if two SignedRawInvoices contain equal inner contents.
27770 * This ignores pointers and is_owned flags and looks at the values in fields.
27771 * Two objects with NULL inner values will be considered "equal" here.
27773 bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
27776 * Creates a copy of the SignedRawInvoice
27778 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
27781 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
27783 void RawInvoice_free(struct LDKRawInvoice this_obj);
27788 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
27793 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
27796 * Checks if two RawInvoices contain equal inner contents.
27797 * This ignores pointers and is_owned flags and looks at the values in fields.
27798 * Two objects with NULL inner values will be considered "equal" here.
27800 bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
27803 * Creates a copy of the RawInvoice
27805 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
27808 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
27810 void RawDataPart_free(struct LDKRawDataPart this_obj);
27813 * generation time of the invoice
27815 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
27818 * generation time of the invoice
27820 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
27823 * Checks if two RawDataParts contain equal inner contents.
27824 * This ignores pointers and is_owned flags and looks at the values in fields.
27825 * Two objects with NULL inner values will be considered "equal" here.
27827 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
27830 * Creates a copy of the RawDataPart
27832 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
27835 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
27837 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
27840 * Checks if two PositiveTimestamps contain equal inner contents.
27841 * This ignores pointers and is_owned flags and looks at the values in fields.
27842 * Two objects with NULL inner values will be considered "equal" here.
27844 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
27847 * Creates a copy of the PositiveTimestamp
27849 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
27852 * Creates a copy of the SiPrefix
27854 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
27857 * Utility method to constructs a new Milli-variant SiPrefix
27859 enum LDKSiPrefix SiPrefix_milli(void);
27862 * Utility method to constructs a new Micro-variant SiPrefix
27864 enum LDKSiPrefix SiPrefix_micro(void);
27867 * Utility method to constructs a new Nano-variant SiPrefix
27869 enum LDKSiPrefix SiPrefix_nano(void);
27872 * Utility method to constructs a new Pico-variant SiPrefix
27874 enum LDKSiPrefix SiPrefix_pico(void);
27877 * Checks if two SiPrefixs contain equal inner contents.
27878 * This ignores pointers and is_owned flags and looks at the values in fields.
27880 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
27883 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
27884 * This is effectively 10^12 * the prefix multiplier
27886 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
27889 * Creates a copy of the Currency
27891 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
27894 * Utility method to constructs a new Bitcoin-variant Currency
27896 enum LDKCurrency Currency_bitcoin(void);
27899 * Utility method to constructs a new BitcoinTestnet-variant Currency
27901 enum LDKCurrency Currency_bitcoin_testnet(void);
27904 * Utility method to constructs a new Regtest-variant Currency
27906 enum LDKCurrency Currency_regtest(void);
27909 * Utility method to constructs a new Simnet-variant Currency
27911 enum LDKCurrency Currency_simnet(void);
27914 * Utility method to constructs a new Signet-variant Currency
27916 enum LDKCurrency Currency_signet(void);
27919 * Checks if two Currencys contain equal inner contents.
27921 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
27924 * Checks if two Currencys contain equal inner contents.
27925 * This ignores pointers and is_owned flags and looks at the values in fields.
27927 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
27930 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
27932 void Sha256_free(struct LDKSha256 this_obj);
27935 * Creates a copy of the Sha256
27937 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
27940 * Checks if two Sha256s contain equal inner contents.
27942 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
27945 * Checks if two Sha256s contain equal inner contents.
27946 * This ignores pointers and is_owned flags and looks at the values in fields.
27947 * Two objects with NULL inner values will be considered "equal" here.
27949 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
27952 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
27954 void Description_free(struct LDKDescription this_obj);
27957 * Creates a copy of the Description
27959 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
27962 * Checks if two Descriptions contain equal inner contents.
27964 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
27967 * Checks if two Descriptions contain equal inner contents.
27968 * This ignores pointers and is_owned flags and looks at the values in fields.
27969 * Two objects with NULL inner values will be considered "equal" here.
27971 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
27974 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
27976 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
27978 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
27980 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27983 * Constructs a new PayeePubKey given each field
27985 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
27988 * Creates a copy of the PayeePubKey
27990 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
27993 * Checks if two PayeePubKeys contain equal inner contents.
27995 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
27998 * Checks if two PayeePubKeys contain equal inner contents.
27999 * This ignores pointers and is_owned flags and looks at the values in fields.
28000 * Two objects with NULL inner values will be considered "equal" here.
28002 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
28005 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
28007 void ExpiryTime_free(struct LDKExpiryTime this_obj);
28010 * Creates a copy of the ExpiryTime
28012 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
28015 * Checks if two ExpiryTimes contain equal inner contents.
28017 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
28020 * Checks if two ExpiryTimes contain equal inner contents.
28021 * This ignores pointers and is_owned flags and looks at the values in fields.
28022 * Two objects with NULL inner values will be considered "equal" here.
28024 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
28027 * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
28029 void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
28031 uint64_t MinFinalCltvExpiry_get_a(const struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr);
28033 void MinFinalCltvExpiry_set_a(struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr, uint64_t val);
28036 * Constructs a new MinFinalCltvExpiry given each field
28038 MUST_USE_RES struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_new(uint64_t a_arg);
28041 * Creates a copy of the MinFinalCltvExpiry
28043 struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
28046 * Checks if two MinFinalCltvExpirys contain equal inner contents.
28048 uint64_t MinFinalCltvExpiry_hash(const struct LDKMinFinalCltvExpiry *NONNULL_PTR o);
28051 * Checks if two MinFinalCltvExpirys contain equal inner contents.
28052 * This ignores pointers and is_owned flags and looks at the values in fields.
28053 * Two objects with NULL inner values will be considered "equal" here.
28055 bool MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b);
28058 * Frees any resources used by the Fallback
28060 void Fallback_free(struct LDKFallback this_ptr);
28063 * Creates a copy of the Fallback
28065 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
28068 * Utility method to constructs a new SegWitProgram-variant Fallback
28070 struct LDKFallback Fallback_seg_wit_program(struct LDKu5 version, struct LDKCVec_u8Z program);
28073 * Utility method to constructs a new PubKeyHash-variant Fallback
28075 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
28078 * Utility method to constructs a new ScriptHash-variant Fallback
28080 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
28083 * Checks if two Fallbacks contain equal inner contents.
28085 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
28088 * Checks if two Fallbacks contain equal inner contents.
28089 * This ignores pointers and is_owned flags and looks at the values in fields.
28091 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
28094 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
28096 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
28099 * Creates a copy of the InvoiceSignature
28101 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
28104 * Checks if two InvoiceSignatures contain equal inner contents.
28105 * This ignores pointers and is_owned flags and looks at the values in fields.
28106 * Two objects with NULL inner values will be considered "equal" here.
28108 bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b);
28111 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
28113 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
28116 * Creates a copy of the PrivateRoute
28118 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
28121 * Checks if two PrivateRoutes contain equal inner contents.
28123 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
28126 * Checks if two PrivateRoutes contain equal inner contents.
28127 * This ignores pointers and is_owned flags and looks at the values in fields.
28128 * Two objects with NULL inner values will be considered "equal" here.
28130 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
28133 * Disassembles the `SignedRawInvoice` into its three parts:
28135 * 2. hash of the raw invoice
28138 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
28141 * The `RawInvoice` which was signed.
28143 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
28146 * The hash of the `RawInvoice` that was signed.
28148 MUST_USE_RES const uint8_t (*SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
28151 * InvoiceSignature for the invoice.
28153 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
28156 * Recovers the public key used for signing the invoice from the recoverable signature.
28158 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
28161 * Checks if the signature is valid for the included payee public key or if none exists if it's
28162 * valid for the recovered signature (which should always be true?).
28164 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
28167 * Calculate the hash of the encoded `RawInvoice`
28169 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28173 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28175 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28179 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28181 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28185 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28187 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28191 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28193 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28197 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28199 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28203 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28205 MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28209 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28211 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28215 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28217 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28219 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawInvoice_private_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28221 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28223 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28226 * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
28228 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
28230 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
28233 * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
28234 * the range `0..=MAX_TIMESTAMP`.
28236 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
28238 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
28241 * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
28242 * `0..=MAX_TIMESTAMP`.
28244 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
28246 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
28249 * Returns the Unix timestamp representing the stored time
28251 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
28254 * Returns the duration of the stored time since the Unix epoch
28256 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
28259 * Returns the [`SystemTime`] representing the stored time
28261 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
28264 * Transform the `Invoice` into it's unchecked version
28266 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
28269 * Check that the invoice is signed correctly and that key recovery works
28271 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
28274 * Constructs an `Invoice` from a `SignedRawInvoice` by checking all its invariants.
28276 * use lightning_invoice::*;
28278 * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
28279 * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
28280 * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
28281 * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
28282 * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
28283 * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
28284 * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
28285 * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
28286 * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
28287 * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
28288 * j5r6drg6k6zcqj0fcwg\";
28290 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
28292 * assert!(Invoice::from_signed(signed).is_ok());
28295 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
28298 * Returns the `Invoice`'s timestamp (should equal its creation time)
28300 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
28303 * Returns the `Invoice`'s timestamp as a duration since the Unix epoch
28305 MUST_USE_RES uint64_t Invoice_duration_since_epoch(const struct LDKInvoice *NONNULL_PTR this_arg);
28308 * Returns the hash to which we will receive the preimage on completion of the payment
28310 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
28313 * Get the payee's public key if one was included in the invoice
28315 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28317 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
28320 * Get the payment secret if one was included in the invoice
28322 MUST_USE_RES const uint8_t (*Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
28325 * Get the invoice features if they were included in the invoice
28327 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28329 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
28332 * Recover the payee's public key (only to be used if none was included in the invoice)
28334 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
28337 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
28339 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
28342 * Returns whether the invoice has expired.
28344 MUST_USE_RES bool Invoice_is_expired(const struct LDKInvoice *NONNULL_PTR this_arg);
28347 * Returns whether the expiry time would pass at the given point in time.
28348 * `at_time` is the timestamp as a duration since the Unix epoch.
28350 MUST_USE_RES bool Invoice_would_expire(const struct LDKInvoice *NONNULL_PTR this_arg, uint64_t at_time);
28353 * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
28354 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
28356 MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
28359 * Returns a list of all routes included in the invoice
28361 MUST_USE_RES struct LDKCVec_PrivateRouteZ Invoice_private_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
28364 * Returns a list of all routes included in the invoice as the underlying hints
28366 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_route_hints(const struct LDKInvoice *NONNULL_PTR this_arg);
28369 * Returns the currency for which the invoice was issued
28371 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
28374 * Returns the amount if specified in the invoice as millisatoshis.
28376 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_milli_satoshis(const struct LDKInvoice *NONNULL_PTR this_arg);
28379 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
28380 * returns `CreationError::DescriptionTooLong` otherwise
28382 * Please note that single characters may use more than one byte due to UTF8 encoding.
28384 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
28387 * Returns the underlying description `String`
28389 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
28392 * Construct an `ExpiryTime` from seconds.
28394 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
28397 * Construct an `ExpiryTime` from a `Duration`.
28399 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
28402 * Returns the expiry time in seconds
28404 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
28407 * Returns a reference to the underlying `Duration` (=expiry time)
28409 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
28412 * Creates a new (partial) route from a list of hops
28414 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
28417 * Returns the underlying list of hops
28419 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
28422 * Creates a copy of the CreationError
28424 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
28427 * Utility method to constructs a new DescriptionTooLong-variant CreationError
28429 enum LDKCreationError CreationError_description_too_long(void);
28432 * Utility method to constructs a new RouteTooLong-variant CreationError
28434 enum LDKCreationError CreationError_route_too_long(void);
28437 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
28439 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
28442 * Utility method to constructs a new InvalidAmount-variant CreationError
28444 enum LDKCreationError CreationError_invalid_amount(void);
28447 * Utility method to constructs a new MissingRouteHints-variant CreationError
28449 enum LDKCreationError CreationError_missing_route_hints(void);
28452 * Checks if two CreationErrors contain equal inner contents.
28453 * This ignores pointers and is_owned flags and looks at the values in fields.
28455 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
28458 * Get the string representation of a CreationError object
28460 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
28463 * Creates a copy of the SemanticError
28465 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
28468 * Utility method to constructs a new NoPaymentHash-variant SemanticError
28470 enum LDKSemanticError SemanticError_no_payment_hash(void);
28473 * Utility method to constructs a new MultiplePaymentHashes-variant SemanticError
28475 enum LDKSemanticError SemanticError_multiple_payment_hashes(void);
28478 * Utility method to constructs a new NoDescription-variant SemanticError
28480 enum LDKSemanticError SemanticError_no_description(void);
28483 * Utility method to constructs a new MultipleDescriptions-variant SemanticError
28485 enum LDKSemanticError SemanticError_multiple_descriptions(void);
28488 * Utility method to constructs a new NoPaymentSecret-variant SemanticError
28490 enum LDKSemanticError SemanticError_no_payment_secret(void);
28493 * Utility method to constructs a new MultiplePaymentSecrets-variant SemanticError
28495 enum LDKSemanticError SemanticError_multiple_payment_secrets(void);
28498 * Utility method to constructs a new InvalidFeatures-variant SemanticError
28500 enum LDKSemanticError SemanticError_invalid_features(void);
28503 * Utility method to constructs a new InvalidRecoveryId-variant SemanticError
28505 enum LDKSemanticError SemanticError_invalid_recovery_id(void);
28508 * Utility method to constructs a new InvalidSignature-variant SemanticError
28510 enum LDKSemanticError SemanticError_invalid_signature(void);
28513 * Utility method to constructs a new ImpreciseAmount-variant SemanticError
28515 enum LDKSemanticError SemanticError_imprecise_amount(void);
28518 * Checks if two SemanticErrors contain equal inner contents.
28519 * This ignores pointers and is_owned flags and looks at the values in fields.
28521 bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
28524 * Get the string representation of a SemanticError object
28526 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
28529 * Frees any resources used by the SignOrCreationError
28531 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
28534 * Creates a copy of the SignOrCreationError
28536 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
28539 * Utility method to constructs a new SignError-variant SignOrCreationError
28541 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
28544 * Utility method to constructs a new CreationError-variant SignOrCreationError
28546 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
28549 * Checks if two SignOrCreationErrors contain equal inner contents.
28550 * This ignores pointers and is_owned flags and looks at the values in fields.
28552 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
28555 * Get the string representation of a SignOrCreationError object
28557 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
28560 * Frees any resources used by the InvoicePayer, if is_owned is set and inner is non-NULL.
28562 void InvoicePayer_free(struct LDKInvoicePayer this_obj);
28565 * Calls the free function if one is set
28567 void Payer_free(struct LDKPayer this_ptr);
28570 * Calls the free function if one is set
28572 void Router_free(struct LDKRouter this_ptr);
28575 * Frees any resources used by the Retry
28577 void Retry_free(struct LDKRetry this_ptr);
28580 * Creates a copy of the Retry
28582 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
28585 * Utility method to constructs a new Attempts-variant Retry
28587 struct LDKRetry Retry_attempts(uintptr_t a);
28590 * Utility method to constructs a new Timeout-variant Retry
28592 struct LDKRetry Retry_timeout(uint64_t a);
28595 * Checks if two Retrys contain equal inner contents.
28596 * This ignores pointers and is_owned flags and looks at the values in fields.
28598 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
28601 * Checks if two Retrys contain equal inner contents.
28603 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
28606 * Frees any resources used by the PaymentError
28608 void PaymentError_free(struct LDKPaymentError this_ptr);
28611 * Creates a copy of the PaymentError
28613 struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
28616 * Utility method to constructs a new Invoice-variant PaymentError
28618 struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
28621 * Utility method to constructs a new Routing-variant PaymentError
28623 struct LDKPaymentError PaymentError_routing(struct LDKLightningError a);
28626 * Utility method to constructs a new Sending-variant PaymentError
28628 struct LDKPaymentError PaymentError_sending(struct LDKPaymentSendFailure a);
28631 * Creates an invoice payer that retries failed payment paths.
28633 * Will forward any [`Event::PaymentPathFailed`] events to the decorated `event_handler` once
28634 * `retry` has been exceeded for a given [`Invoice`].
28636 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);
28639 * Pays the given [`Invoice`], caching it for later use in case a retry is needed.
28641 * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
28642 * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
28645 MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice);
28648 * Pays the given zero-value [`Invoice`] using the given amount, caching it for later use in
28649 * case a retry is needed.
28651 * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
28652 * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
28655 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);
28658 * Pays `pubkey` an amount using the hash of the given preimage, caching it for later use in
28659 * case a retry is needed.
28661 * You should ensure that `payment_preimage` is unique and that its `payment_hash` has never
28662 * been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so for you.
28664 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);
28667 * Removes the payment cached by the given payment hash.
28669 * Should be called once a payment has failed or succeeded if not using [`InvoicePayer`] as an
28670 * [`EventHandler`]. Otherwise, calling this method is unnecessary.
28672 void InvoicePayer_remove_cached_payment(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
28675 * Constructs a new EventHandler which calls the relevant methods on this_arg.
28676 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
28678 struct LDKEventHandler InvoicePayer_as_EventHandler(const struct LDKInvoicePayer *NONNULL_PTR this_arg);
28681 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
28682 * See [`PhantomKeysManager`] for more information on phantom node payments.
28684 * `phantom_route_hints` parameter:
28685 * * Contains channel info for all nodes participating in the phantom invoice
28686 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
28687 * participating node
28688 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
28689 * updated when a channel becomes disabled or closes
28690 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
28691 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
28694 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
28695 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
28696 * If `None` is provided for `payment_hash`, then one will be created.
28698 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
28699 * in excess of the current time.
28701 * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom
28702 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
28705 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
28706 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
28707 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
28708 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
28709 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
28711 * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
28713 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);
28716 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
28717 * See [`PhantomKeysManager`] for more information on phantom node payments.
28719 * `phantom_route_hints` parameter:
28720 * * Contains channel info for all nodes participating in the phantom invoice
28721 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
28722 * participating node
28723 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
28724 * updated when a channel becomes disabled or closes
28725 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
28726 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
28729 * `description_hash` is a SHA-256 hash of the description text
28731 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
28732 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
28733 * If `None` is provided for `payment_hash`, then one will be created.
28735 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
28736 * in excess of the current time.
28738 * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom
28739 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
28742 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
28743 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
28744 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
28745 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
28746 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
28748 * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
28750 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);
28753 * Utility to construct an invoice. Generally, unless you want to do something like a custom
28754 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
28755 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
28756 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
28757 * that the payment secret is valid when the invoice is paid.
28759 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
28760 * in excess of the current time.
28762 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);
28765 * Utility to construct an invoice. Generally, unless you want to do something like a custom
28766 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
28767 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
28768 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
28769 * that the payment secret is valid when the invoice is paid.
28770 * Use this variant if you want to pass the `description_hash` to the invoice.
28772 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
28773 * in excess of the current time.
28775 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);
28778 * See [`create_invoice_from_channelmanager_with_description_hash`]
28779 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
28780 * available and the current time is supplied by the caller.
28782 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);
28785 * See [`create_invoice_from_channelmanager`]
28786 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
28787 * available and the current time is supplied by the caller.
28789 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);
28792 * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
28794 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
28797 * Creates a new router using the given [`NetworkGraph`], a [`Logger`], and a randomness source
28798 * `random_seed_bytes`.
28800 MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKThirtyTwoBytes random_seed_bytes);
28803 * Constructs a new Router which calls the relevant methods on this_arg.
28804 * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
28806 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
28809 * Constructs a new Payer which calls the relevant methods on this_arg.
28810 * This copies the `inner` pointer in this_arg and thus the returned Payer must be freed before this_arg is
28812 struct LDKPayer ChannelManager_as_Payer(const struct LDKChannelManager *NONNULL_PTR this_arg);
28815 * Read a SiPrefix object from a string
28817 struct LDKCResult_SiPrefixParseErrorZ SiPrefix_from_str(struct LDKStr s);
28820 * Read a Invoice object from a string
28822 struct LDKCResult_InvoiceParseOrSemanticErrorZ Invoice_from_str(struct LDKStr s);
28825 * Read a SignedRawInvoice object from a string
28827 struct LDKCResult_SignedRawInvoiceParseErrorZ SignedRawInvoice_from_str(struct LDKStr s);
28830 * Get the string representation of a ParseError object
28832 struct LDKStr ParseError_to_str(const struct LDKParseError *NONNULL_PTR o);
28835 * Get the string representation of a ParseOrSemanticError object
28837 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
28840 * Get the string representation of a Invoice object
28842 struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o);
28845 * Get the string representation of a SignedRawInvoice object
28847 struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o);
28850 * Get the string representation of a Currency object
28852 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
28855 * Get the string representation of a SiPrefix object
28857 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
28860 * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
28862 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
28865 * Instantiate a new [`RapidGossipSync`] instance
28867 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph);
28870 * Sync gossip data from a file
28871 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
28873 * `network_graph`: The network graph to apply the updates to
28875 * `sync_path`: Path to the file where the gossip update data is located
28878 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path);
28881 * Returns whether a rapid gossip sync has completed at least once
28883 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
28886 * Frees any resources used by the GraphSyncError
28888 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
28891 * Creates a copy of the GraphSyncError
28893 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
28896 * Utility method to constructs a new DecodeError-variant GraphSyncError
28898 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
28901 * Utility method to constructs a new LightningError-variant GraphSyncError
28903 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
28906 * Update network graph from binary data.
28907 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
28909 * `network_graph`: network graph to be updated
28911 * `update_data`: `&[u8]` binary stream that comprises the update data
28913 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
28915 #endif /* LDK_C_BINDINGS_H */
28917 #include "ldk_ver.h"