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;
1855 * A dynamically-allocated array of u64s of arbitrary size.
1856 * This corresponds to std::vector in C++
1858 typedef struct LDKCVec_u64Z {
1860 * The elements in the array.
1861 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1865 * The number of elements pointed to by `data`.
1873 * The recipient of a payment.
1875 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
1877 * A pointer to the opaque Rust object.
1878 * Nearly everywhere, inner must be non-null, however in places where
1879 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1881 LDKnativePaymentParameters *inner;
1883 * Indicates that this is the only struct which contains the same pointer.
1884 * Rust functions which take ownership of an object provided via an argument require
1885 * this to be true and invalidate the object pointed to by inner.
1888 } LDKPaymentParameters;
1891 * The contents of CResult_PaymentParametersDecodeErrorZ
1893 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
1895 * A pointer to the contents in the success state.
1896 * Reading from this pointer when `result_ok` is not set is undefined.
1898 struct LDKPaymentParameters *result;
1900 * A pointer to the contents in the error state.
1901 * Reading from this pointer when `result_ok` is set is undefined.
1903 struct LDKDecodeError *err;
1904 } LDKCResult_PaymentParametersDecodeErrorZPtr;
1907 * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
1908 * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1909 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1911 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
1913 * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
1914 * `err` or `result` depending on the state of `result_ok`.
1916 union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
1918 * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
1921 } LDKCResult_PaymentParametersDecodeErrorZ;
1926 * A channel descriptor for a hop along a payment path.
1928 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
1930 * A pointer to the opaque Rust object.
1931 * Nearly everywhere, inner must be non-null, however in places where
1932 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1934 LDKnativeRouteHintHop *inner;
1936 * Indicates that this is the only struct which contains the same pointer.
1937 * Rust functions which take ownership of an object provided via an argument require
1938 * this to be true and invalidate the object pointed to by inner.
1944 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
1945 * This corresponds to std::vector in C++
1947 typedef struct LDKCVec_RouteHintHopZ {
1949 * The elements in the array.
1950 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1952 struct LDKRouteHintHop *data;
1954 * The number of elements pointed to by `data`.
1957 } LDKCVec_RouteHintHopZ;
1960 * The contents of CResult_RouteHintDecodeErrorZ
1962 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
1964 * A pointer to the contents in the success state.
1965 * Reading from this pointer when `result_ok` is not set is undefined.
1967 struct LDKRouteHint *result;
1969 * A pointer to the contents in the error state.
1970 * Reading from this pointer when `result_ok` is set is undefined.
1972 struct LDKDecodeError *err;
1973 } LDKCResult_RouteHintDecodeErrorZPtr;
1976 * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
1977 * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
1978 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1980 typedef struct LDKCResult_RouteHintDecodeErrorZ {
1982 * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
1983 * `err` or `result` depending on the state of `result_ok`.
1985 union LDKCResult_RouteHintDecodeErrorZPtr contents;
1987 * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
1990 } LDKCResult_RouteHintDecodeErrorZ;
1993 * The contents of CResult_RouteHintHopDecodeErrorZ
1995 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
1997 * A pointer to the contents in the success state.
1998 * Reading from this pointer when `result_ok` is not set is undefined.
2000 struct LDKRouteHintHop *result;
2002 * A pointer to the contents in the error state.
2003 * Reading from this pointer when `result_ok` is set is undefined.
2005 struct LDKDecodeError *err;
2006 } LDKCResult_RouteHintHopDecodeErrorZPtr;
2009 * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
2010 * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
2011 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2013 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
2015 * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
2016 * `err` or `result` depending on the state of `result_ok`.
2018 union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
2020 * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
2023 } LDKCResult_RouteHintHopDecodeErrorZ;
2028 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
2030 typedef struct MUST_USE_STRUCT LDKChannelDetails {
2032 * A pointer to the opaque Rust object.
2033 * Nearly everywhere, inner must be non-null, however in places where
2034 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2036 LDKnativeChannelDetails *inner;
2038 * Indicates that this is the only struct which contains the same pointer.
2039 * Rust functions which take ownership of an object provided via an argument require
2040 * this to be true and invalidate the object pointed to by inner.
2043 } LDKChannelDetails;
2046 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
2047 * This corresponds to std::vector in C++
2049 typedef struct LDKCVec_ChannelDetailsZ {
2051 * The elements in the array.
2052 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2054 struct LDKChannelDetails *data;
2056 * The number of elements pointed to by `data`.
2059 } LDKCVec_ChannelDetailsZ;
2064 * An Err type for failure to process messages.
2066 typedef struct MUST_USE_STRUCT LDKLightningError {
2068 * A pointer to the opaque Rust object.
2069 * Nearly everywhere, inner must be non-null, however in places where
2070 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2072 LDKnativeLightningError *inner;
2074 * Indicates that this is the only struct which contains the same pointer.
2075 * Rust functions which take ownership of an object provided via an argument require
2076 * this to be true and invalidate the object pointed to by inner.
2079 } LDKLightningError;
2082 * The contents of CResult_RouteLightningErrorZ
2084 typedef union LDKCResult_RouteLightningErrorZPtr {
2086 * A pointer to the contents in the success state.
2087 * Reading from this pointer when `result_ok` is not set is undefined.
2089 struct LDKRoute *result;
2091 * A pointer to the contents in the error state.
2092 * Reading from this pointer when `result_ok` is set is undefined.
2094 struct LDKLightningError *err;
2095 } LDKCResult_RouteLightningErrorZPtr;
2098 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
2099 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
2100 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2102 typedef struct LDKCResult_RouteLightningErrorZ {
2104 * The contents of this CResult_RouteLightningErrorZ, accessible via either
2105 * `err` or `result` depending on the state of `result_ok`.
2107 union LDKCResult_RouteLightningErrorZPtr contents;
2109 * Whether this CResult_RouteLightningErrorZ represents a success state.
2112 } LDKCResult_RouteLightningErrorZ;
2115 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
2116 * This corresponds to std::vector in C++
2118 typedef struct LDKCVec_PublicKeyZ {
2120 * The elements in the array.
2121 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2123 struct LDKPublicKey *data;
2125 * The number of elements pointed to by `data`.
2128 } LDKCVec_PublicKeyZ;
2131 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
2132 * look up the corresponding function in rust-lightning's docs.
2134 typedef struct LDKThirtyTwoBytes {
2136 * The thirty-two bytes
2139 } LDKThirtyTwoBytes;
2142 * Some information provided on receipt of payment depends on whether the payment received is a
2143 * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
2145 typedef enum LDKPaymentPurpose_Tag {
2147 * Information for receiving a payment that we generated an invoice for.
2149 LDKPaymentPurpose_InvoicePayment,
2151 * Because this is a spontaneous payment, the payer generated their own preimage rather than us
2152 * (the payee) providing a preimage.
2154 LDKPaymentPurpose_SpontaneousPayment,
2156 * Must be last for serialization purposes
2158 LDKPaymentPurpose_Sentinel,
2159 } LDKPaymentPurpose_Tag;
2161 typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
2163 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
2164 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
2165 * [`ChannelManager::claim_funds`].
2167 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2168 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2170 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2172 struct LDKThirtyTwoBytes payment_preimage;
2174 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
2175 * number of deanonymization attacks during the routing process.
2176 * It is provided here for your reference, however its accuracy is enforced directly by
2177 * [`ChannelManager`] using the values you previously provided to
2178 * [`ChannelManager::create_inbound_payment`] or
2179 * [`ChannelManager::create_inbound_payment_for_hash`].
2181 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2182 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2183 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
2185 struct LDKThirtyTwoBytes payment_secret;
2186 } LDKPaymentPurpose_LDKInvoicePayment_Body;
2188 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
2189 LDKPaymentPurpose_Tag tag;
2191 LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
2193 struct LDKThirtyTwoBytes spontaneous_payment;
2196 } LDKPaymentPurpose;
2199 * The contents of CResult_PaymentPurposeDecodeErrorZ
2201 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
2203 * A pointer to the contents in the success state.
2204 * Reading from this pointer when `result_ok` is not set is undefined.
2206 struct LDKPaymentPurpose *result;
2208 * A pointer to the contents in the error state.
2209 * Reading from this pointer when `result_ok` is set is undefined.
2211 struct LDKDecodeError *err;
2212 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
2215 * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
2216 * containing a crate::lightning::util::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
2217 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2219 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
2221 * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
2222 * `err` or `result` depending on the state of `result_ok`.
2224 union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
2226 * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
2229 } LDKCResult_PaymentPurposeDecodeErrorZ;
2232 * The reason the channel was closed. See individual variants more details.
2234 typedef enum LDKClosureReason_Tag {
2236 * Closure generated from receiving a peer error message.
2238 * Our counterparty may have broadcasted their latest commitment state, and we have
2241 LDKClosureReason_CounterpartyForceClosed,
2243 * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
2245 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
2247 LDKClosureReason_HolderForceClosed,
2249 * The channel was closed after negotiating a cooperative close and we've now broadcasted
2250 * the cooperative close transaction. Note the shutdown may have been initiated by us.
2252 LDKClosureReason_CooperativeClosure,
2254 * A commitment transaction was confirmed on chain, closing the channel. Most likely this
2255 * commitment transaction came from our counterparty, but it may also have come from
2256 * a copy of our own `ChannelMonitor`.
2258 LDKClosureReason_CommitmentTxConfirmed,
2260 * The funding transaction failed to confirm in a timely manner on an inbound channel.
2262 LDKClosureReason_FundingTimedOut,
2264 * Closure generated from processing an event, likely a HTLC forward/relay/reception.
2266 LDKClosureReason_ProcessingError,
2268 * The peer disconnected prior to funding completing. In this case the spec mandates that we
2269 * forget the channel entirely - we can attempt again if the peer reconnects.
2271 * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
2272 * peer because of mutual incompatibility between us and our channel counterparty.
2274 LDKClosureReason_DisconnectedPeer,
2276 * Closure generated from `ChannelManager::read` if the ChannelMonitor is newer than
2277 * the ChannelManager deserialized.
2279 LDKClosureReason_OutdatedChannelManager,
2281 * Must be last for serialization purposes
2283 LDKClosureReason_Sentinel,
2284 } LDKClosureReason_Tag;
2286 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
2288 * The error which the peer sent us.
2290 * The string should be sanitized before it is used (e.g emitted to logs
2291 * or printed to stdout). Otherwise, a well crafted error message may exploit
2292 * a security vulnerability in the terminal emulator or the logging subsystem.
2294 struct LDKStr peer_msg;
2295 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
2297 typedef struct LDKClosureReason_LDKProcessingError_Body {
2299 * A developer-readable error message which we generated.
2302 } LDKClosureReason_LDKProcessingError_Body;
2304 typedef struct MUST_USE_STRUCT LDKClosureReason {
2305 LDKClosureReason_Tag tag;
2307 LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
2308 LDKClosureReason_LDKProcessingError_Body processing_error;
2313 * An enum which can either contain a crate::lightning::util::events::ClosureReason or not
2315 typedef enum LDKCOption_ClosureReasonZ_Tag {
2317 * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::util::events::ClosureReason
2319 LDKCOption_ClosureReasonZ_Some,
2321 * When we're in this state, this COption_ClosureReasonZ contains nothing
2323 LDKCOption_ClosureReasonZ_None,
2325 * Must be last for serialization purposes
2327 LDKCOption_ClosureReasonZ_Sentinel,
2328 } LDKCOption_ClosureReasonZ_Tag;
2330 typedef struct LDKCOption_ClosureReasonZ {
2331 LDKCOption_ClosureReasonZ_Tag tag;
2334 struct LDKClosureReason some;
2337 } LDKCOption_ClosureReasonZ;
2340 * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
2342 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
2344 * A pointer to the contents in the success state.
2345 * Reading from this pointer when `result_ok` is not set is undefined.
2347 struct LDKCOption_ClosureReasonZ *result;
2349 * A pointer to the contents in the error state.
2350 * Reading from this pointer when `result_ok` is set is undefined.
2352 struct LDKDecodeError *err;
2353 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
2356 * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
2357 * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
2358 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2360 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
2362 * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
2363 * `err` or `result` depending on the state of `result_ok`.
2365 union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
2367 * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
2370 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
2373 * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
2375 typedef enum LDKHTLCDestination_Tag {
2377 * We tried forwarding to a channel but failed to do so. An example of such an instance is when
2378 * there is insufficient capacity in our outbound channel.
2380 LDKHTLCDestination_NextHopChannel,
2382 * Scenario where we are unsure of the next node to forward the HTLC to.
2384 LDKHTLCDestination_UnknownNextHop,
2386 * Failure scenario where an HTLC may have been forwarded to be intended for us,
2387 * but is invalid for some reason, so we reject it.
2389 * Some of the reasons may include:
2391 * * Expected MPP amount to claim does not equal HTLC total
2392 * * Claimable amount does not match expected amount
2394 LDKHTLCDestination_FailedPayment,
2396 * Must be last for serialization purposes
2398 LDKHTLCDestination_Sentinel,
2399 } LDKHTLCDestination_Tag;
2401 typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
2403 * The `node_id` of the next node. For backwards compatibility, this field is
2404 * marked as optional, versions prior to 0.0.110 may not always be able to provide
2405 * counterparty node information.
2407 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2409 struct LDKPublicKey node_id;
2411 * The outgoing `channel_id` between us and the next node.
2413 struct LDKThirtyTwoBytes channel_id;
2414 } LDKHTLCDestination_LDKNextHopChannel_Body;
2416 typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
2418 * Short channel id we are requesting to forward an HTLC to.
2420 uint64_t requested_forward_scid;
2421 } LDKHTLCDestination_LDKUnknownNextHop_Body;
2423 typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
2425 * The payment hash of the payment we attempted to process.
2427 struct LDKThirtyTwoBytes payment_hash;
2428 } LDKHTLCDestination_LDKFailedPayment_Body;
2430 typedef struct MUST_USE_STRUCT LDKHTLCDestination {
2431 LDKHTLCDestination_Tag tag;
2433 LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
2434 LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
2435 LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
2437 } LDKHTLCDestination;
2440 * An enum which can either contain a crate::lightning::util::events::HTLCDestination or not
2442 typedef enum LDKCOption_HTLCDestinationZ_Tag {
2444 * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::util::events::HTLCDestination
2446 LDKCOption_HTLCDestinationZ_Some,
2448 * When we're in this state, this COption_HTLCDestinationZ contains nothing
2450 LDKCOption_HTLCDestinationZ_None,
2452 * Must be last for serialization purposes
2454 LDKCOption_HTLCDestinationZ_Sentinel,
2455 } LDKCOption_HTLCDestinationZ_Tag;
2457 typedef struct LDKCOption_HTLCDestinationZ {
2458 LDKCOption_HTLCDestinationZ_Tag tag;
2461 struct LDKHTLCDestination some;
2464 } LDKCOption_HTLCDestinationZ;
2467 * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
2469 typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
2471 * A pointer to the contents in the success state.
2472 * Reading from this pointer when `result_ok` is not set is undefined.
2474 struct LDKCOption_HTLCDestinationZ *result;
2476 * A pointer to the contents in the error state.
2477 * Reading from this pointer when `result_ok` is set is undefined.
2479 struct LDKDecodeError *err;
2480 } LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
2483 * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
2484 * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
2485 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2487 typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
2489 * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
2490 * `err` or `result` depending on the state of `result_ok`.
2492 union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
2494 * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
2497 } LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
2502 * A channel_update message to be sent or received from a peer
2504 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
2506 * A pointer to the opaque Rust object.
2507 * Nearly everywhere, inner must be non-null, however in places where
2508 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2510 LDKnativeChannelUpdate *inner;
2512 * Indicates that this is the only struct which contains the same pointer.
2513 * Rust functions which take ownership of an object provided via an argument require
2514 * this to be true and invalidate the object pointed to by inner.
2520 * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
2521 * return packet by a node along the route. See [BOLT #4] for details.
2523 * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
2525 typedef enum LDKNetworkUpdate_Tag {
2527 * An error indicating a `channel_update` messages should be applied via
2528 * [`NetworkGraph::update_channel`].
2530 LDKNetworkUpdate_ChannelUpdateMessage,
2532 * An error indicating that a channel failed to route a payment, which should be applied via
2533 * [`NetworkGraph::channel_failed`].
2535 LDKNetworkUpdate_ChannelFailure,
2537 * An error indicating that a node failed to route a payment, which should be applied via
2538 * [`NetworkGraph::node_failed`].
2540 LDKNetworkUpdate_NodeFailure,
2542 * Must be last for serialization purposes
2544 LDKNetworkUpdate_Sentinel,
2545 } LDKNetworkUpdate_Tag;
2547 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
2549 * The update to apply via [`NetworkGraph::update_channel`].
2551 struct LDKChannelUpdate msg;
2552 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
2554 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
2556 * The short channel id of the closed channel.
2558 uint64_t short_channel_id;
2560 * Whether the channel should be permanently removed or temporarily disabled until a new
2561 * `channel_update` message is received.
2564 } LDKNetworkUpdate_LDKChannelFailure_Body;
2566 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
2568 * The node id of the failed node.
2570 struct LDKPublicKey node_id;
2572 * Whether the node should be permanently removed from consideration or can be restored
2573 * when a new `channel_update` message is received.
2576 } LDKNetworkUpdate_LDKNodeFailure_Body;
2578 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
2579 LDKNetworkUpdate_Tag tag;
2581 LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
2582 LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
2583 LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
2588 * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
2590 typedef enum LDKCOption_NetworkUpdateZ_Tag {
2592 * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
2594 LDKCOption_NetworkUpdateZ_Some,
2596 * When we're in this state, this COption_NetworkUpdateZ contains nothing
2598 LDKCOption_NetworkUpdateZ_None,
2600 * Must be last for serialization purposes
2602 LDKCOption_NetworkUpdateZ_Sentinel,
2603 } LDKCOption_NetworkUpdateZ_Tag;
2605 typedef struct LDKCOption_NetworkUpdateZ {
2606 LDKCOption_NetworkUpdateZ_Tag tag;
2609 struct LDKNetworkUpdate some;
2612 } LDKCOption_NetworkUpdateZ;
2617 * A reference to a transaction output.
2619 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
2620 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
2622 typedef struct MUST_USE_STRUCT LDKOutPoint {
2624 * A pointer to the opaque Rust object.
2625 * Nearly everywhere, inner must be non-null, however in places where
2626 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2628 LDKnativeOutPoint *inner;
2630 * Indicates that this is the only struct which contains the same pointer.
2631 * Rust functions which take ownership of an object provided via an argument require
2632 * this to be true and invalidate the object pointed to by inner.
2640 * Information about a spendable output to a P2WSH script. See
2641 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
2643 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
2645 * A pointer to the opaque Rust object.
2646 * Nearly everywhere, inner must be non-null, however in places where
2647 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2649 LDKnativeDelayedPaymentOutputDescriptor *inner;
2651 * Indicates that this is the only struct which contains the same pointer.
2652 * Rust functions which take ownership of an object provided via an argument require
2653 * this to be true and invalidate the object pointed to by inner.
2656 } LDKDelayedPaymentOutputDescriptor;
2661 * Information about a spendable output to our \"payment key\". See
2662 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
2664 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
2666 * A pointer to the opaque Rust object.
2667 * Nearly everywhere, inner must be non-null, however in places where
2668 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2670 LDKnativeStaticPaymentOutputDescriptor *inner;
2672 * Indicates that this is the only struct which contains the same pointer.
2673 * Rust functions which take ownership of an object provided via an argument require
2674 * this to be true and invalidate the object pointed to by inner.
2677 } LDKStaticPaymentOutputDescriptor;
2680 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
2681 * claim at any point in the future) an event is generated which you must track and be able to
2682 * spend on-chain. The information needed to do this is provided in this enum, including the
2683 * outpoint describing which txid and output index is available, the full output which exists at
2684 * that txid/index, and any keys or other information required to sign.
2686 typedef enum LDKSpendableOutputDescriptor_Tag {
2688 * An output to a script which was provided via KeysInterface directly, either from
2689 * `get_destination_script()` or `get_shutdown_scriptpubkey()`, thus you should already know
2690 * how to spend it. No secret keys are provided as rust-lightning was never given any key.
2691 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
2692 * on-chain using the payment preimage or after it has timed out.
2694 LDKSpendableOutputDescriptor_StaticOutput,
2696 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
2698 * The witness in the spending input should be:
2699 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
2701 * Note that the nSequence field in the spending input must be set to to_self_delay
2702 * (which means the transaction is not broadcastable until at least to_self_delay
2703 * blocks after the outpoint confirms).
2705 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
2706 * it is an output from an old state which we broadcast (which should never happen).
2708 * To derive the delayed_payment key which is used to sign for this input, you must pass the
2709 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
2710 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
2711 * chan_utils::derive_private_key. The public key can be generated without the secret key
2712 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
2715 * To derive the revocation_pubkey provided here (which is used in the witness
2716 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
2717 * call to Sign::ready_channel) and the provided per_commitment point
2718 * to chan_utils::derive_public_revocation_key.
2720 * The witness script which is hashed and included in the output script_pubkey may be
2721 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
2722 * (derived as above), and the to_self_delay contained here to
2723 * chan_utils::get_revokeable_redeemscript.
2725 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
2727 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
2728 * corresponds to the public key in Sign::pubkeys().payment_point).
2729 * The witness in the spending input, is, thus, simply:
2730 * <BIP 143 signature> <payment key>
2732 * These are generally the result of our counterparty having broadcast the current state,
2733 * allowing us to claim the non-HTLC-encumbered outputs immediately.
2735 LDKSpendableOutputDescriptor_StaticPaymentOutput,
2737 * Must be last for serialization purposes
2739 LDKSpendableOutputDescriptor_Sentinel,
2740 } LDKSpendableOutputDescriptor_Tag;
2742 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
2744 * The outpoint which is spendable
2746 struct LDKOutPoint outpoint;
2748 * The output which is referenced by the given outpoint.
2750 struct LDKTxOut output;
2751 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
2753 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
2754 LDKSpendableOutputDescriptor_Tag tag;
2756 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
2758 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
2761 struct LDKStaticPaymentOutputDescriptor static_payment_output;
2764 } LDKSpendableOutputDescriptor;
2767 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
2768 * This corresponds to std::vector in C++
2770 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2772 * The elements in the array.
2773 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2775 struct LDKSpendableOutputDescriptor *data;
2777 * The number of elements pointed to by `data`.
2780 } LDKCVec_SpendableOutputDescriptorZ;
2785 * Features used within the channel_type field in an OpenChannel message.
2787 * A channel is always of some known \"type\", describing the transaction formats used and the exact
2788 * semantics of our interaction with our peer.
2790 * Note that because a channel is a specific type which is proposed by the opener and accepted by
2791 * the counterparty, only required features are allowed here.
2793 * This is serialized differently from other feature types - it is not prefixed by a length, and
2794 * thus must only appear inside a TLV where its length is known in advance.
2796 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
2798 * A pointer to the opaque Rust object.
2799 * Nearly everywhere, inner must be non-null, however in places where
2800 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2802 LDKnativeChannelTypeFeatures *inner;
2804 * Indicates that this is the only struct which contains the same pointer.
2805 * Rust functions which take ownership of an object provided via an argument require
2806 * this to be true and invalidate the object pointed to by inner.
2809 } LDKChannelTypeFeatures;
2812 * An Event which you should probably take some action in response to.
2814 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
2815 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
2816 * written as it makes no sense to respond to it after reconnecting to peers).
2818 typedef enum LDKEvent_Tag {
2820 * Used to indicate that the client should generate a funding transaction with the given
2821 * parameters and then call [`ChannelManager::funding_transaction_generated`].
2822 * Generated in [`ChannelManager`] message handling.
2823 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
2824 * counterparty can steal your funds!
2826 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2827 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
2829 LDKEvent_FundingGenerationReady,
2831 * Indicates we've received (an offer of) money! Just gotta dig out that payment preimage and
2832 * feed it to [`ChannelManager::claim_funds`] to get it....
2834 * Note that if the preimage is not known, you should call
2835 * [`ChannelManager::fail_htlc_backwards`] to free up resources for this HTLC and avoid
2836 * network congestion.
2837 * If you fail to call either [`ChannelManager::claim_funds`] or
2838 * [`ChannelManager::fail_htlc_backwards`] within the HTLC's timeout, the HTLC will be
2839 * automatically failed.
2842 * LDK will not stop an inbound payment from being paid multiple times, so multiple
2843 * `PaymentReceived` events may be generated for the same payment.
2845 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2846 * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
2848 LDKEvent_PaymentReceived,
2850 * Indicates a payment has been claimed and we've received money!
2852 * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
2853 * to an [`Event::PaymentReceived`]. However, if we previously crashed during a
2854 * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
2855 * [`Event::PaymentReceived`] event.
2858 * LDK will not stop an inbound payment from being paid multiple times, so multiple
2859 * `PaymentReceived` events may be generated for the same payment. If you then call
2860 * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentReceived`] you may get
2861 * multiple `PaymentClaimed` events.
2863 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2865 LDKEvent_PaymentClaimed,
2867 * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
2868 * and we got back the payment preimage for it).
2870 * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
2871 * event. In this situation, you SHOULD treat this payment as having succeeded.
2873 LDKEvent_PaymentSent,
2875 * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
2876 * provide failure information for each MPP part in the payment.
2878 * This event is provided once there are no further pending HTLCs for the payment and the
2879 * payment is no longer retryable, either due to a several-block timeout or because
2880 * [`ChannelManager::abandon_payment`] was previously called for the corresponding payment.
2882 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
2884 LDKEvent_PaymentFailed,
2886 * Indicates that a path for an outbound payment was successful.
2888 * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
2889 * [`Event::PaymentSent`] for obtaining the payment preimage.
2891 LDKEvent_PaymentPathSuccessful,
2893 * Indicates an outbound HTLC we sent failed. Probably some intermediary node dropped
2894 * something. You may wish to retry with a different route.
2896 * Note that this does *not* indicate that all paths for an MPP payment have failed, see
2897 * [`Event::PaymentFailed`] and [`all_paths_failed`].
2899 * [`all_paths_failed`]: Self::PaymentPathFailed::all_paths_failed
2901 LDKEvent_PaymentPathFailed,
2903 * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
2905 LDKEvent_ProbeSuccessful,
2907 * Indicates that a probe payment we sent failed at an intermediary node on the path.
2909 LDKEvent_ProbeFailed,
2911 * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
2912 * a time in the future.
2914 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
2916 LDKEvent_PendingHTLCsForwardable,
2918 * Used to indicate that an output which you should know how to spend was confirmed on chain
2919 * and is now spendable.
2920 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
2921 * counterparty spending them due to some kind of timeout. Thus, you need to store them
2922 * somewhere and spend them when you create on-chain transactions.
2924 LDKEvent_SpendableOutputs,
2926 * This event is generated when a payment has been successfully forwarded through us and a
2927 * forwarding fee earned.
2929 LDKEvent_PaymentForwarded,
2931 * Used to indicate that a previously opened channel with the given `channel_id` is in the
2932 * process of closure.
2934 LDKEvent_ChannelClosed,
2936 * Used to indicate to the user that they can abandon the funding transaction and recycle the
2937 * inputs for another purpose.
2939 LDKEvent_DiscardFunding,
2941 * Indicates a request to open a new channel by a peer.
2943 * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the
2944 * request, call [`ChannelManager::force_close_without_broadcasting_txn`].
2946 * The event is only triggered when a new open channel request is received and the
2947 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
2949 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
2950 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
2951 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
2953 LDKEvent_OpenChannelRequest,
2955 * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
2958 * Some scenarios where this event may be sent include:
2959 * * Insufficient capacity in the outbound channel
2960 * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
2961 * * When an unknown SCID is requested for forwarding a payment.
2962 * * Claiming an amount for an MPP payment that exceeds the HTLC total
2963 * * The HTLC has timed out
2965 * This event, however, does not get generated if an HTLC fails to meet the forwarding
2966 * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
2968 LDKEvent_HTLCHandlingFailed,
2970 * Must be last for serialization purposes
2975 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
2977 * The random channel_id we picked which you'll need to pass into
2978 * [`ChannelManager::funding_transaction_generated`].
2980 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
2982 struct LDKThirtyTwoBytes temporary_channel_id;
2984 * The counterparty's node_id, which you'll need to pass back into
2985 * [`ChannelManager::funding_transaction_generated`].
2987 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
2989 struct LDKPublicKey counterparty_node_id;
2991 * The value, in satoshis, that the output should have.
2993 uint64_t channel_value_satoshis;
2995 * The script which should be used in the transaction output.
2997 struct LDKCVec_u8Z output_script;
2999 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or 0 for
3000 * an inbound channel.
3002 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
3004 uint64_t user_channel_id;
3005 } LDKEvent_LDKFundingGenerationReady_Body;
3007 typedef struct LDKEvent_LDKPaymentReceived_Body {
3009 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
3010 * not stop you from registering duplicate payment hashes for inbound payments.
3012 struct LDKThirtyTwoBytes payment_hash;
3014 * The value, in thousandths of a satoshi, that this payment is for.
3016 uint64_t amount_msat;
3018 * Information for claiming this received payment, based on whether the purpose of the
3019 * payment is to pay an invoice or to send a spontaneous payment.
3021 struct LDKPaymentPurpose purpose;
3022 } LDKEvent_LDKPaymentReceived_Body;
3024 typedef struct LDKEvent_LDKPaymentClaimed_Body {
3026 * The payment hash of the claimed payment. Note that LDK will not stop you from
3027 * registering duplicate payment hashes for inbound payments.
3029 struct LDKThirtyTwoBytes payment_hash;
3031 * The value, in thousandths of a satoshi, that this payment is for.
3033 uint64_t amount_msat;
3035 * The purpose of this claimed payment, i.e. whether the payment was for an invoice or a
3036 * spontaneous payment.
3038 struct LDKPaymentPurpose purpose;
3039 } LDKEvent_LDKPaymentClaimed_Body;
3041 typedef struct LDKEvent_LDKPaymentSent_Body {
3043 * The id returned by [`ChannelManager::send_payment`] and used with
3044 * [`ChannelManager::retry_payment`].
3046 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3047 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3049 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3051 struct LDKThirtyTwoBytes payment_id;
3053 * The preimage to the hash given to ChannelManager::send_payment.
3054 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
3057 struct LDKThirtyTwoBytes payment_preimage;
3059 * The hash that was given to [`ChannelManager::send_payment`].
3061 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3063 struct LDKThirtyTwoBytes payment_hash;
3065 * The total fee which was spent at intermediate hops in this payment, across all paths.
3067 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
3068 * overpayment to the recipient node.
3070 * If the recipient or an intermediate node misbehaves and gives us free money, this may
3071 * overstate the amount paid, though this is unlikely.
3073 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
3075 struct LDKCOption_u64Z fee_paid_msat;
3076 } LDKEvent_LDKPaymentSent_Body;
3078 typedef struct LDKEvent_LDKPaymentFailed_Body {
3080 * The id returned by [`ChannelManager::send_payment`] and used with
3081 * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
3083 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3084 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3085 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3087 struct LDKThirtyTwoBytes payment_id;
3089 * The hash that was given to [`ChannelManager::send_payment`].
3091 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3093 struct LDKThirtyTwoBytes payment_hash;
3094 } LDKEvent_LDKPaymentFailed_Body;
3096 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
3098 * The id returned by [`ChannelManager::send_payment`] and used with
3099 * [`ChannelManager::retry_payment`].
3101 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3102 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3104 struct LDKThirtyTwoBytes payment_id;
3106 * The hash that was given to [`ChannelManager::send_payment`].
3108 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3110 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3112 struct LDKThirtyTwoBytes payment_hash;
3114 * The payment path that was successful.
3116 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
3118 struct LDKCVec_RouteHopZ path;
3119 } LDKEvent_LDKPaymentPathSuccessful_Body;
3121 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
3123 * The id returned by [`ChannelManager::send_payment`] and used with
3124 * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
3126 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3127 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3128 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3130 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3132 struct LDKThirtyTwoBytes payment_id;
3134 * The hash that was given to [`ChannelManager::send_payment`].
3136 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3138 struct LDKThirtyTwoBytes payment_hash;
3140 * Indicates the payment was rejected for some reason by the recipient. This implies that
3141 * the payment has failed, not just the route in question. If this is not set, you may
3142 * retry the payment via a different route.
3144 bool rejected_by_dest;
3146 * Any failure information conveyed via the Onion return packet by a node along the failed
3149 * Should be applied to the [`NetworkGraph`] so that routing decisions can take into
3150 * account the update.
3152 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
3154 struct LDKCOption_NetworkUpdateZ network_update;
3156 * For both single-path and multi-path payments, this is set if all paths of the payment have
3157 * failed. This will be set to false if (1) this is an MPP payment and (2) other parts of the
3158 * larger MPP payment were still in flight when this event was generated.
3160 * Note that if you are retrying individual MPP parts, using this value to determine if a
3161 * payment has fully failed is race-y. Because multiple failures can happen prior to events
3162 * being processed, you may retry in response to a first failure, with a second failure
3163 * (with `all_paths_failed` set) still pending. Then, when the second failure is processed
3164 * you will see `all_paths_failed` set even though the retry of the first failure still
3165 * has an associated in-flight HTLC. See (1) for an example of such a failure.
3167 * If you wish to retry individual MPP parts and learn when a payment has failed, you must
3168 * call [`ChannelManager::abandon_payment`] and wait for a [`Event::PaymentFailed`] event.
3170 * (1) <https://github.com/lightningdevkit/rust-lightning/issues/1164>
3172 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3174 bool all_paths_failed;
3176 * The payment path that failed.
3178 struct LDKCVec_RouteHopZ path;
3180 * The channel responsible for the failed payment path.
3182 * Note that for route hints or for the first hop in a path this may be an SCID alias and
3183 * may not refer to a channel in the public network graph. These aliases may also collide
3184 * with channels in the public network graph.
3186 * If this is `Some`, then the corresponding channel should be avoided when the payment is
3187 * retried. May be `None` for older [`Event`] serializations.
3189 struct LDKCOption_u64Z short_channel_id;
3191 * Parameters needed to compute a new [`Route`] when retrying the failed payment path.
3193 * See [`find_route`] for details.
3195 * [`Route`]: crate::routing::router::Route
3196 * [`find_route`]: crate::routing::router::find_route
3198 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3200 struct LDKRouteParameters retry;
3201 } LDKEvent_LDKPaymentPathFailed_Body;
3203 typedef struct LDKEvent_LDKProbeSuccessful_Body {
3205 * The id returned by [`ChannelManager::send_probe`].
3207 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
3209 struct LDKThirtyTwoBytes payment_id;
3211 * The hash generated by [`ChannelManager::send_probe`].
3213 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
3215 struct LDKThirtyTwoBytes payment_hash;
3217 * The payment path that was successful.
3219 struct LDKCVec_RouteHopZ path;
3220 } LDKEvent_LDKProbeSuccessful_Body;
3222 typedef struct LDKEvent_LDKProbeFailed_Body {
3224 * The id returned by [`ChannelManager::send_probe`].
3226 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
3228 struct LDKThirtyTwoBytes payment_id;
3230 * The hash generated by [`ChannelManager::send_probe`].
3232 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
3234 struct LDKThirtyTwoBytes payment_hash;
3236 * The payment path that failed.
3238 struct LDKCVec_RouteHopZ path;
3240 * The channel responsible for the failed probe.
3242 * Note that for route hints or for the first hop in a path this may be an SCID alias and
3243 * may not refer to a channel in the public network graph. These aliases may also collide
3244 * with channels in the public network graph.
3246 struct LDKCOption_u64Z short_channel_id;
3247 } LDKEvent_LDKProbeFailed_Body;
3249 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
3251 * The minimum amount of time that should be waited prior to calling
3252 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
3253 * you should wait a random amount of time in roughly the range (now + time_forwardable,
3254 * now + 5*time_forwardable).
3256 uint64_t time_forwardable;
3257 } LDKEvent_LDKPendingHTLCsForwardable_Body;
3259 typedef struct LDKEvent_LDKSpendableOutputs_Body {
3261 * The outputs which you should store as spendable by you.
3263 struct LDKCVec_SpendableOutputDescriptorZ outputs;
3264 } LDKEvent_LDKSpendableOutputs_Body;
3266 typedef struct LDKEvent_LDKPaymentForwarded_Body {
3268 * The incoming channel between the previous node and us. This is only `None` for events
3269 * generated or serialized by versions prior to 0.0.107.
3271 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3273 struct LDKThirtyTwoBytes prev_channel_id;
3275 * The outgoing channel between the next node and us. This is only `None` for events
3276 * generated or serialized by versions prior to 0.0.107.
3278 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3280 struct LDKThirtyTwoBytes next_channel_id;
3282 * The fee, in milli-satoshis, which was earned as a result of the payment.
3284 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
3285 * was pending, the amount the next hop claimed will have been rounded down to the nearest
3286 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
3287 * claimed the full value in millisatoshis from the source. In this case,
3288 * `claim_from_onchain_tx` will be set.
3290 * If the channel which sent us the payment has been force-closed, we will claim the funds
3291 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
3292 * fees which we will spend and will instead set this to `None`. It is possible duplicate
3293 * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
3296 struct LDKCOption_u64Z fee_earned_msat;
3298 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
3301 bool claim_from_onchain_tx;
3302 } LDKEvent_LDKPaymentForwarded_Body;
3304 typedef struct LDKEvent_LDKChannelClosed_Body {
3306 * The channel_id of the channel which has been closed. Note that on-chain transactions
3307 * resolving the channel are likely still awaiting confirmation.
3309 struct LDKThirtyTwoBytes channel_id;
3311 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
3312 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
3313 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
3314 * `user_channel_id` will be 0 for an inbound channel.
3315 * This will always be zero for objects serialized with LDK versions prior to 0.0.102.
3317 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
3318 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3319 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
3321 uint64_t user_channel_id;
3323 * The reason the channel was closed.
3325 struct LDKClosureReason reason;
3326 } LDKEvent_LDKChannelClosed_Body;
3328 typedef struct LDKEvent_LDKDiscardFunding_Body {
3330 * The channel_id of the channel which has been closed.
3332 struct LDKThirtyTwoBytes channel_id;
3334 * The full transaction received from the user
3336 struct LDKTransaction transaction;
3337 } LDKEvent_LDKDiscardFunding_Body;
3339 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
3341 * The temporary channel ID of the channel requested to be opened.
3343 * When responding to the request, the `temporary_channel_id` should be passed
3344 * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
3345 * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
3347 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3348 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
3350 struct LDKThirtyTwoBytes temporary_channel_id;
3352 * The node_id of the counterparty requesting to open the channel.
3354 * When responding to the request, the `counterparty_node_id` should be passed
3355 * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
3356 * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
3359 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3360 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
3362 struct LDKPublicKey counterparty_node_id;
3364 * The channel value of the requested channel.
3366 uint64_t funding_satoshis;
3368 * Our starting balance in the channel if the request is accepted, in milli-satoshi.
3372 * The features that this channel will operate with. If you reject the channel, a
3373 * well-behaved counterparty may automatically re-attempt the channel with a new set of
3376 * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
3377 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
3380 * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
3381 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
3382 * 0.0.107. Channels setting this type also need to get manually accepted via
3383 * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
3384 * or will be rejected otherwise.
3386 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3388 struct LDKChannelTypeFeatures channel_type;
3389 } LDKEvent_LDKOpenChannelRequest_Body;
3391 typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
3393 * The channel over which the HTLC was received.
3395 struct LDKThirtyTwoBytes prev_channel_id;
3397 * Destination of the HTLC that failed to be processed.
3399 struct LDKHTLCDestination failed_next_destination;
3400 } LDKEvent_LDKHTLCHandlingFailed_Body;
3402 typedef struct MUST_USE_STRUCT LDKEvent {
3405 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
3406 LDKEvent_LDKPaymentReceived_Body payment_received;
3407 LDKEvent_LDKPaymentClaimed_Body payment_claimed;
3408 LDKEvent_LDKPaymentSent_Body payment_sent;
3409 LDKEvent_LDKPaymentFailed_Body payment_failed;
3410 LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
3411 LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
3412 LDKEvent_LDKProbeSuccessful_Body probe_successful;
3413 LDKEvent_LDKProbeFailed_Body probe_failed;
3414 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
3415 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
3416 LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
3417 LDKEvent_LDKChannelClosed_Body channel_closed;
3418 LDKEvent_LDKDiscardFunding_Body discard_funding;
3419 LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
3420 LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
3425 * An enum which can either contain a crate::lightning::util::events::Event or not
3427 typedef enum LDKCOption_EventZ_Tag {
3429 * When we're in this state, this COption_EventZ contains a crate::lightning::util::events::Event
3431 LDKCOption_EventZ_Some,
3433 * When we're in this state, this COption_EventZ contains nothing
3435 LDKCOption_EventZ_None,
3437 * Must be last for serialization purposes
3439 LDKCOption_EventZ_Sentinel,
3440 } LDKCOption_EventZ_Tag;
3442 typedef struct LDKCOption_EventZ {
3443 LDKCOption_EventZ_Tag tag;
3446 struct LDKEvent some;
3449 } LDKCOption_EventZ;
3452 * The contents of CResult_COption_EventZDecodeErrorZ
3454 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
3456 * A pointer to the contents in the success state.
3457 * Reading from this pointer when `result_ok` is not set is undefined.
3459 struct LDKCOption_EventZ *result;
3461 * A pointer to the contents in the error state.
3462 * Reading from this pointer when `result_ok` is set is undefined.
3464 struct LDKDecodeError *err;
3465 } LDKCResult_COption_EventZDecodeErrorZPtr;
3468 * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
3469 * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
3470 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3472 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
3474 * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
3475 * `err` or `result` depending on the state of `result_ok`.
3477 union LDKCResult_COption_EventZDecodeErrorZPtr contents;
3479 * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
3482 } LDKCResult_COption_EventZDecodeErrorZ;
3487 * An accept_channel message to be sent or received from a peer
3489 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
3491 * A pointer to the opaque Rust object.
3492 * Nearly everywhere, inner must be non-null, however in places where
3493 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3495 LDKnativeAcceptChannel *inner;
3497 * Indicates that this is the only struct which contains the same pointer.
3498 * Rust functions which take ownership of an object provided via an argument require
3499 * this to be true and invalidate the object pointed to by inner.
3507 * An open_channel message to be sent or received from a peer
3509 typedef struct MUST_USE_STRUCT LDKOpenChannel {
3511 * A pointer to the opaque Rust object.
3512 * Nearly everywhere, inner must be non-null, however in places where
3513 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3515 LDKnativeOpenChannel *inner;
3517 * Indicates that this is the only struct which contains the same pointer.
3518 * Rust functions which take ownership of an object provided via an argument require
3519 * this to be true and invalidate the object pointed to by inner.
3527 * A funding_created message to be sent or received from a peer
3529 typedef struct MUST_USE_STRUCT LDKFundingCreated {
3531 * A pointer to the opaque Rust object.
3532 * Nearly everywhere, inner must be non-null, however in places where
3533 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3535 LDKnativeFundingCreated *inner;
3537 * Indicates that this is the only struct which contains the same pointer.
3538 * Rust functions which take ownership of an object provided via an argument require
3539 * this to be true and invalidate the object pointed to by inner.
3542 } LDKFundingCreated;
3547 * A funding_signed message to be sent or received from a peer
3549 typedef struct MUST_USE_STRUCT LDKFundingSigned {
3551 * A pointer to the opaque Rust object.
3552 * Nearly everywhere, inner must be non-null, however in places where
3553 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3555 LDKnativeFundingSigned *inner;
3557 * Indicates that this is the only struct which contains the same pointer.
3558 * Rust functions which take ownership of an object provided via an argument require
3559 * this to be true and invalidate the object pointed to by inner.
3567 * A channel_ready message to be sent or received from a peer
3569 typedef struct MUST_USE_STRUCT LDKChannelReady {
3571 * A pointer to the opaque Rust object.
3572 * Nearly everywhere, inner must be non-null, however in places where
3573 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3575 LDKnativeChannelReady *inner;
3577 * Indicates that this is the only struct which contains the same pointer.
3578 * Rust functions which take ownership of an object provided via an argument require
3579 * this to be true and invalidate the object pointed to by inner.
3587 * An announcement_signatures message to be sent or received from a peer
3589 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
3591 * A pointer to the opaque Rust object.
3592 * Nearly everywhere, inner must be non-null, however in places where
3593 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3595 LDKnativeAnnouncementSignatures *inner;
3597 * Indicates that this is the only struct which contains the same pointer.
3598 * Rust functions which take ownership of an object provided via an argument require
3599 * this to be true and invalidate the object pointed to by inner.
3602 } LDKAnnouncementSignatures;
3607 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
3608 * transaction updates if they were pending.
3610 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
3612 * A pointer to the opaque Rust object.
3613 * Nearly everywhere, inner must be non-null, however in places where
3614 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3616 LDKnativeCommitmentUpdate *inner;
3618 * Indicates that this is the only struct which contains the same pointer.
3619 * Rust functions which take ownership of an object provided via an argument require
3620 * this to be true and invalidate the object pointed to by inner.
3623 } LDKCommitmentUpdate;
3628 * A revoke_and_ack message to be sent or received from a peer
3630 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
3632 * A pointer to the opaque Rust object.
3633 * Nearly everywhere, inner must be non-null, however in places where
3634 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3636 LDKnativeRevokeAndACK *inner;
3638 * Indicates that this is the only struct which contains the same pointer.
3639 * Rust functions which take ownership of an object provided via an argument require
3640 * this to be true and invalidate the object pointed to by inner.
3648 * A closing_signed message to be sent or received from a peer
3650 typedef struct MUST_USE_STRUCT LDKClosingSigned {
3652 * A pointer to the opaque Rust object.
3653 * Nearly everywhere, inner must be non-null, however in places where
3654 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3656 LDKnativeClosingSigned *inner;
3658 * Indicates that this is the only struct which contains the same pointer.
3659 * Rust functions which take ownership of an object provided via an argument require
3660 * this to be true and invalidate the object pointed to by inner.
3668 * A shutdown message to be sent or received from a peer
3670 typedef struct MUST_USE_STRUCT LDKShutdown {
3672 * A pointer to the opaque Rust object.
3673 * Nearly everywhere, inner must be non-null, however in places where
3674 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3676 LDKnativeShutdown *inner;
3678 * Indicates that this is the only struct which contains the same pointer.
3679 * Rust functions which take ownership of an object provided via an argument require
3680 * this to be true and invalidate the object pointed to by inner.
3688 * A channel_reestablish message to be sent or received from a peer
3690 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
3692 * A pointer to the opaque Rust object.
3693 * Nearly everywhere, inner must be non-null, however in places where
3694 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3696 LDKnativeChannelReestablish *inner;
3698 * Indicates that this is the only struct which contains the same pointer.
3699 * Rust functions which take ownership of an object provided via an argument require
3700 * this to be true and invalidate the object pointed to by inner.
3703 } LDKChannelReestablish;
3708 * A channel_announcement message to be sent or received from a peer
3710 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
3712 * A pointer to the opaque Rust object.
3713 * Nearly everywhere, inner must be non-null, however in places where
3714 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3716 LDKnativeChannelAnnouncement *inner;
3718 * Indicates that this is the only struct which contains the same pointer.
3719 * Rust functions which take ownership of an object provided via an argument require
3720 * this to be true and invalidate the object pointed to by inner.
3723 } LDKChannelAnnouncement;
3728 * A node_announcement message to be sent or received from a peer
3730 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
3732 * A pointer to the opaque Rust object.
3733 * Nearly everywhere, inner must be non-null, however in places where
3734 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3736 LDKnativeNodeAnnouncement *inner;
3738 * Indicates that this is the only struct which contains the same pointer.
3739 * Rust functions which take ownership of an object provided via an argument require
3740 * this to be true and invalidate the object pointed to by inner.
3743 } LDKNodeAnnouncement;
3748 * An error message to be sent or received from a peer
3750 typedef struct MUST_USE_STRUCT LDKErrorMessage {
3752 * A pointer to the opaque Rust object.
3753 * Nearly everywhere, inner must be non-null, however in places where
3754 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3756 LDKnativeErrorMessage *inner;
3758 * Indicates that this is the only struct which contains the same pointer.
3759 * Rust functions which take ownership of an object provided via an argument require
3760 * this to be true and invalidate the object pointed to by inner.
3768 * A warning message to be sent or received from a peer
3770 typedef struct MUST_USE_STRUCT LDKWarningMessage {
3772 * A pointer to the opaque Rust object.
3773 * Nearly everywhere, inner must be non-null, however in places where
3774 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3776 LDKnativeWarningMessage *inner;
3778 * Indicates that this is the only struct which contains the same pointer.
3779 * Rust functions which take ownership of an object provided via an argument require
3780 * this to be true and invalidate the object pointed to by inner.
3783 } LDKWarningMessage;
3786 * Used to put an error message in a LightningError
3788 typedef enum LDKErrorAction_Tag {
3790 * The peer took some action which made us think they were useless. Disconnect them.
3792 LDKErrorAction_DisconnectPeer,
3794 * The peer did something harmless that we weren't able to process, just log and ignore
3796 LDKErrorAction_IgnoreError,
3798 * The peer did something harmless that we weren't able to meaningfully process.
3799 * If the error is logged, log it at the given level.
3801 LDKErrorAction_IgnoreAndLog,
3803 * The peer provided us with a gossip message which we'd already seen. In most cases this
3804 * should be ignored, but it may result in the message being forwarded if it is a duplicate of
3805 * our own channel announcements.
3807 LDKErrorAction_IgnoreDuplicateGossip,
3809 * The peer did something incorrect. Tell them.
3811 LDKErrorAction_SendErrorMessage,
3813 * The peer did something incorrect. Tell them without closing any channels.
3815 LDKErrorAction_SendWarningMessage,
3817 * Must be last for serialization purposes
3819 LDKErrorAction_Sentinel,
3820 } LDKErrorAction_Tag;
3822 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
3824 * An error message which we should make an effort to send before we disconnect.
3826 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3828 struct LDKErrorMessage msg;
3829 } LDKErrorAction_LDKDisconnectPeer_Body;
3831 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
3833 * The message to send.
3835 struct LDKErrorMessage msg;
3836 } LDKErrorAction_LDKSendErrorMessage_Body;
3838 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
3840 * The message to send.
3842 struct LDKWarningMessage msg;
3844 * The peer may have done something harmless that we weren't able to meaningfully process,
3845 * though we should still tell them about it.
3846 * If this event is logged, log it at the given level.
3848 enum LDKLevel log_level;
3849 } LDKErrorAction_LDKSendWarningMessage_Body;
3851 typedef struct MUST_USE_STRUCT LDKErrorAction {
3852 LDKErrorAction_Tag tag;
3854 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
3856 enum LDKLevel ignore_and_log;
3858 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
3859 LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
3866 * A query_channel_range message is used to query a peer for channel
3867 * UTXOs in a range of blocks. The recipient of a query makes a best
3868 * effort to reply to the query using one or more reply_channel_range
3871 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
3873 * A pointer to the opaque Rust object.
3874 * Nearly everywhere, inner must be non-null, however in places where
3875 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3877 LDKnativeQueryChannelRange *inner;
3879 * Indicates that this is the only struct which contains the same pointer.
3880 * Rust functions which take ownership of an object provided via an argument require
3881 * this to be true and invalidate the object pointed to by inner.
3884 } LDKQueryChannelRange;
3889 * A query_short_channel_ids message is used to query a peer for
3890 * routing gossip messages related to one or more short_channel_ids.
3891 * The query recipient will reply with the latest, if available,
3892 * channel_announcement, channel_update and node_announcement messages
3893 * it maintains for the requested short_channel_ids followed by a
3894 * reply_short_channel_ids_end message. The short_channel_ids sent in
3895 * this query are encoded. We only support encoding_type=0 uncompressed
3896 * serialization and do not support encoding_type=1 zlib serialization.
3898 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
3900 * A pointer to the opaque Rust object.
3901 * Nearly everywhere, inner must be non-null, however in places where
3902 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3904 LDKnativeQueryShortChannelIds *inner;
3906 * Indicates that this is the only struct which contains the same pointer.
3907 * Rust functions which take ownership of an object provided via an argument require
3908 * this to be true and invalidate the object pointed to by inner.
3911 } LDKQueryShortChannelIds;
3916 * A reply_channel_range message is a reply to a query_channel_range
3917 * message. Multiple reply_channel_range messages can be sent in reply
3918 * to a single query_channel_range message. The query recipient makes a
3919 * best effort to respond based on their local network view which may
3920 * not be a perfect view of the network. The short_channel_ids in the
3921 * reply are encoded. We only support encoding_type=0 uncompressed
3922 * serialization and do not support encoding_type=1 zlib serialization.
3924 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
3926 * A pointer to the opaque Rust object.
3927 * Nearly everywhere, inner must be non-null, however in places where
3928 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3930 LDKnativeReplyChannelRange *inner;
3932 * Indicates that this is the only struct which contains the same pointer.
3933 * Rust functions which take ownership of an object provided via an argument require
3934 * this to be true and invalidate the object pointed to by inner.
3937 } LDKReplyChannelRange;
3942 * A gossip_timestamp_filter message is used by a node to request
3943 * gossip relay for messages in the requested time range when the
3944 * gossip_queries feature has been negotiated.
3946 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
3948 * A pointer to the opaque Rust object.
3949 * Nearly everywhere, inner must be non-null, however in places where
3950 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3952 LDKnativeGossipTimestampFilter *inner;
3954 * Indicates that this is the only struct which contains the same pointer.
3955 * Rust functions which take ownership of an object provided via an argument require
3956 * this to be true and invalidate the object pointed to by inner.
3959 } LDKGossipTimestampFilter;
3962 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
3963 * broadcast to most peers).
3964 * These events are handled by PeerManager::process_events if you are using a PeerManager.
3966 typedef enum LDKMessageSendEvent_Tag {
3968 * Used to indicate that we've accepted a channel open and should send the accept_channel
3969 * message provided to the given peer.
3971 LDKMessageSendEvent_SendAcceptChannel,
3973 * Used to indicate that we've initiated a channel open and should send the open_channel
3974 * message provided to the given peer.
3976 LDKMessageSendEvent_SendOpenChannel,
3978 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
3980 LDKMessageSendEvent_SendFundingCreated,
3982 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
3984 LDKMessageSendEvent_SendFundingSigned,
3986 * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
3988 LDKMessageSendEvent_SendChannelReady,
3990 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
3992 LDKMessageSendEvent_SendAnnouncementSignatures,
3994 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
3995 * message should be sent to the peer with the given node_id.
3997 LDKMessageSendEvent_UpdateHTLCs,
3999 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
4001 LDKMessageSendEvent_SendRevokeAndACK,
4003 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
4005 LDKMessageSendEvent_SendClosingSigned,
4007 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
4009 LDKMessageSendEvent_SendShutdown,
4011 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
4013 LDKMessageSendEvent_SendChannelReestablish,
4015 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
4016 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
4018 * Note that after doing so, you very likely (unless you did so very recently) want to call
4019 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
4020 * This ensures that any nodes which see our channel_announcement also have a relevant
4021 * node_announcement, including relevant feature flags which may be important for routing
4024 LDKMessageSendEvent_BroadcastChannelAnnouncement,
4026 * Used to indicate that a node_announcement should be broadcast to all peers.
4028 LDKMessageSendEvent_BroadcastNodeAnnouncement,
4030 * Used to indicate that a channel_update should be broadcast to all peers.
4032 LDKMessageSendEvent_BroadcastChannelUpdate,
4034 * Used to indicate that a channel_update should be sent to a single peer.
4035 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
4036 * private channel and we shouldn't be informing all of our peers of channel parameters.
4038 LDKMessageSendEvent_SendChannelUpdate,
4040 * Broadcast an error downstream to be handled
4042 LDKMessageSendEvent_HandleError,
4044 * Query a peer for channels with funding transaction UTXOs in a block range.
4046 LDKMessageSendEvent_SendChannelRangeQuery,
4048 * Request routing gossip messages from a peer for a list of channels identified by
4049 * their short_channel_ids.
4051 LDKMessageSendEvent_SendShortIdsQuery,
4053 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
4054 * emitted during processing of the query.
4056 LDKMessageSendEvent_SendReplyChannelRange,
4058 * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
4059 * enable receiving gossip messages from the peer.
4061 LDKMessageSendEvent_SendGossipTimestampFilter,
4063 * Must be last for serialization purposes
4065 LDKMessageSendEvent_Sentinel,
4066 } LDKMessageSendEvent_Tag;
4068 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
4070 * The node_id of the node which should receive this message
4072 struct LDKPublicKey node_id;
4074 * The message which should be sent.
4076 struct LDKAcceptChannel msg;
4077 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
4079 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
4081 * The node_id of the node which should receive this message
4083 struct LDKPublicKey node_id;
4085 * The message which should be sent.
4087 struct LDKOpenChannel msg;
4088 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
4090 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
4092 * The node_id of the node which should receive this message
4094 struct LDKPublicKey node_id;
4096 * The message which should be sent.
4098 struct LDKFundingCreated msg;
4099 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
4101 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
4103 * The node_id of the node which should receive this message
4105 struct LDKPublicKey node_id;
4107 * The message which should be sent.
4109 struct LDKFundingSigned msg;
4110 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
4112 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
4114 * The node_id of the node which should receive these message(s)
4116 struct LDKPublicKey node_id;
4118 * The channel_ready message which should be sent.
4120 struct LDKChannelReady msg;
4121 } LDKMessageSendEvent_LDKSendChannelReady_Body;
4123 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
4125 * The node_id of the node which should receive these message(s)
4127 struct LDKPublicKey node_id;
4129 * The announcement_signatures message which should be sent.
4131 struct LDKAnnouncementSignatures msg;
4132 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
4134 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
4136 * The node_id of the node which should receive these message(s)
4138 struct LDKPublicKey node_id;
4140 * The update messages which should be sent. ALL messages in the struct should be sent!
4142 struct LDKCommitmentUpdate updates;
4143 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
4145 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
4147 * The node_id of the node which should receive this message
4149 struct LDKPublicKey node_id;
4151 * The message which should be sent.
4153 struct LDKRevokeAndACK msg;
4154 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
4156 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
4158 * The node_id of the node which should receive this message
4160 struct LDKPublicKey node_id;
4162 * The message which should be sent.
4164 struct LDKClosingSigned msg;
4165 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
4167 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
4169 * The node_id of the node which should receive this message
4171 struct LDKPublicKey node_id;
4173 * The message which should be sent.
4175 struct LDKShutdown msg;
4176 } LDKMessageSendEvent_LDKSendShutdown_Body;
4178 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
4180 * The node_id of the node which should receive this message
4182 struct LDKPublicKey node_id;
4184 * The message which should be sent.
4186 struct LDKChannelReestablish msg;
4187 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
4189 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
4191 * The channel_announcement which should be sent.
4193 struct LDKChannelAnnouncement msg;
4195 * The followup channel_update which should be sent.
4197 struct LDKChannelUpdate update_msg;
4198 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
4200 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
4202 * The node_announcement which should be sent.
4204 struct LDKNodeAnnouncement msg;
4205 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
4207 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
4209 * The channel_update which should be sent.
4211 struct LDKChannelUpdate msg;
4212 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
4214 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
4216 * The node_id of the node which should receive this message
4218 struct LDKPublicKey node_id;
4220 * The channel_update which should be sent.
4222 struct LDKChannelUpdate msg;
4223 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
4225 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
4227 * The node_id of the node which should receive this message
4229 struct LDKPublicKey node_id;
4231 * The action which should be taken.
4233 struct LDKErrorAction action;
4234 } LDKMessageSendEvent_LDKHandleError_Body;
4236 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
4238 * The node_id of this message recipient
4240 struct LDKPublicKey node_id;
4242 * The query_channel_range which should be sent.
4244 struct LDKQueryChannelRange msg;
4245 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
4247 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
4249 * The node_id of this message recipient
4251 struct LDKPublicKey node_id;
4253 * The query_short_channel_ids which should be sent.
4255 struct LDKQueryShortChannelIds msg;
4256 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
4258 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
4260 * The node_id of this message recipient
4262 struct LDKPublicKey node_id;
4264 * The reply_channel_range which should be sent.
4266 struct LDKReplyChannelRange msg;
4267 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
4269 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
4271 * The node_id of this message recipient
4273 struct LDKPublicKey node_id;
4275 * The gossip_timestamp_filter which should be sent.
4277 struct LDKGossipTimestampFilter msg;
4278 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
4280 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
4281 LDKMessageSendEvent_Tag tag;
4283 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
4284 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
4285 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
4286 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
4287 LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
4288 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
4289 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
4290 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
4291 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
4292 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
4293 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
4294 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
4295 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
4296 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
4297 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
4298 LDKMessageSendEvent_LDKHandleError_Body handle_error;
4299 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
4300 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
4301 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
4302 LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
4304 } LDKMessageSendEvent;
4307 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
4308 * This corresponds to std::vector in C++
4310 typedef struct LDKCVec_MessageSendEventZ {
4312 * The elements in the array.
4313 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4315 struct LDKMessageSendEvent *data;
4317 * The number of elements pointed to by `data`.
4320 } LDKCVec_MessageSendEventZ;
4323 * The contents of CResult_TxOutAccessErrorZ
4325 typedef union LDKCResult_TxOutAccessErrorZPtr {
4327 * A pointer to the contents in the success state.
4328 * Reading from this pointer when `result_ok` is not set is undefined.
4330 struct LDKTxOut *result;
4332 * A pointer to the contents in the error state.
4333 * Reading from this pointer when `result_ok` is set is undefined.
4335 enum LDKAccessError *err;
4336 } LDKCResult_TxOutAccessErrorZPtr;
4339 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
4340 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
4341 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4343 typedef struct LDKCResult_TxOutAccessErrorZ {
4345 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
4346 * `err` or `result` depending on the state of `result_ok`.
4348 union LDKCResult_TxOutAccessErrorZPtr contents;
4350 * Whether this CResult_TxOutAccessErrorZ represents a success state.
4353 } LDKCResult_TxOutAccessErrorZ;
4356 * A tuple of 2 elements. See the individual fields for the types contained.
4358 typedef struct LDKC2Tuple_usizeTransactionZ {
4360 * The element at position 0
4364 * The element at position 1
4366 struct LDKTransaction b;
4367 } LDKC2Tuple_usizeTransactionZ;
4370 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
4371 * This corresponds to std::vector in C++
4373 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
4375 * The elements in the array.
4376 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4378 struct LDKC2Tuple_usizeTransactionZ *data;
4380 * The number of elements pointed to by `data`.
4383 } LDKCVec_C2Tuple_usizeTransactionZZ;
4386 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
4387 * This corresponds to std::vector in C++
4389 typedef struct LDKCVec_TxidZ {
4391 * The elements in the array.
4392 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4394 struct LDKThirtyTwoBytes *data;
4396 * The number of elements pointed to by `data`.
4402 * The contents of CResult_NoneChannelMonitorUpdateErrZ
4404 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
4406 * Note that this value is always NULL, as there are no contents in the OK variant
4410 * A pointer to the contents in the error state.
4411 * Reading from this pointer when `result_ok` is set is undefined.
4413 enum LDKChannelMonitorUpdateErr *err;
4414 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
4417 * A CResult_NoneChannelMonitorUpdateErrZ represents the result of a fallible operation,
4418 * containing a () on success and a crate::lightning::chain::ChannelMonitorUpdateErr on failure.
4419 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4421 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
4423 * The contents of this CResult_NoneChannelMonitorUpdateErrZ, accessible via either
4424 * `err` or `result` depending on the state of `result_ok`.
4426 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
4428 * Whether this CResult_NoneChannelMonitorUpdateErrZ represents a success state.
4431 } LDKCResult_NoneChannelMonitorUpdateErrZ;
4436 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
4437 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
4438 * preimage claim backward will lead to loss of funds.
4440 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
4442 * A pointer to the opaque Rust object.
4443 * Nearly everywhere, inner must be non-null, however in places where
4444 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4446 LDKnativeHTLCUpdate *inner;
4448 * Indicates that this is the only struct which contains the same pointer.
4449 * Rust functions which take ownership of an object provided via an argument require
4450 * this to be true and invalidate the object pointed to by inner.
4456 * An event to be processed by the ChannelManager.
4458 typedef enum LDKMonitorEvent_Tag {
4460 * A monitor event containing an HTLCUpdate.
4462 LDKMonitorEvent_HTLCEvent,
4464 * A monitor event that the Channel's commitment transaction was confirmed.
4466 LDKMonitorEvent_CommitmentTxConfirmed,
4468 * Indicates a [`ChannelMonitor`] update has completed. See
4469 * [`ChannelMonitorUpdateErr::TemporaryFailure`] for more information on how this is used.
4471 * [`ChannelMonitorUpdateErr::TemporaryFailure`]: super::ChannelMonitorUpdateErr::TemporaryFailure
4473 LDKMonitorEvent_UpdateCompleted,
4475 * Indicates a [`ChannelMonitor`] update has failed. See
4476 * [`ChannelMonitorUpdateErr::PermanentFailure`] for more information on how this is used.
4478 * [`ChannelMonitorUpdateErr::PermanentFailure`]: super::ChannelMonitorUpdateErr::PermanentFailure
4480 LDKMonitorEvent_UpdateFailed,
4482 * Must be last for serialization purposes
4484 LDKMonitorEvent_Sentinel,
4485 } LDKMonitorEvent_Tag;
4487 typedef struct LDKMonitorEvent_LDKUpdateCompleted_Body {
4489 * The funding outpoint of the [`ChannelMonitor`] that was updated
4491 struct LDKOutPoint funding_txo;
4493 * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
4494 * [`ChannelMonitor::get_latest_update_id`].
4496 * Note that this should only be set to a given update's ID if all previous updates for the
4497 * same [`ChannelMonitor`] have been applied and persisted.
4499 uint64_t monitor_update_id;
4500 } LDKMonitorEvent_LDKUpdateCompleted_Body;
4502 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
4503 LDKMonitorEvent_Tag tag;
4506 struct LDKHTLCUpdate htlc_event;
4509 struct LDKOutPoint commitment_tx_confirmed;
4511 LDKMonitorEvent_LDKUpdateCompleted_Body update_completed;
4513 struct LDKOutPoint update_failed;
4519 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
4520 * This corresponds to std::vector in C++
4522 typedef struct LDKCVec_MonitorEventZ {
4524 * The elements in the array.
4525 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4527 struct LDKMonitorEvent *data;
4529 * The number of elements pointed to by `data`.
4532 } LDKCVec_MonitorEventZ;
4535 * A tuple of 3 elements. See the individual fields for the types contained.
4537 typedef struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ {
4539 * The element at position 0
4541 struct LDKOutPoint a;
4543 * The element at position 1
4545 struct LDKCVec_MonitorEventZ b;
4547 * The element at position 2
4549 struct LDKPublicKey c;
4550 } LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ;
4553 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OutPointCVec_MonitorEventZPublicKeyZs of arbitrary size.
4554 * This corresponds to std::vector in C++
4556 typedef struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ {
4558 * The elements in the array.
4559 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4561 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *data;
4563 * The number of elements pointed to by `data`.
4566 } LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ;
4569 * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not
4571 typedef enum LDKCOption_C2Tuple_usizeTransactionZZ_Tag {
4573 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ
4575 LDKCOption_C2Tuple_usizeTransactionZZ_Some,
4577 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing
4579 LDKCOption_C2Tuple_usizeTransactionZZ_None,
4581 * Must be last for serialization purposes
4583 LDKCOption_C2Tuple_usizeTransactionZZ_Sentinel,
4584 } LDKCOption_C2Tuple_usizeTransactionZZ_Tag;
4586 typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
4587 LDKCOption_C2Tuple_usizeTransactionZZ_Tag tag;
4590 struct LDKC2Tuple_usizeTransactionZ some;
4593 } LDKCOption_C2Tuple_usizeTransactionZZ;
4598 * [`Score`] implementation that uses a fixed penalty.
4600 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
4602 * A pointer to the opaque Rust object.
4603 * Nearly everywhere, inner must be non-null, however in places where
4604 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4606 LDKnativeFixedPenaltyScorer *inner;
4608 * Indicates that this is the only struct which contains the same pointer.
4609 * Rust functions which take ownership of an object provided via an argument require
4610 * this to be true and invalidate the object pointed to by inner.
4613 } LDKFixedPenaltyScorer;
4616 * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
4618 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
4620 * A pointer to the contents in the success state.
4621 * Reading from this pointer when `result_ok` is not set is undefined.
4623 struct LDKFixedPenaltyScorer *result;
4625 * A pointer to the contents in the error state.
4626 * Reading from this pointer when `result_ok` is set is undefined.
4628 struct LDKDecodeError *err;
4629 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
4632 * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
4633 * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4634 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4636 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
4638 * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
4639 * `err` or `result` depending on the state of `result_ok`.
4641 union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
4643 * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
4646 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
4649 * A tuple of 2 elements. See the individual fields for the types contained.
4651 typedef struct LDKC2Tuple_u64u64Z {
4653 * The element at position 0
4657 * The element at position 1
4660 } LDKC2Tuple_u64u64Z;
4663 * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u64Z or not
4665 typedef enum LDKCOption_C2Tuple_u64u64ZZ_Tag {
4667 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains a crate::c_types::derived::C2Tuple_u64u64Z
4669 LDKCOption_C2Tuple_u64u64ZZ_Some,
4671 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains nothing
4673 LDKCOption_C2Tuple_u64u64ZZ_None,
4675 * Must be last for serialization purposes
4677 LDKCOption_C2Tuple_u64u64ZZ_Sentinel,
4678 } LDKCOption_C2Tuple_u64u64ZZ_Tag;
4680 typedef struct LDKCOption_C2Tuple_u64u64ZZ {
4681 LDKCOption_C2Tuple_u64u64ZZ_Tag tag;
4684 struct LDKC2Tuple_u64u64Z some;
4687 } LDKCOption_C2Tuple_u64u64ZZ;
4692 * Represents the compressed public key of a node
4694 typedef struct MUST_USE_STRUCT LDKNodeId {
4696 * A pointer to the opaque Rust object.
4697 * Nearly everywhere, inner must be non-null, however in places where
4698 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4700 LDKnativeNodeId *inner;
4702 * Indicates that this is the only struct which contains the same pointer.
4703 * Rust functions which take ownership of an object provided via an argument require
4704 * this to be true and invalidate the object pointed to by inner.
4710 * A dynamically-allocated array of crate::lightning::routing::gossip::NodeIds of arbitrary size.
4711 * This corresponds to std::vector in C++
4713 typedef struct LDKCVec_NodeIdZ {
4715 * The elements in the array.
4716 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4718 struct LDKNodeId *data;
4720 * The number of elements pointed to by `data`.
4728 * A Record, unit of logging output with Metadata to enable filtering
4729 * Module_path, file, line to inform on log's source
4731 typedef struct MUST_USE_STRUCT LDKRecord {
4733 * A pointer to the opaque Rust object.
4734 * Nearly everywhere, inner must be non-null, however in places where
4735 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4737 LDKnativeRecord *inner;
4739 * Indicates that this is the only struct which contains the same pointer.
4740 * Rust functions which take ownership of an object provided via an argument require
4741 * this to be true and invalidate the object pointed to by inner.
4747 * A trait encapsulating the operations required of a logger
4749 typedef struct LDKLogger {
4751 * An opaque pointer which is passed to your function implementations as an argument.
4752 * This has no meaning in the LDK, and can be NULL or any other value.
4758 void (*log)(const void *this_arg, const struct LDKRecord *NONNULL_PTR record);
4760 * Frees any resources associated with this object given its this_arg pointer.
4761 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4763 void (*free)(void *this_arg);
4769 * Represents the network as nodes and channels between them
4771 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4773 * A pointer to the opaque Rust object.
4774 * Nearly everywhere, inner must be non-null, however in places where
4775 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4777 LDKnativeNetworkGraph *inner;
4779 * Indicates that this is the only struct which contains the same pointer.
4780 * Rust functions which take ownership of an object provided via an argument require
4781 * this to be true and invalidate the object pointed to by inner.
4789 * [`Score`] implementation using channel success probability distributions.
4791 * Based on *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
4792 * and Stefan Richter [[1]]. Given the uncertainty of channel liquidity balances, probability
4793 * distributions are defined based on knowledge learned from successful and unsuccessful attempts.
4794 * Then the negative `log10` of the success probability is used to determine the cost of routing a
4795 * specific HTLC amount through a channel.
4797 * Knowledge about channel liquidity balances takes the form of upper and lower bounds on the
4798 * possible liquidity. Certainty of the bounds is decreased over time using a decay function. See
4799 * [`ProbabilisticScoringParameters`] for details.
4801 * Since the scorer aims to learn the current channel liquidity balances, it works best for nodes
4802 * with high payment volume or that actively probe the [`NetworkGraph`]. Nodes with low payment
4803 * volume are more likely to experience failed payment paths, which would need to be retried.
4807 * Mixing the `no-std` feature between serialization and deserialization results in undefined
4810 * [1]: https://arxiv.org/abs/2107.05322
4812 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
4814 * A pointer to the opaque Rust object.
4815 * Nearly everywhere, inner must be non-null, however in places where
4816 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4818 LDKnativeProbabilisticScorer *inner;
4820 * Indicates that this is the only struct which contains the same pointer.
4821 * Rust functions which take ownership of an object provided via an argument require
4822 * this to be true and invalidate the object pointed to by inner.
4825 } LDKProbabilisticScorer;
4828 * The contents of CResult_ProbabilisticScorerDecodeErrorZ
4830 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
4832 * A pointer to the contents in the success state.
4833 * Reading from this pointer when `result_ok` is not set is undefined.
4835 struct LDKProbabilisticScorer *result;
4837 * A pointer to the contents in the error state.
4838 * Reading from this pointer when `result_ok` is set is undefined.
4840 struct LDKDecodeError *err;
4841 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
4844 * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
4845 * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4846 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4848 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
4850 * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
4851 * `err` or `result` depending on the state of `result_ok`.
4853 union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
4855 * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
4858 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
4863 * Features used within an `init` message.
4865 typedef struct MUST_USE_STRUCT LDKInitFeatures {
4867 * A pointer to the opaque Rust object.
4868 * Nearly everywhere, inner must be non-null, however in places where
4869 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4871 LDKnativeInitFeatures *inner;
4873 * Indicates that this is the only struct which contains the same pointer.
4874 * Rust functions which take ownership of an object provided via an argument require
4875 * this to be true and invalidate the object pointed to by inner.
4881 * The contents of CResult_InitFeaturesDecodeErrorZ
4883 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
4885 * A pointer to the contents in the success state.
4886 * Reading from this pointer when `result_ok` is not set is undefined.
4888 struct LDKInitFeatures *result;
4890 * A pointer to the contents in the error state.
4891 * Reading from this pointer when `result_ok` is set is undefined.
4893 struct LDKDecodeError *err;
4894 } LDKCResult_InitFeaturesDecodeErrorZPtr;
4897 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
4898 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4899 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4901 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
4903 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
4904 * `err` or `result` depending on the state of `result_ok`.
4906 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
4908 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
4911 } LDKCResult_InitFeaturesDecodeErrorZ;
4916 * Features used within a `channel_announcement` message.
4918 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
4920 * A pointer to the opaque Rust object.
4921 * Nearly everywhere, inner must be non-null, however in places where
4922 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4924 LDKnativeChannelFeatures *inner;
4926 * Indicates that this is the only struct which contains the same pointer.
4927 * Rust functions which take ownership of an object provided via an argument require
4928 * this to be true and invalidate the object pointed to by inner.
4931 } LDKChannelFeatures;
4934 * The contents of CResult_ChannelFeaturesDecodeErrorZ
4936 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
4938 * A pointer to the contents in the success state.
4939 * Reading from this pointer when `result_ok` is not set is undefined.
4941 struct LDKChannelFeatures *result;
4943 * A pointer to the contents in the error state.
4944 * Reading from this pointer when `result_ok` is set is undefined.
4946 struct LDKDecodeError *err;
4947 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
4950 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
4951 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4952 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4954 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
4956 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
4957 * `err` or `result` depending on the state of `result_ok`.
4959 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
4961 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
4964 } LDKCResult_ChannelFeaturesDecodeErrorZ;
4969 * Features used within a `node_announcement` message.
4971 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
4973 * A pointer to the opaque Rust object.
4974 * Nearly everywhere, inner must be non-null, however in places where
4975 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4977 LDKnativeNodeFeatures *inner;
4979 * Indicates that this is the only struct which contains the same pointer.
4980 * Rust functions which take ownership of an object provided via an argument require
4981 * this to be true and invalidate the object pointed to by inner.
4987 * The contents of CResult_NodeFeaturesDecodeErrorZ
4989 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
4991 * A pointer to the contents in the success state.
4992 * Reading from this pointer when `result_ok` is not set is undefined.
4994 struct LDKNodeFeatures *result;
4996 * A pointer to the contents in the error state.
4997 * Reading from this pointer when `result_ok` is set is undefined.
4999 struct LDKDecodeError *err;
5000 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
5003 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
5004 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5005 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5007 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
5009 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
5010 * `err` or `result` depending on the state of `result_ok`.
5012 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
5014 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
5017 } LDKCResult_NodeFeaturesDecodeErrorZ;
5022 * Features used within an invoice.
5024 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
5026 * A pointer to the opaque Rust object.
5027 * Nearly everywhere, inner must be non-null, however in places where
5028 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5030 LDKnativeInvoiceFeatures *inner;
5032 * Indicates that this is the only struct which contains the same pointer.
5033 * Rust functions which take ownership of an object provided via an argument require
5034 * this to be true and invalidate the object pointed to by inner.
5037 } LDKInvoiceFeatures;
5040 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
5042 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
5044 * A pointer to the contents in the success state.
5045 * Reading from this pointer when `result_ok` is not set is undefined.
5047 struct LDKInvoiceFeatures *result;
5049 * A pointer to the contents in the error state.
5050 * Reading from this pointer when `result_ok` is set is undefined.
5052 struct LDKDecodeError *err;
5053 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
5056 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
5057 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5058 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5060 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
5062 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
5063 * `err` or `result` depending on the state of `result_ok`.
5065 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
5067 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
5070 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
5073 * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
5075 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
5077 * A pointer to the contents in the success state.
5078 * Reading from this pointer when `result_ok` is not set is undefined.
5080 struct LDKChannelTypeFeatures *result;
5082 * A pointer to the contents in the error state.
5083 * Reading from this pointer when `result_ok` is set is undefined.
5085 struct LDKDecodeError *err;
5086 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
5089 * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
5090 * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5091 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5093 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
5095 * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
5096 * `err` or `result` depending on the state of `result_ok`.
5098 union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
5100 * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
5103 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
5106 * The contents of CResult_NodeIdDecodeErrorZ
5108 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
5110 * A pointer to the contents in the success state.
5111 * Reading from this pointer when `result_ok` is not set is undefined.
5113 struct LDKNodeId *result;
5115 * A pointer to the contents in the error state.
5116 * Reading from this pointer when `result_ok` is set is undefined.
5118 struct LDKDecodeError *err;
5119 } LDKCResult_NodeIdDecodeErrorZPtr;
5122 * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
5123 * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
5124 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5126 typedef struct LDKCResult_NodeIdDecodeErrorZ {
5128 * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
5129 * `err` or `result` depending on the state of `result_ok`.
5131 union LDKCResult_NodeIdDecodeErrorZPtr contents;
5133 * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
5136 } LDKCResult_NodeIdDecodeErrorZ;
5139 * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
5141 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
5143 * A pointer to the contents in the success state.
5144 * Reading from this pointer when `result_ok` is not set is undefined.
5146 struct LDKCOption_NetworkUpdateZ *result;
5148 * A pointer to the contents in the error state.
5149 * Reading from this pointer when `result_ok` is set is undefined.
5151 struct LDKDecodeError *err;
5152 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
5155 * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
5156 * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
5157 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5159 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
5161 * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
5162 * `err` or `result` depending on the state of `result_ok`.
5164 union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
5166 * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
5169 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
5172 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
5175 typedef struct LDKAccess {
5177 * An opaque pointer which is passed to your function implementations as an argument.
5178 * This has no meaning in the LDK, and can be NULL or any other value.
5182 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
5183 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
5186 * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
5188 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
5190 * Frees any resources associated with this object given its this_arg pointer.
5191 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5193 void (*free)(void *this_arg);
5197 * An enum which can either contain a crate::lightning::chain::Access or not
5199 typedef enum LDKCOption_AccessZ_Tag {
5201 * When we're in this state, this COption_AccessZ contains a crate::lightning::chain::Access
5203 LDKCOption_AccessZ_Some,
5205 * When we're in this state, this COption_AccessZ contains nothing
5207 LDKCOption_AccessZ_None,
5209 * Must be last for serialization purposes
5211 LDKCOption_AccessZ_Sentinel,
5212 } LDKCOption_AccessZ_Tag;
5214 typedef struct LDKCOption_AccessZ {
5215 LDKCOption_AccessZ_Tag tag;
5218 struct LDKAccess some;
5221 } LDKCOption_AccessZ;
5224 * The contents of CResult_boolLightningErrorZ
5226 typedef union LDKCResult_boolLightningErrorZPtr {
5228 * A pointer to the contents in the success state.
5229 * Reading from this pointer when `result_ok` is not set is undefined.
5233 * A pointer to the contents in the error state.
5234 * Reading from this pointer when `result_ok` is set is undefined.
5236 struct LDKLightningError *err;
5237 } LDKCResult_boolLightningErrorZPtr;
5240 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
5241 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
5242 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5244 typedef struct LDKCResult_boolLightningErrorZ {
5246 * The contents of this CResult_boolLightningErrorZ, accessible via either
5247 * `err` or `result` depending on the state of `result_ok`.
5249 union LDKCResult_boolLightningErrorZPtr contents;
5251 * Whether this CResult_boolLightningErrorZ represents a success state.
5254 } LDKCResult_boolLightningErrorZ;
5257 * A tuple of 3 elements. See the individual fields for the types contained.
5259 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
5261 * The element at position 0
5263 struct LDKChannelAnnouncement a;
5265 * The element at position 1
5267 struct LDKChannelUpdate b;
5269 * The element at position 2
5271 struct LDKChannelUpdate c;
5272 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
5275 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
5276 * This corresponds to std::vector in C++
5278 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
5280 * The elements in the array.
5281 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5283 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
5285 * The number of elements pointed to by `data`.
5288 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
5291 * A dynamically-allocated array of crate::lightning::ln::msgs::NodeAnnouncements of arbitrary size.
5292 * This corresponds to std::vector in C++
5294 typedef struct LDKCVec_NodeAnnouncementZ {
5296 * The elements in the array.
5297 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5299 struct LDKNodeAnnouncement *data;
5301 * The number of elements pointed to by `data`.
5304 } LDKCVec_NodeAnnouncementZ;
5307 * The contents of CResult_NoneLightningErrorZ
5309 typedef union LDKCResult_NoneLightningErrorZPtr {
5311 * Note that this value is always NULL, as there are no contents in the OK variant
5315 * A pointer to the contents in the error state.
5316 * Reading from this pointer when `result_ok` is set is undefined.
5318 struct LDKLightningError *err;
5319 } LDKCResult_NoneLightningErrorZPtr;
5322 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
5323 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
5324 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5326 typedef struct LDKCResult_NoneLightningErrorZ {
5328 * The contents of this CResult_NoneLightningErrorZ, accessible via either
5329 * `err` or `result` depending on the state of `result_ok`.
5331 union LDKCResult_NoneLightningErrorZPtr contents;
5333 * Whether this CResult_NoneLightningErrorZ represents a success state.
5336 } LDKCResult_NoneLightningErrorZ;
5341 * Details about one direction of a channel as received within a [`ChannelUpdate`].
5343 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
5345 * A pointer to the opaque Rust object.
5346 * Nearly everywhere, inner must be non-null, however in places where
5347 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5349 LDKnativeChannelUpdateInfo *inner;
5351 * Indicates that this is the only struct which contains the same pointer.
5352 * Rust functions which take ownership of an object provided via an argument require
5353 * this to be true and invalidate the object pointed to by inner.
5356 } LDKChannelUpdateInfo;
5359 * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
5361 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
5363 * A pointer to the contents in the success state.
5364 * Reading from this pointer when `result_ok` is not set is undefined.
5366 struct LDKChannelUpdateInfo *result;
5368 * A pointer to the contents in the error state.
5369 * Reading from this pointer when `result_ok` is set is undefined.
5371 struct LDKDecodeError *err;
5372 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
5375 * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
5376 * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5377 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5379 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
5381 * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
5382 * `err` or `result` depending on the state of `result_ok`.
5384 union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
5386 * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
5389 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
5394 * Details about a channel (both directions).
5395 * Received within a channel announcement.
5397 typedef struct MUST_USE_STRUCT LDKChannelInfo {
5399 * A pointer to the opaque Rust object.
5400 * Nearly everywhere, inner must be non-null, however in places where
5401 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5403 LDKnativeChannelInfo *inner;
5405 * Indicates that this is the only struct which contains the same pointer.
5406 * Rust functions which take ownership of an object provided via an argument require
5407 * this to be true and invalidate the object pointed to by inner.
5413 * The contents of CResult_ChannelInfoDecodeErrorZ
5415 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
5417 * A pointer to the contents in the success state.
5418 * Reading from this pointer when `result_ok` is not set is undefined.
5420 struct LDKChannelInfo *result;
5422 * A pointer to the contents in the error state.
5423 * Reading from this pointer when `result_ok` is set is undefined.
5425 struct LDKDecodeError *err;
5426 } LDKCResult_ChannelInfoDecodeErrorZPtr;
5429 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
5430 * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5431 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5433 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
5435 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
5436 * `err` or `result` depending on the state of `result_ok`.
5438 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
5440 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
5443 } LDKCResult_ChannelInfoDecodeErrorZ;
5448 * Fees for routing via a given channel or a node
5450 typedef struct MUST_USE_STRUCT LDKRoutingFees {
5452 * A pointer to the opaque Rust object.
5453 * Nearly everywhere, inner must be non-null, however in places where
5454 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5456 LDKnativeRoutingFees *inner;
5458 * Indicates that this is the only struct which contains the same pointer.
5459 * Rust functions which take ownership of an object provided via an argument require
5460 * this to be true and invalidate the object pointed to by inner.
5466 * The contents of CResult_RoutingFeesDecodeErrorZ
5468 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
5470 * A pointer to the contents in the success state.
5471 * Reading from this pointer when `result_ok` is not set is undefined.
5473 struct LDKRoutingFees *result;
5475 * A pointer to the contents in the error state.
5476 * Reading from this pointer when `result_ok` is set is undefined.
5478 struct LDKDecodeError *err;
5479 } LDKCResult_RoutingFeesDecodeErrorZPtr;
5482 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
5483 * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
5484 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5486 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
5488 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
5489 * `err` or `result` depending on the state of `result_ok`.
5491 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
5493 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
5496 } LDKCResult_RoutingFeesDecodeErrorZ;
5499 * A 4-byte byte array.
5501 typedef struct LDKFourBytes {
5509 * A 16-byte byte array.
5511 typedef struct LDKSixteenBytes {
5519 * A 12-byte byte array.
5521 typedef struct LDKTwelveBytes {
5531 * Represents a hostname for serialization purposes.
5532 * Only the character set and length will be validated.
5533 * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
5534 * Its length is guaranteed to be representable by a single byte.
5535 * This serialization is used by BOLT 7 hostnames.
5537 typedef struct MUST_USE_STRUCT LDKHostname {
5539 * A pointer to the opaque Rust object.
5540 * Nearly everywhere, inner must be non-null, however in places where
5541 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5543 LDKnativeHostname *inner;
5545 * Indicates that this is the only struct which contains the same pointer.
5546 * Rust functions which take ownership of an object provided via an argument require
5547 * this to be true and invalidate the object pointed to by inner.
5553 * An address which can be used to connect to a remote peer
5555 typedef enum LDKNetAddress_Tag {
5557 * An IPv4 address/port on which the peer is listening.
5561 * An IPv6 address/port on which the peer is listening.
5565 * An old-style Tor onion address/port on which the peer is listening.
5567 * This field is deprecated and the Tor network generally no longer supports V2 Onion
5568 * addresses. Thus, the details are not parsed here.
5570 LDKNetAddress_OnionV2,
5572 * A new-style Tor onion address/port on which the peer is listening.
5573 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
5574 * wrap as base32 and append \".onion\".
5576 LDKNetAddress_OnionV3,
5578 * A hostname/port on which the peer is listening.
5580 LDKNetAddress_Hostname,
5582 * Must be last for serialization purposes
5584 LDKNetAddress_Sentinel,
5585 } LDKNetAddress_Tag;
5587 typedef struct LDKNetAddress_LDKIPv4_Body {
5589 * The 4-byte IPv4 address
5591 struct LDKFourBytes addr;
5593 * The port on which the node is listening
5596 } LDKNetAddress_LDKIPv4_Body;
5598 typedef struct LDKNetAddress_LDKIPv6_Body {
5600 * The 16-byte IPv6 address
5602 struct LDKSixteenBytes addr;
5604 * The port on which the node is listening
5607 } LDKNetAddress_LDKIPv6_Body;
5609 typedef struct LDKNetAddress_LDKOnionV3_Body {
5611 * The ed25519 long-term public key of the peer
5613 struct LDKThirtyTwoBytes ed25519_pubkey;
5615 * The checksum of the pubkey and version, as included in the onion address
5619 * The version byte, as defined by the Tor Onion v3 spec.
5623 * The port on which the node is listening
5626 } LDKNetAddress_LDKOnionV3_Body;
5628 typedef struct LDKNetAddress_LDKHostname_Body {
5630 * The hostname on which the node is listening.
5632 struct LDKHostname hostname;
5634 * The port on which the node is listening.
5637 } LDKNetAddress_LDKHostname_Body;
5639 typedef struct MUST_USE_STRUCT LDKNetAddress {
5640 LDKNetAddress_Tag tag;
5642 LDKNetAddress_LDKIPv4_Body i_pv4;
5643 LDKNetAddress_LDKIPv6_Body i_pv6;
5645 struct LDKTwelveBytes onion_v2;
5647 LDKNetAddress_LDKOnionV3_Body onion_v3;
5648 LDKNetAddress_LDKHostname_Body hostname;
5653 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
5654 * This corresponds to std::vector in C++
5656 typedef struct LDKCVec_NetAddressZ {
5658 * The elements in the array.
5659 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5661 struct LDKNetAddress *data;
5663 * The number of elements pointed to by `data`.
5666 } LDKCVec_NetAddressZ;
5671 * Information received in the latest node_announcement from this node.
5673 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
5675 * A pointer to the opaque Rust object.
5676 * Nearly everywhere, inner must be non-null, however in places where
5677 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5679 LDKnativeNodeAnnouncementInfo *inner;
5681 * Indicates that this is the only struct which contains the same pointer.
5682 * Rust functions which take ownership of an object provided via an argument require
5683 * this to be true and invalidate the object pointed to by inner.
5686 } LDKNodeAnnouncementInfo;
5689 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
5691 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
5693 * A pointer to the contents in the success state.
5694 * Reading from this pointer when `result_ok` is not set is undefined.
5696 struct LDKNodeAnnouncementInfo *result;
5698 * A pointer to the contents in the error state.
5699 * Reading from this pointer when `result_ok` is set is undefined.
5701 struct LDKDecodeError *err;
5702 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
5705 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
5706 * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5707 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5709 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
5711 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
5712 * `err` or `result` depending on the state of `result_ok`.
5714 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
5716 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
5719 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
5724 * A user-defined name for a node, which may be used when displaying the node in a graph.
5726 * Since node aliases are provided by third parties, they are a potential avenue for injection
5727 * attacks. Care must be taken when processing.
5729 typedef struct MUST_USE_STRUCT LDKNodeAlias {
5731 * A pointer to the opaque Rust object.
5732 * Nearly everywhere, inner must be non-null, however in places where
5733 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5735 LDKnativeNodeAlias *inner;
5737 * Indicates that this is the only struct which contains the same pointer.
5738 * Rust functions which take ownership of an object provided via an argument require
5739 * this to be true and invalidate the object pointed to by inner.
5745 * The contents of CResult_NodeAliasDecodeErrorZ
5747 typedef union LDKCResult_NodeAliasDecodeErrorZPtr {
5749 * A pointer to the contents in the success state.
5750 * Reading from this pointer when `result_ok` is not set is undefined.
5752 struct LDKNodeAlias *result;
5754 * A pointer to the contents in the error state.
5755 * Reading from this pointer when `result_ok` is set is undefined.
5757 struct LDKDecodeError *err;
5758 } LDKCResult_NodeAliasDecodeErrorZPtr;
5761 * A CResult_NodeAliasDecodeErrorZ represents the result of a fallible operation,
5762 * containing a crate::lightning::routing::gossip::NodeAlias on success and a crate::lightning::ln::msgs::DecodeError on failure.
5763 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5765 typedef struct LDKCResult_NodeAliasDecodeErrorZ {
5767 * The contents of this CResult_NodeAliasDecodeErrorZ, accessible via either
5768 * `err` or `result` depending on the state of `result_ok`.
5770 union LDKCResult_NodeAliasDecodeErrorZPtr contents;
5772 * Whether this CResult_NodeAliasDecodeErrorZ represents a success state.
5775 } LDKCResult_NodeAliasDecodeErrorZ;
5780 * Details about a node in the network, known from the network announcement.
5782 typedef struct MUST_USE_STRUCT LDKNodeInfo {
5784 * A pointer to the opaque Rust object.
5785 * Nearly everywhere, inner must be non-null, however in places where
5786 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5788 LDKnativeNodeInfo *inner;
5790 * Indicates that this is the only struct which contains the same pointer.
5791 * Rust functions which take ownership of an object provided via an argument require
5792 * this to be true and invalidate the object pointed to by inner.
5798 * The contents of CResult_NodeInfoDecodeErrorZ
5800 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
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 LDKNodeInfo *result;
5807 * A pointer to the contents in the error state.
5808 * Reading from this pointer when `result_ok` is set is undefined.
5810 struct LDKDecodeError *err;
5811 } LDKCResult_NodeInfoDecodeErrorZPtr;
5814 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
5815 * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5816 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5818 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
5820 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
5821 * `err` or `result` depending on the state of `result_ok`.
5823 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
5825 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
5828 } LDKCResult_NodeInfoDecodeErrorZ;
5831 * The contents of CResult_NetworkGraphDecodeErrorZ
5833 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
5835 * A pointer to the contents in the success state.
5836 * Reading from this pointer when `result_ok` is not set is undefined.
5838 struct LDKNetworkGraph *result;
5840 * A pointer to the contents in the error state.
5841 * Reading from this pointer when `result_ok` is set is undefined.
5843 struct LDKDecodeError *err;
5844 } LDKCResult_NetworkGraphDecodeErrorZPtr;
5847 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
5848 * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
5849 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5851 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
5853 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
5854 * `err` or `result` depending on the state of `result_ok`.
5856 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
5858 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
5861 } LDKCResult_NetworkGraphDecodeErrorZ;
5864 * An enum which can either contain a crate::c_types::derived::CVec_NetAddressZ or not
5866 typedef enum LDKCOption_CVec_NetAddressZZ_Tag {
5868 * When we're in this state, this COption_CVec_NetAddressZZ contains a crate::c_types::derived::CVec_NetAddressZ
5870 LDKCOption_CVec_NetAddressZZ_Some,
5872 * When we're in this state, this COption_CVec_NetAddressZZ contains nothing
5874 LDKCOption_CVec_NetAddressZZ_None,
5876 * Must be last for serialization purposes
5878 LDKCOption_CVec_NetAddressZZ_Sentinel,
5879 } LDKCOption_CVec_NetAddressZZ_Tag;
5881 typedef struct LDKCOption_CVec_NetAddressZZ {
5882 LDKCOption_CVec_NetAddressZZ_Tag tag;
5885 struct LDKCVec_NetAddressZ some;
5888 } LDKCOption_CVec_NetAddressZZ;
5891 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
5893 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
5895 * A pointer to the contents in the success state.
5896 * Reading from this pointer when `result_ok` is not set is undefined.
5898 struct LDKDelayedPaymentOutputDescriptor *result;
5900 * A pointer to the contents in the error state.
5901 * Reading from this pointer when `result_ok` is set is undefined.
5903 struct LDKDecodeError *err;
5904 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
5907 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
5908 * containing a crate::lightning::chain::keysinterface::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
5909 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5911 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
5913 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
5914 * `err` or `result` depending on the state of `result_ok`.
5916 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
5918 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
5921 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
5924 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
5926 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
5928 * A pointer to the contents in the success state.
5929 * Reading from this pointer when `result_ok` is not set is undefined.
5931 struct LDKStaticPaymentOutputDescriptor *result;
5933 * A pointer to the contents in the error state.
5934 * Reading from this pointer when `result_ok` is set is undefined.
5936 struct LDKDecodeError *err;
5937 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
5940 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
5941 * containing a crate::lightning::chain::keysinterface::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
5942 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5944 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
5946 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
5947 * `err` or `result` depending on the state of `result_ok`.
5949 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
5951 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
5954 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
5957 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
5959 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
5961 * A pointer to the contents in the success state.
5962 * Reading from this pointer when `result_ok` is not set is undefined.
5964 struct LDKSpendableOutputDescriptor *result;
5966 * A pointer to the contents in the error state.
5967 * Reading from this pointer when `result_ok` is set is undefined.
5969 struct LDKDecodeError *err;
5970 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
5973 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
5974 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
5975 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5977 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
5979 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
5980 * `err` or `result` depending on the state of `result_ok`.
5982 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
5984 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
5987 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
5990 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
5991 * This corresponds to std::vector in C++
5993 typedef struct LDKCVec_PaymentPreimageZ {
5995 * The elements in the array.
5996 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5998 struct LDKThirtyTwoBytes *data;
6000 * The number of elements pointed to by `data`.
6003 } LDKCVec_PaymentPreimageZ;
6006 * A tuple of 2 elements. See the individual fields for the types contained.
6008 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
6010 * The element at position 0
6012 struct LDKSignature a;
6014 * The element at position 1
6016 struct LDKCVec_SignatureZ b;
6017 } LDKC2Tuple_SignatureCVec_SignatureZZ;
6020 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
6022 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
6024 * A pointer to the contents in the success state.
6025 * Reading from this pointer when `result_ok` is not set is undefined.
6027 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
6029 * Note that this value is always NULL, as there are no contents in the Err variant
6032 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
6035 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
6036 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
6037 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6039 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
6041 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
6042 * `err` or `result` depending on the state of `result_ok`.
6044 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
6046 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
6049 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
6052 * The contents of CResult_SignatureNoneZ
6054 typedef union LDKCResult_SignatureNoneZPtr {
6056 * A pointer to the contents in the success state.
6057 * Reading from this pointer when `result_ok` is not set is undefined.
6059 struct LDKSignature *result;
6061 * Note that this value is always NULL, as there are no contents in the Err variant
6064 } LDKCResult_SignatureNoneZPtr;
6067 * A CResult_SignatureNoneZ represents the result of a fallible operation,
6068 * containing a crate::c_types::Signature on success and a () on failure.
6069 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6071 typedef struct LDKCResult_SignatureNoneZ {
6073 * The contents of this CResult_SignatureNoneZ, accessible via either
6074 * `err` or `result` depending on the state of `result_ok`.
6076 union LDKCResult_SignatureNoneZPtr contents;
6078 * Whether this CResult_SignatureNoneZ represents a success state.
6081 } LDKCResult_SignatureNoneZ;
6084 * A tuple of 2 elements. See the individual fields for the types contained.
6086 typedef struct LDKC2Tuple_SignatureSignatureZ {
6088 * The element at position 0
6090 struct LDKSignature a;
6092 * The element at position 1
6094 struct LDKSignature b;
6095 } LDKC2Tuple_SignatureSignatureZ;
6098 * The contents of CResult_C2Tuple_SignatureSignatureZNoneZ
6100 typedef union LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr {
6102 * A pointer to the contents in the success state.
6103 * Reading from this pointer when `result_ok` is not set is undefined.
6105 struct LDKC2Tuple_SignatureSignatureZ *result;
6107 * Note that this value is always NULL, as there are no contents in the Err variant
6110 } LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr;
6113 * A CResult_C2Tuple_SignatureSignatureZNoneZ represents the result of a fallible operation,
6114 * containing a crate::c_types::derived::C2Tuple_SignatureSignatureZ on success and a () on failure.
6115 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6117 typedef struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ {
6119 * The contents of this CResult_C2Tuple_SignatureSignatureZNoneZ, accessible via either
6120 * `err` or `result` depending on the state of `result_ok`.
6122 union LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr contents;
6124 * Whether this CResult_C2Tuple_SignatureSignatureZNoneZ represents a success state.
6127 } LDKCResult_C2Tuple_SignatureSignatureZNoneZ;
6130 * The contents of CResult_SecretKeyNoneZ
6132 typedef union LDKCResult_SecretKeyNoneZPtr {
6134 * A pointer to the contents in the success state.
6135 * Reading from this pointer when `result_ok` is not set is undefined.
6137 struct LDKSecretKey *result;
6139 * Note that this value is always NULL, as there are no contents in the Err variant
6142 } LDKCResult_SecretKeyNoneZPtr;
6145 * A CResult_SecretKeyNoneZ represents the result of a fallible operation,
6146 * containing a crate::c_types::SecretKey on success and a () on failure.
6147 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6149 typedef struct LDKCResult_SecretKeyNoneZ {
6151 * The contents of this CResult_SecretKeyNoneZ, accessible via either
6152 * `err` or `result` depending on the state of `result_ok`.
6154 union LDKCResult_SecretKeyNoneZPtr contents;
6156 * Whether this CResult_SecretKeyNoneZ represents a success state.
6159 } LDKCResult_SecretKeyNoneZ;
6164 * This class tracks the per-transaction information needed to build a closing transaction and will
6165 * actually build it and sign.
6167 * This class can be used inside a signer implementation to generate a signature given the relevant
6170 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
6172 * A pointer to the opaque Rust object.
6173 * Nearly everywhere, inner must be non-null, however in places where
6174 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6176 LDKnativeClosingTransaction *inner;
6178 * Indicates that this is the only struct which contains the same pointer.
6179 * Rust functions which take ownership of an object provided via an argument require
6180 * this to be true and invalidate the object pointed to by inner.
6183 } LDKClosingTransaction;
6188 * The unsigned part of a channel_announcement
6190 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
6192 * A pointer to the opaque Rust object.
6193 * Nearly everywhere, inner must be non-null, however in places where
6194 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6196 LDKnativeUnsignedChannelAnnouncement *inner;
6198 * Indicates that this is the only struct which contains the same pointer.
6199 * Rust functions which take ownership of an object provided via an argument require
6200 * this to be true and invalidate the object pointed to by inner.
6203 } LDKUnsignedChannelAnnouncement;
6206 * A trait to sign lightning channel transactions as described in BOLT 3.
6208 * Signing services could be implemented on a hardware wallet. In this case,
6209 * the current Sign would be a front-end on top of a communication
6210 * channel connected to your secure device and lightning key material wouldn't
6211 * reside on a hot server. Nevertheless, a this deployment would still need
6212 * to trust the ChannelManager to avoid loss of funds as this latest component
6213 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
6215 * A more secure iteration would be to use hashlock (or payment points) to pair
6216 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
6217 * at the price of more state and computation on the hardware wallet side. In the future,
6218 * we are looking forward to design such interface.
6220 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
6221 * to act, as liveness and breach reply correctness are always going to be hard requirements
6222 * of LN security model, orthogonal of key management issues.
6224 typedef struct LDKBaseSign {
6226 * An opaque pointer which is passed to your function implementations as an argument.
6227 * This has no meaning in the LDK, and can be NULL or any other value.
6231 * Gets the per-commitment point for a specific commitment number
6233 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
6235 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
6237 * Gets the commitment secret for a specific commitment number as part of the revocation process
6239 * An external signer implementation should error here if the commitment was already signed
6240 * and should refuse to sign it in the future.
6242 * May be called more than once for the same index.
6244 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
6246 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
6248 * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
6250 * This is required in order for the signer to make sure that releasing a commitment
6251 * secret won't leave us without a broadcastable holder transaction.
6252 * Policy checks should be implemented in this function, including checking the amount
6253 * sent to us and checking the HTLCs.
6255 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
6256 * A validating signer should ensure that an HTLC output is removed only when the matching
6257 * preimage is provided, or when the value to holder is restored.
6259 * NOTE: all the relevant preimages will be provided, but there may also be additional
6260 * irrelevant or duplicate preimages.
6262 struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_PaymentPreimageZ preimages);
6264 * Gets the holder's channel public keys and basepoints
6266 struct LDKChannelPublicKeys pubkeys;
6268 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
6269 * Note that this takes a pointer to this object, not the this_ptr like other methods do
6270 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
6272 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
6274 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
6275 * some SpendableOutputDescriptor types. This should be sufficient to identify this
6276 * Sign object uniquely and lookup or re-derive its keys.
6278 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
6280 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
6282 * Note that if signing fails or is rejected, the channel will be force-closed.
6284 * Policy checks should be implemented in this function, including checking the amount
6285 * sent to us and checking the HTLCs.
6287 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
6288 * A validating signer should ensure that an HTLC output is removed only when the matching
6289 * preimage is provided, or when the value to holder is restored.
6291 * NOTE: all the relevant preimages will be provided, but there may also be additional
6292 * irrelevant or duplicate preimages.
6294 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_PaymentPreimageZ preimages);
6296 * Validate the counterparty's revocation.
6298 * This is required in order for the signer to make sure that the state has moved
6299 * forward and it is safe to sign the next counterparty commitment.
6301 struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
6303 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
6304 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
6305 * latest commitment_tx when we initiate a force-close.
6306 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
6307 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
6309 * This may be called multiple times for the same transaction.
6311 * An external signer implementation should check that the commitment has not been revoked.
6313 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
6315 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
6317 * Create a signature for the given input in a transaction spending an HTLC transaction output
6318 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
6320 * A justice transaction may claim multiple outputs at the same time if timelocks are
6321 * similar, but only a signature for the input at index `input` should be signed for here.
6322 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
6323 * to an upcoming timelock expiration.
6325 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
6327 * per_commitment_key is revocation secret which was provided by our counterparty when they
6328 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
6329 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
6332 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]);
6334 * Create a signature for the given input in a transaction spending a commitment transaction
6335 * HTLC output when our counterparty broadcasts an old state.
6337 * A justice transaction may claim multiple outputs at the same time if timelocks are
6338 * similar, but only a signature for the input at index `input` should be signed for here.
6339 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
6340 * to an upcoming timelock expiration.
6342 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
6344 * per_commitment_key is revocation secret which was provided by our counterparty when they
6345 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
6346 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
6349 * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script
6350 * (which is committed to in the BIP 143 signatures).
6352 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);
6354 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
6355 * transaction, either offered or received.
6357 * Such a transaction may claim multiples offered outputs at same time if we know the
6358 * preimage for each when we create it, but only the input at index `input` should be
6359 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
6360 * needed with regards to an upcoming timelock expiration.
6362 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
6365 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
6367 * Per_commitment_point is the dynamic point corresponding to the channel state
6368 * detected onchain. It has been generated by our counterparty and is used to derive
6369 * channel state keys, which are then included in the witness script and committed to in the
6370 * BIP 143 signature.
6372 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);
6374 * Create a signature for a (proposed) closing transaction.
6376 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
6377 * chosen to forgo their output as dust.
6379 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
6381 * Signs a channel announcement message with our funding key and our node secret key (aka
6382 * node_id or network_key), proving it comes from one of the channel participants.
6384 * The first returned signature should be from our node secret key, the second from our
6387 * Note that if this fails or is rejected, the channel will not be publicly announced and
6388 * our counterparty may (though likely will not) close the channel on us for violating the
6391 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
6393 * Set the counterparty static channel data, including basepoints,
6394 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
6395 * This is done as soon as the funding outpoint is known. Since these are static channel data,
6396 * they MUST NOT be allowed to change to different values once set.
6398 * channel_parameters.is_populated() MUST be true.
6400 * We bind holder_selected_contest_delay late here for API convenience.
6402 * Will be called before any signatures are applied.
6404 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
6406 * Frees any resources associated with this object given its this_arg pointer.
6407 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6409 void (*free)(void *this_arg);
6413 * A cloneable signer.
6415 * Although we require signers to be cloneable, it may be useful for developers to be able to use
6416 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
6417 * which implies Sized, into this derived trait.
6419 typedef struct LDKSign {
6421 * An opaque pointer which is passed to your function implementations as an argument.
6422 * This has no meaning in the LDK, and can be NULL or any other value.
6426 * Implementation of BaseSign for this object.
6428 struct LDKBaseSign BaseSign;
6430 * Serialize the object into a byte array
6432 struct LDKCVec_u8Z (*write)(const void *this_arg);
6434 * Called, if set, after this Sign has been cloned into a duplicate object.
6435 * The new Sign is provided, and should be mutated as needed to perform a
6436 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
6438 void (*cloned)(struct LDKSign *NONNULL_PTR new_Sign);
6440 * Frees any resources associated with this object given its this_arg pointer.
6441 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6443 void (*free)(void *this_arg);
6447 * The contents of CResult_SignDecodeErrorZ
6449 typedef union LDKCResult_SignDecodeErrorZPtr {
6451 * A pointer to the contents in the success state.
6452 * Reading from this pointer when `result_ok` is not set is undefined.
6454 struct LDKSign *result;
6456 * A pointer to the contents in the error state.
6457 * Reading from this pointer when `result_ok` is set is undefined.
6459 struct LDKDecodeError *err;
6460 } LDKCResult_SignDecodeErrorZPtr;
6463 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
6464 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
6465 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6467 typedef struct LDKCResult_SignDecodeErrorZ {
6469 * The contents of this CResult_SignDecodeErrorZ, accessible via either
6470 * `err` or `result` depending on the state of `result_ok`.
6472 union LDKCResult_SignDecodeErrorZPtr contents;
6474 * Whether this CResult_SignDecodeErrorZ represents a success state.
6477 } LDKCResult_SignDecodeErrorZ;
6480 * Integer in the range `0..32`
6482 typedef struct LDKu5 {
6487 * A dynamically-allocated array of crate::c_types::u5s of arbitrary size.
6488 * This corresponds to std::vector in C++
6490 typedef struct LDKCVec_u5Z {
6492 * The elements in the array.
6493 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6497 * The number of elements pointed to by `data`.
6503 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
6504 * allows recovering the exact public key which created the signature given the message.
6506 typedef struct LDKRecoverableSignature {
6508 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
6511 uint8_t serialized_form[68];
6512 } LDKRecoverableSignature;
6515 * The contents of CResult_RecoverableSignatureNoneZ
6517 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
6519 * A pointer to the contents in the success state.
6520 * Reading from this pointer when `result_ok` is not set is undefined.
6522 struct LDKRecoverableSignature *result;
6524 * Note that this value is always NULL, as there are no contents in the Err variant
6527 } LDKCResult_RecoverableSignatureNoneZPtr;
6530 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
6531 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
6532 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6534 typedef struct LDKCResult_RecoverableSignatureNoneZ {
6536 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
6537 * `err` or `result` depending on the state of `result_ok`.
6539 union LDKCResult_RecoverableSignatureNoneZPtr contents;
6541 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
6544 } LDKCResult_RecoverableSignatureNoneZ;
6547 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
6548 * This corresponds to std::vector in C++
6550 typedef struct LDKCVec_CVec_u8ZZ {
6552 * The elements in the array.
6553 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6555 struct LDKCVec_u8Z *data;
6557 * The number of elements pointed to by `data`.
6560 } LDKCVec_CVec_u8ZZ;
6563 * The contents of CResult_CVec_CVec_u8ZZNoneZ
6565 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
6567 * A pointer to the contents in the success state.
6568 * Reading from this pointer when `result_ok` is not set is undefined.
6570 struct LDKCVec_CVec_u8ZZ *result;
6572 * Note that this value is always NULL, as there are no contents in the Err variant
6575 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
6578 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
6579 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
6580 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6582 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
6584 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
6585 * `err` or `result` depending on the state of `result_ok`.
6587 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
6589 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
6592 } LDKCResult_CVec_CVec_u8ZZNoneZ;
6597 * A simple implementation of Sign that just keeps the private keys in memory.
6599 * This implementation performs no policy checks and is insufficient by itself as
6600 * a secure external signer.
6602 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
6604 * A pointer to the opaque Rust object.
6605 * Nearly everywhere, inner must be non-null, however in places where
6606 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6608 LDKnativeInMemorySigner *inner;
6610 * Indicates that this is the only struct which contains the same pointer.
6611 * Rust functions which take ownership of an object provided via an argument require
6612 * this to be true and invalidate the object pointed to by inner.
6615 } LDKInMemorySigner;
6618 * The contents of CResult_InMemorySignerDecodeErrorZ
6620 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
6622 * A pointer to the contents in the success state.
6623 * Reading from this pointer when `result_ok` is not set is undefined.
6625 struct LDKInMemorySigner *result;
6627 * A pointer to the contents in the error state.
6628 * Reading from this pointer when `result_ok` is set is undefined.
6630 struct LDKDecodeError *err;
6631 } LDKCResult_InMemorySignerDecodeErrorZPtr;
6634 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
6635 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
6636 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6638 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
6640 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
6641 * `err` or `result` depending on the state of `result_ok`.
6643 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
6645 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
6648 } LDKCResult_InMemorySignerDecodeErrorZ;
6651 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
6652 * This corresponds to std::vector in C++
6654 typedef struct LDKCVec_TxOutZ {
6656 * The elements in the array.
6657 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6659 struct LDKTxOut *data;
6661 * The number of elements pointed to by `data`.
6667 * The contents of CResult_TransactionNoneZ
6669 typedef union LDKCResult_TransactionNoneZPtr {
6671 * A pointer to the contents in the success state.
6672 * Reading from this pointer when `result_ok` is not set is undefined.
6674 struct LDKTransaction *result;
6676 * Note that this value is always NULL, as there are no contents in the Err variant
6679 } LDKCResult_TransactionNoneZPtr;
6682 * A CResult_TransactionNoneZ represents the result of a fallible operation,
6683 * containing a crate::c_types::Transaction on success and a () on failure.
6684 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6686 typedef struct LDKCResult_TransactionNoneZ {
6688 * The contents of this CResult_TransactionNoneZ, accessible via either
6689 * `err` or `result` depending on the state of `result_ok`.
6691 union LDKCResult_TransactionNoneZPtr contents;
6693 * Whether this CResult_TransactionNoneZ represents a success state.
6696 } LDKCResult_TransactionNoneZ;
6701 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
6702 * on-chain transactions to ensure no loss of funds occurs.
6704 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
6705 * information and are actively monitoring the chain.
6707 * Pending Events or updated HTLCs which have not yet been read out by
6708 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
6709 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
6710 * gotten are fully handled before re-serializing the new state.
6712 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
6713 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
6714 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
6715 * returned block hash and the the current chain and then reconnecting blocks to get to the
6716 * best chain) upon deserializing the object!
6718 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
6720 * A pointer to the opaque Rust object.
6721 * Nearly everywhere, inner must be non-null, however in places where
6722 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6724 LDKnativeChannelMonitor *inner;
6726 * Indicates that this is the only struct which contains the same pointer.
6727 * Rust functions which take ownership of an object provided via an argument require
6728 * this to be true and invalidate the object pointed to by inner.
6731 } LDKChannelMonitor;
6734 * A tuple of 2 elements. See the individual fields for the types contained.
6736 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
6738 * The element at position 0
6740 struct LDKThirtyTwoBytes a;
6742 * The element at position 1
6744 struct LDKChannelMonitor b;
6745 } LDKC2Tuple_BlockHashChannelMonitorZ;
6748 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
6749 * This corresponds to std::vector in C++
6751 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
6753 * The elements in the array.
6754 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6756 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
6758 * The number of elements pointed to by `data`.
6761 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
6764 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
6766 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
6768 * A pointer to the contents in the success state.
6769 * Reading from this pointer when `result_ok` is not set is undefined.
6771 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
6773 * A pointer to the contents in the error state.
6774 * Reading from this pointer when `result_ok` is set is undefined.
6776 enum LDKIOError *err;
6777 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
6780 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
6781 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
6782 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6784 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
6786 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
6787 * `err` or `result` depending on the state of `result_ok`.
6789 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
6791 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
6794 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
6797 * An enum which can either contain a u16 or not
6799 typedef enum LDKCOption_u16Z_Tag {
6801 * When we're in this state, this COption_u16Z contains a u16
6803 LDKCOption_u16Z_Some,
6805 * When we're in this state, this COption_u16Z contains nothing
6807 LDKCOption_u16Z_None,
6809 * Must be last for serialization purposes
6811 LDKCOption_u16Z_Sentinel,
6812 } LDKCOption_u16Z_Tag;
6814 typedef struct LDKCOption_u16Z {
6815 LDKCOption_u16Z_Tag tag;
6824 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
6827 typedef enum LDKAPIError_Tag {
6829 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
6830 * are documented, but generally indicates some precondition of a function was violated.
6832 LDKAPIError_APIMisuseError,
6834 * Due to a high feerate, we were unable to complete the request.
6835 * For example, this may be returned if the feerate implies we cannot open a channel at the
6836 * requested value, but opening a larger channel would succeed.
6838 LDKAPIError_FeeRateTooHigh,
6840 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
6841 * too-many-hops, etc).
6843 LDKAPIError_RouteError,
6845 * We were unable to complete the request as the Channel required to do so is unable to
6846 * complete the request (or was not found). This can take many forms, including disconnected
6847 * peer, channel at capacity, channel shutting down, etc.
6849 LDKAPIError_ChannelUnavailable,
6851 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
6852 * attempted action to fail.
6854 LDKAPIError_MonitorUpdateFailed,
6856 * [`KeysInterface::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
6857 * with the channel counterparty as negotiated in [`InitFeatures`].
6859 * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
6860 * a channel or cooperatively close one with this peer (and will have to force-close instead).
6862 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
6863 * [`InitFeatures`]: crate::ln::features::InitFeatures
6865 LDKAPIError_IncompatibleShutdownScript,
6867 * Must be last for serialization purposes
6869 LDKAPIError_Sentinel,
6872 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
6874 * A human-readable error message
6877 } LDKAPIError_LDKAPIMisuseError_Body;
6879 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
6881 * A human-readable error message
6885 * The feerate which was too high.
6888 } LDKAPIError_LDKFeeRateTooHigh_Body;
6890 typedef struct LDKAPIError_LDKRouteError_Body {
6892 * A human-readable error message
6895 } LDKAPIError_LDKRouteError_Body;
6897 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
6899 * A human-readable error message
6902 } LDKAPIError_LDKChannelUnavailable_Body;
6904 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
6906 * The incompatible shutdown script.
6908 struct LDKShutdownScript script;
6909 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
6911 typedef struct MUST_USE_STRUCT LDKAPIError {
6912 LDKAPIError_Tag tag;
6914 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
6915 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
6916 LDKAPIError_LDKRouteError_Body route_error;
6917 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
6918 LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
6923 * The contents of CResult_NoneAPIErrorZ
6925 typedef union LDKCResult_NoneAPIErrorZPtr {
6927 * Note that this value is always NULL, as there are no contents in the OK variant
6931 * A pointer to the contents in the error state.
6932 * Reading from this pointer when `result_ok` is set is undefined.
6934 struct LDKAPIError *err;
6935 } LDKCResult_NoneAPIErrorZPtr;
6938 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
6939 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
6940 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6942 typedef struct LDKCResult_NoneAPIErrorZ {
6944 * The contents of this CResult_NoneAPIErrorZ, accessible via either
6945 * `err` or `result` depending on the state of `result_ok`.
6947 union LDKCResult_NoneAPIErrorZPtr contents;
6949 * Whether this CResult_NoneAPIErrorZ represents a success state.
6952 } LDKCResult_NoneAPIErrorZ;
6955 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
6956 * This corresponds to std::vector in C++
6958 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
6960 * The elements in the array.
6961 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6963 struct LDKCResult_NoneAPIErrorZ *data;
6965 * The number of elements pointed to by `data`.
6968 } LDKCVec_CResult_NoneAPIErrorZZ;
6971 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
6972 * This corresponds to std::vector in C++
6974 typedef struct LDKCVec_APIErrorZ {
6976 * The elements in the array.
6977 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6979 struct LDKAPIError *data;
6981 * The number of elements pointed to by `data`.
6984 } LDKCVec_APIErrorZ;
6987 * The contents of CResult__u832APIErrorZ
6989 typedef union LDKCResult__u832APIErrorZPtr {
6991 * A pointer to the contents in the success state.
6992 * Reading from this pointer when `result_ok` is not set is undefined.
6994 struct LDKThirtyTwoBytes *result;
6996 * A pointer to the contents in the error state.
6997 * Reading from this pointer when `result_ok` is set is undefined.
6999 struct LDKAPIError *err;
7000 } LDKCResult__u832APIErrorZPtr;
7003 * A CResult__u832APIErrorZ represents the result of a fallible operation,
7004 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7005 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7007 typedef struct LDKCResult__u832APIErrorZ {
7009 * The contents of this CResult__u832APIErrorZ, accessible via either
7010 * `err` or `result` depending on the state of `result_ok`.
7012 union LDKCResult__u832APIErrorZPtr contents;
7014 * Whether this CResult__u832APIErrorZ represents a success state.
7017 } LDKCResult__u832APIErrorZ;
7020 * If a payment fails to send, it can be in one of several states. This enum is returned as the
7021 * Err() type describing which state the payment is in, see the description of individual enum
7024 typedef enum LDKPaymentSendFailure_Tag {
7026 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
7027 * send the payment at all. No channel state has been changed or messages sent to peers, and
7028 * once you've changed the parameter at error, you can freely retry the payment in full.
7030 LDKPaymentSendFailure_ParameterError,
7032 * A parameter in a single path which was passed to send_payment was invalid, preventing us
7033 * from attempting to send the payment at all. No channel state has been changed or messages
7034 * sent to peers, and once you've changed the parameter at error, you can freely retry the
7037 * The results here are ordered the same as the paths in the route object which was passed to
7040 LDKPaymentSendFailure_PathParameterError,
7042 * All paths which were attempted failed to send, with no channel state change taking place.
7043 * You can freely retry the payment in full (though you probably want to do so over different
7044 * paths than the ones selected).
7046 LDKPaymentSendFailure_AllFailedRetrySafe,
7048 * Some paths which were attempted failed to send, though possibly not all. At least some
7049 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
7050 * in over-/re-payment.
7052 * The results here are ordered the same as the paths in the route object which was passed to
7053 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
7054 * retried (though there is currently no API with which to do so).
7056 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
7057 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
7058 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
7059 * with the latest update_id.
7061 LDKPaymentSendFailure_PartialFailure,
7063 * Must be last for serialization purposes
7065 LDKPaymentSendFailure_Sentinel,
7066 } LDKPaymentSendFailure_Tag;
7068 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
7070 * The errors themselves, in the same order as the route hops.
7072 struct LDKCVec_CResult_NoneAPIErrorZZ results;
7074 * If some paths failed without irrevocably committing to the new HTLC(s), this will
7075 * contain a [`RouteParameters`] object which can be used to calculate a new route that
7076 * will pay all remaining unpaid balance.
7078 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
7080 struct LDKRouteParameters failed_paths_retry;
7082 * The payment id for the payment, which is now at least partially pending.
7084 struct LDKThirtyTwoBytes payment_id;
7085 } LDKPaymentSendFailure_LDKPartialFailure_Body;
7087 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
7088 LDKPaymentSendFailure_Tag tag;
7091 struct LDKAPIError parameter_error;
7094 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
7097 struct LDKCVec_APIErrorZ all_failed_retry_safe;
7099 LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
7101 } LDKPaymentSendFailure;
7104 * The contents of CResult_PaymentIdPaymentSendFailureZ
7106 typedef union LDKCResult_PaymentIdPaymentSendFailureZPtr {
7108 * A pointer to the contents in the success state.
7109 * Reading from this pointer when `result_ok` is not set is undefined.
7111 struct LDKThirtyTwoBytes *result;
7113 * A pointer to the contents in the error state.
7114 * Reading from this pointer when `result_ok` is set is undefined.
7116 struct LDKPaymentSendFailure *err;
7117 } LDKCResult_PaymentIdPaymentSendFailureZPtr;
7120 * A CResult_PaymentIdPaymentSendFailureZ represents the result of a fallible operation,
7121 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
7122 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7124 typedef struct LDKCResult_PaymentIdPaymentSendFailureZ {
7126 * The contents of this CResult_PaymentIdPaymentSendFailureZ, accessible via either
7127 * `err` or `result` depending on the state of `result_ok`.
7129 union LDKCResult_PaymentIdPaymentSendFailureZPtr contents;
7131 * Whether this CResult_PaymentIdPaymentSendFailureZ represents a success state.
7134 } LDKCResult_PaymentIdPaymentSendFailureZ;
7137 * The contents of CResult_NonePaymentSendFailureZ
7139 typedef union LDKCResult_NonePaymentSendFailureZPtr {
7141 * Note that this value is always NULL, as there are no contents in the OK variant
7145 * A pointer to the contents in the error state.
7146 * Reading from this pointer when `result_ok` is set is undefined.
7148 struct LDKPaymentSendFailure *err;
7149 } LDKCResult_NonePaymentSendFailureZPtr;
7152 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
7153 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
7154 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7156 typedef struct LDKCResult_NonePaymentSendFailureZ {
7158 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
7159 * `err` or `result` depending on the state of `result_ok`.
7161 union LDKCResult_NonePaymentSendFailureZPtr contents;
7163 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
7166 } LDKCResult_NonePaymentSendFailureZ;
7169 * A tuple of 2 elements. See the individual fields for the types contained.
7171 typedef struct LDKC2Tuple_PaymentHashPaymentIdZ {
7173 * The element at position 0
7175 struct LDKThirtyTwoBytes a;
7177 * The element at position 1
7179 struct LDKThirtyTwoBytes b;
7180 } LDKC2Tuple_PaymentHashPaymentIdZ;
7183 * The contents of CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ
7185 typedef union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr {
7187 * A pointer to the contents in the success state.
7188 * Reading from this pointer when `result_ok` is not set is undefined.
7190 struct LDKC2Tuple_PaymentHashPaymentIdZ *result;
7192 * A pointer to the contents in the error state.
7193 * Reading from this pointer when `result_ok` is set is undefined.
7195 struct LDKPaymentSendFailure *err;
7196 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr;
7199 * A CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents the result of a fallible operation,
7200 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentIdZ on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
7201 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7203 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ {
7205 * The contents of this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ, accessible via either
7206 * `err` or `result` depending on the state of `result_ok`.
7208 union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr contents;
7210 * Whether this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents a success state.
7213 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ;
7216 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
7217 * This corresponds to std::vector in C++
7219 typedef struct LDKCVec_ThirtyTwoBytesZ {
7221 * The elements in the array.
7222 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7224 struct LDKThirtyTwoBytes *data;
7226 * The number of elements pointed to by `data`.
7229 } LDKCVec_ThirtyTwoBytesZ;
7232 * A tuple of 2 elements. See the individual fields for the types contained.
7234 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
7236 * The element at position 0
7238 struct LDKThirtyTwoBytes a;
7240 * The element at position 1
7242 struct LDKThirtyTwoBytes b;
7243 } LDKC2Tuple_PaymentHashPaymentSecretZ;
7246 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ
7248 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
7250 * A pointer to the contents in the success state.
7251 * Reading from this pointer when `result_ok` is not set is undefined.
7253 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
7255 * Note that this value is always NULL, as there are no contents in the Err variant
7258 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr;
7261 * A CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents the result of a fallible operation,
7262 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a () on failure.
7263 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7265 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
7267 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ, accessible via either
7268 * `err` or `result` depending on the state of `result_ok`.
7270 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr contents;
7272 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents a success state.
7275 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ;
7278 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ
7280 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr {
7282 * A pointer to the contents in the success state.
7283 * Reading from this pointer when `result_ok` is not set is undefined.
7285 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
7287 * A pointer to the contents in the error state.
7288 * Reading from this pointer when `result_ok` is set is undefined.
7290 struct LDKAPIError *err;
7291 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr;
7294 * A CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents the result of a fallible operation,
7295 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a crate::lightning::util::errors::APIError on failure.
7296 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7298 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
7300 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ, accessible via either
7301 * `err` or `result` depending on the state of `result_ok`.
7303 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr contents;
7305 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents a success state.
7308 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ;
7311 * The contents of CResult_PaymentSecretNoneZ
7313 typedef union LDKCResult_PaymentSecretNoneZPtr {
7315 * A pointer to the contents in the success state.
7316 * Reading from this pointer when `result_ok` is not set is undefined.
7318 struct LDKThirtyTwoBytes *result;
7320 * Note that this value is always NULL, as there are no contents in the Err variant
7323 } LDKCResult_PaymentSecretNoneZPtr;
7326 * A CResult_PaymentSecretNoneZ represents the result of a fallible operation,
7327 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
7328 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7330 typedef struct LDKCResult_PaymentSecretNoneZ {
7332 * The contents of this CResult_PaymentSecretNoneZ, accessible via either
7333 * `err` or `result` depending on the state of `result_ok`.
7335 union LDKCResult_PaymentSecretNoneZPtr contents;
7337 * Whether this CResult_PaymentSecretNoneZ represents a success state.
7340 } LDKCResult_PaymentSecretNoneZ;
7343 * The contents of CResult_PaymentSecretAPIErrorZ
7345 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
7347 * A pointer to the contents in the success state.
7348 * Reading from this pointer when `result_ok` is not set is undefined.
7350 struct LDKThirtyTwoBytes *result;
7352 * A pointer to the contents in the error state.
7353 * Reading from this pointer when `result_ok` is set is undefined.
7355 struct LDKAPIError *err;
7356 } LDKCResult_PaymentSecretAPIErrorZPtr;
7359 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
7360 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7361 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7363 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
7365 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
7366 * `err` or `result` depending on the state of `result_ok`.
7368 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
7370 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
7373 } LDKCResult_PaymentSecretAPIErrorZ;
7376 * The contents of CResult_PaymentPreimageAPIErrorZ
7378 typedef union LDKCResult_PaymentPreimageAPIErrorZPtr {
7380 * A pointer to the contents in the success state.
7381 * Reading from this pointer when `result_ok` is not set is undefined.
7383 struct LDKThirtyTwoBytes *result;
7385 * A pointer to the contents in the error state.
7386 * Reading from this pointer when `result_ok` is set is undefined.
7388 struct LDKAPIError *err;
7389 } LDKCResult_PaymentPreimageAPIErrorZPtr;
7392 * A CResult_PaymentPreimageAPIErrorZ represents the result of a fallible operation,
7393 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7394 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7396 typedef struct LDKCResult_PaymentPreimageAPIErrorZ {
7398 * The contents of this CResult_PaymentPreimageAPIErrorZ, accessible via either
7399 * `err` or `result` depending on the state of `result_ok`.
7401 union LDKCResult_PaymentPreimageAPIErrorZPtr contents;
7403 * Whether this CResult_PaymentPreimageAPIErrorZ represents a success state.
7406 } LDKCResult_PaymentPreimageAPIErrorZ;
7411 * Information needed for constructing an invoice route hint for this channel.
7413 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
7415 * A pointer to the opaque Rust object.
7416 * Nearly everywhere, inner must be non-null, however in places where
7417 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7419 LDKnativeCounterpartyForwardingInfo *inner;
7421 * Indicates that this is the only struct which contains the same pointer.
7422 * Rust functions which take ownership of an object provided via an argument require
7423 * this to be true and invalidate the object pointed to by inner.
7426 } LDKCounterpartyForwardingInfo;
7429 * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
7431 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
7433 * A pointer to the contents in the success state.
7434 * Reading from this pointer when `result_ok` is not set is undefined.
7436 struct LDKCounterpartyForwardingInfo *result;
7438 * A pointer to the contents in the error state.
7439 * Reading from this pointer when `result_ok` is set is undefined.
7441 struct LDKDecodeError *err;
7442 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
7445 * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
7446 * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7447 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7449 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
7451 * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
7452 * `err` or `result` depending on the state of `result_ok`.
7454 union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
7456 * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
7459 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
7464 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
7465 * to better separate parameters.
7467 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
7469 * A pointer to the opaque Rust object.
7470 * Nearly everywhere, inner must be non-null, however in places where
7471 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7473 LDKnativeChannelCounterparty *inner;
7475 * Indicates that this is the only struct which contains the same pointer.
7476 * Rust functions which take ownership of an object provided via an argument require
7477 * this to be true and invalidate the object pointed to by inner.
7480 } LDKChannelCounterparty;
7483 * The contents of CResult_ChannelCounterpartyDecodeErrorZ
7485 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
7487 * A pointer to the contents in the success state.
7488 * Reading from this pointer when `result_ok` is not set is undefined.
7490 struct LDKChannelCounterparty *result;
7492 * A pointer to the contents in the error state.
7493 * Reading from this pointer when `result_ok` is set is undefined.
7495 struct LDKDecodeError *err;
7496 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
7499 * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
7500 * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
7501 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7503 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
7505 * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
7506 * `err` or `result` depending on the state of `result_ok`.
7508 union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
7510 * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
7513 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
7516 * The contents of CResult_ChannelDetailsDecodeErrorZ
7518 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
7520 * A pointer to the contents in the success state.
7521 * Reading from this pointer when `result_ok` is not set is undefined.
7523 struct LDKChannelDetails *result;
7525 * A pointer to the contents in the error state.
7526 * Reading from this pointer when `result_ok` is set is undefined.
7528 struct LDKDecodeError *err;
7529 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
7532 * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
7533 * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
7534 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7536 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
7538 * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
7539 * `err` or `result` depending on the state of `result_ok`.
7541 union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
7543 * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
7546 } LDKCResult_ChannelDetailsDecodeErrorZ;
7551 * Route hints used in constructing invoices for [phantom node payents].
7553 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
7555 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
7557 * A pointer to the opaque Rust object.
7558 * Nearly everywhere, inner must be non-null, however in places where
7559 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7561 LDKnativePhantomRouteHints *inner;
7563 * Indicates that this is the only struct which contains the same pointer.
7564 * Rust functions which take ownership of an object provided via an argument require
7565 * this to be true and invalidate the object pointed to by inner.
7568 } LDKPhantomRouteHints;
7571 * The contents of CResult_PhantomRouteHintsDecodeErrorZ
7573 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
7575 * A pointer to the contents in the success state.
7576 * Reading from this pointer when `result_ok` is not set is undefined.
7578 struct LDKPhantomRouteHints *result;
7580 * A pointer to the contents in the error state.
7581 * Reading from this pointer when `result_ok` is set is undefined.
7583 struct LDKDecodeError *err;
7584 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
7587 * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
7588 * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
7589 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7591 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
7593 * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
7594 * `err` or `result` depending on the state of `result_ok`.
7596 union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
7598 * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
7601 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
7604 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
7605 * This corresponds to std::vector in C++
7607 typedef struct LDKCVec_ChannelMonitorZ {
7609 * The elements in the array.
7610 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7612 struct LDKChannelMonitor *data;
7614 * The number of elements pointed to by `data`.
7617 } LDKCVec_ChannelMonitorZ;
7622 * An update generated by the underlying Channel itself which contains some new information the
7623 * ChannelMonitor should be made aware of.
7625 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
7627 * A pointer to the opaque Rust object.
7628 * Nearly everywhere, inner must be non-null, however in places where
7629 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7631 LDKnativeChannelMonitorUpdate *inner;
7633 * Indicates that this is the only struct which contains the same pointer.
7634 * Rust functions which take ownership of an object provided via an argument require
7635 * this to be true and invalidate the object pointed to by inner.
7638 } LDKChannelMonitorUpdate;
7641 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
7642 * blocks are connected and disconnected.
7644 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
7645 * responsible for maintaining a set of monitors such that they can be updated accordingly as
7646 * channel state changes and HTLCs are resolved. See method documentation for specific
7649 * Implementations **must** ensure that updates are successfully applied and persisted upon method
7650 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
7651 * without taking any further action such as persisting the current state.
7653 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
7654 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
7655 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
7656 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
7657 * multiple instances.
7659 * [`PermanentFailure`]: ChannelMonitorUpdateErr::PermanentFailure
7661 typedef struct LDKWatch {
7663 * An opaque pointer which is passed to your function implementations as an argument.
7664 * This has no meaning in the LDK, and can be NULL or any other value.
7668 * Watches a channel identified by `funding_txo` using `monitor`.
7670 * Implementations are responsible for watching the chain for the funding transaction along
7671 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
7672 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
7674 * Note: this interface MUST error with `ChannelMonitorUpdateErr::PermanentFailure` if
7675 * the given `funding_txo` has previously been registered via `watch_channel`.
7677 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
7678 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
7679 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
7681 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
7683 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
7685 * Implementations must call [`update_monitor`] with the given update. See
7686 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
7688 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
7690 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
7692 * Returns any monitor events since the last call. Subsequent calls must only return new
7695 * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
7696 * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
7699 * For details on asynchronous [`ChannelMonitor`] updating and returning
7700 * [`MonitorEvent::UpdateCompleted`] here, see [`ChannelMonitorUpdateErr::TemporaryFailure`].
7702 struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ (*release_pending_monitor_events)(const void *this_arg);
7704 * Frees any resources associated with this object given its this_arg pointer.
7705 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7707 void (*free)(void *this_arg);
7711 * An interface to send a transaction to the Bitcoin network.
7713 typedef struct LDKBroadcasterInterface {
7715 * An opaque pointer which is passed to your function implementations as an argument.
7716 * This has no meaning in the LDK, and can be NULL or any other value.
7720 * Sends a transaction out to (hopefully) be mined.
7722 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
7724 * Frees any resources associated with this object given its this_arg pointer.
7725 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7727 void (*free)(void *this_arg);
7728 } LDKBroadcasterInterface;
7731 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
7732 * own the memory pointed to by data.
7734 typedef struct LDKu8slice {
7736 * A pointer to the byte buffer
7738 const uint8_t *data;
7740 * The number of bytes pointed to by `data`.
7746 * A trait to describe an object which can get user secrets and key material.
7748 typedef struct LDKKeysInterface {
7750 * An opaque pointer which is passed to your function implementations as an argument.
7751 * This has no meaning in the LDK, and can be NULL or any other value.
7755 * Get node secret key based on the provided [`Recipient`].
7757 * The node_id/network_key is the public key that corresponds to this secret key.
7759 * This method must return the same value each time it is called with a given `Recipient`
7762 struct LDKCResult_SecretKeyNoneZ (*get_node_secret)(const void *this_arg, enum LDKRecipient recipient);
7764 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
7766 * This method should return a different value each time it is called, to avoid linking
7767 * on-chain funds across channels as controlled to the same user.
7769 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
7771 * Get a script pubkey which we will send funds to when closing a channel.
7773 * This method should return a different value each time it is called, to avoid linking
7774 * on-chain funds across channels as controlled to the same user.
7776 struct LDKShutdownScript (*get_shutdown_scriptpubkey)(const void *this_arg);
7778 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
7779 * restarted with some stale data!
7781 * This method must return a different value each time it is called.
7783 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
7785 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
7786 * onion packets and for temporary channel IDs. There is no requirement that these be
7787 * persisted anywhere, though they must be unique across restarts.
7789 * This method must return a different value each time it is called.
7791 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
7793 * Reads a `Signer` for this `KeysInterface` from the given input stream.
7794 * This is only called during deserialization of other objects which contain
7795 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
7796 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
7797 * contain no versioning scheme. You may wish to include your own version prefix and ensure
7798 * you've read all of the provided bytes to ensure no corruption occurred.
7800 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
7803 * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
7804 * this trait to parse the invoice and make sure they're signing what they expect, rather than
7805 * blindly signing the hash.
7806 * The hrp is ascii bytes, while the invoice data is base32.
7808 * The secret key used to sign the invoice is dependent on the [`Recipient`].
7810 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z invoice_data, enum LDKRecipient receipient);
7812 * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
7814 * If the implementor of this trait supports [phantom node payments], then every node that is
7815 * intended to be included in the phantom invoice route hints must return the same value from
7818 * This method must return the same value each time it is called.
7820 * [phantom node payments]: PhantomKeysManager
7822 struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
7824 * Frees any resources associated with this object given its this_arg pointer.
7825 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7827 void (*free)(void *this_arg);
7831 * A trait which should be implemented to provide feerate information on a number of time
7834 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
7835 * called from inside the library in response to chain events, P2P events, or timer events).
7837 typedef struct LDKFeeEstimator {
7839 * An opaque pointer which is passed to your function implementations as an argument.
7840 * This has no meaning in the LDK, and can be NULL or any other value.
7844 * Gets estimated satoshis of fee required per 1000 Weight-Units.
7846 * LDK will wrap this method and ensure that the value returned is no smaller than 253
7847 * (ie 1 satoshi-per-byte rounded up to ensure later round-downs don't put us below 1 satoshi-per-byte).
7849 * The following unit conversions can be used to convert to sats/KW:
7850 * * satoshis-per-byte * 250
7851 * * satoshis-per-kbyte / 4
7853 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
7855 * Frees any resources associated with this object given its this_arg pointer.
7856 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7858 void (*free)(void *this_arg);
7864 * Manager which keeps track of a number of channels and sends messages to the appropriate
7865 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
7867 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
7868 * to individual Channels.
7870 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
7871 * all peers during write/read (though does not modify this instance, only the instance being
7872 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
7873 * called funding_transaction_generated for outbound channels).
7875 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
7876 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
7877 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
7878 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
7879 * the serialization process). If the deserialized version is out-of-date compared to the
7880 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
7881 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
7883 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
7884 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
7885 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
7886 * block_connected() to step towards your best block) upon deserialization before using the
7889 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
7890 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
7891 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
7892 * offline for a full minute. In order to track this, you must call
7893 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
7895 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
7896 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
7897 * essentially you should default to using a SimpleRefChannelManager, and use a
7898 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
7899 * you're using lightning-net-tokio.
7901 typedef struct MUST_USE_STRUCT LDKChannelManager {
7903 * A pointer to the opaque Rust object.
7904 * Nearly everywhere, inner must be non-null, however in places where
7905 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7907 LDKnativeChannelManager *inner;
7909 * Indicates that this is the only struct which contains the same pointer.
7910 * Rust functions which take ownership of an object provided via an argument require
7911 * this to be true and invalidate the object pointed to by inner.
7914 } LDKChannelManager;
7917 * A tuple of 2 elements. See the individual fields for the types contained.
7919 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
7921 * The element at position 0
7923 struct LDKThirtyTwoBytes a;
7925 * The element at position 1
7927 struct LDKChannelManager b;
7928 } LDKC2Tuple_BlockHashChannelManagerZ;
7931 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
7933 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
7935 * A pointer to the contents in the success state.
7936 * Reading from this pointer when `result_ok` is not set is undefined.
7938 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
7940 * A pointer to the contents in the error state.
7941 * Reading from this pointer when `result_ok` is set is undefined.
7943 struct LDKDecodeError *err;
7944 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
7947 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
7948 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
7949 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7951 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
7953 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
7954 * `err` or `result` depending on the state of `result_ok`.
7956 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
7958 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
7961 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
7966 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
7967 * with our counterparty.
7969 typedef struct MUST_USE_STRUCT LDKChannelConfig {
7971 * A pointer to the opaque Rust object.
7972 * Nearly everywhere, inner must be non-null, however in places where
7973 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7975 LDKnativeChannelConfig *inner;
7977 * Indicates that this is the only struct which contains the same pointer.
7978 * Rust functions which take ownership of an object provided via an argument require
7979 * this to be true and invalidate the object pointed to by inner.
7985 * The contents of CResult_ChannelConfigDecodeErrorZ
7987 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
7989 * A pointer to the contents in the success state.
7990 * Reading from this pointer when `result_ok` is not set is undefined.
7992 struct LDKChannelConfig *result;
7994 * A pointer to the contents in the error state.
7995 * Reading from this pointer when `result_ok` is set is undefined.
7997 struct LDKDecodeError *err;
7998 } LDKCResult_ChannelConfigDecodeErrorZPtr;
8001 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
8002 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
8003 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8005 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
8007 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
8008 * `err` or `result` depending on the state of `result_ok`.
8010 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
8012 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
8015 } LDKCResult_ChannelConfigDecodeErrorZ;
8018 * The contents of CResult_OutPointDecodeErrorZ
8020 typedef union LDKCResult_OutPointDecodeErrorZPtr {
8022 * A pointer to the contents in the success state.
8023 * Reading from this pointer when `result_ok` is not set is undefined.
8025 struct LDKOutPoint *result;
8027 * A pointer to the contents in the error state.
8028 * Reading from this pointer when `result_ok` is set is undefined.
8030 struct LDKDecodeError *err;
8031 } LDKCResult_OutPointDecodeErrorZPtr;
8034 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
8035 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
8036 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8038 typedef struct LDKCResult_OutPointDecodeErrorZ {
8040 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
8041 * `err` or `result` depending on the state of `result_ok`.
8043 union LDKCResult_OutPointDecodeErrorZPtr contents;
8045 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
8048 } LDKCResult_OutPointDecodeErrorZ;
8051 * Defines a type identifier for sending messages over the wire.
8053 * Messages implementing this trait specify a type and must be [`Writeable`].
8055 typedef struct LDKType {
8057 * An opaque pointer which is passed to your function implementations as an argument.
8058 * This has no meaning in the LDK, and can be NULL or any other value.
8062 * Returns the type identifying the message payload.
8064 uint16_t (*type_id)(const void *this_arg);
8066 * Return a human-readable "debug" string describing this object
8068 struct LDKStr (*debug_str)(const void *this_arg);
8070 * Serialize the object into a byte array
8072 struct LDKCVec_u8Z (*write)(const void *this_arg);
8074 * Frees any resources associated with this object given its this_arg pointer.
8075 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8077 void (*free)(void *this_arg);
8081 * An enum which can either contain a crate::lightning::ln::wire::Type or not
8083 typedef enum LDKCOption_TypeZ_Tag {
8085 * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
8087 LDKCOption_TypeZ_Some,
8089 * When we're in this state, this COption_TypeZ contains nothing
8091 LDKCOption_TypeZ_None,
8093 * Must be last for serialization purposes
8095 LDKCOption_TypeZ_Sentinel,
8096 } LDKCOption_TypeZ_Tag;
8098 typedef struct LDKCOption_TypeZ {
8099 LDKCOption_TypeZ_Tag tag;
8102 struct LDKType some;
8108 * The contents of CResult_COption_TypeZDecodeErrorZ
8110 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
8112 * A pointer to the contents in the success state.
8113 * Reading from this pointer when `result_ok` is not set is undefined.
8115 struct LDKCOption_TypeZ *result;
8117 * A pointer to the contents in the error state.
8118 * Reading from this pointer when `result_ok` is set is undefined.
8120 struct LDKDecodeError *err;
8121 } LDKCResult_COption_TypeZDecodeErrorZPtr;
8124 * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
8125 * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
8126 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8128 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
8130 * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
8131 * `err` or `result` depending on the state of `result_ok`.
8133 union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
8135 * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
8138 } LDKCResult_COption_TypeZDecodeErrorZ;
8141 * An error that may occur when making a payment.
8143 typedef enum LDKPaymentError_Tag {
8145 * An error resulting from the provided [`Invoice`] or payment hash.
8147 LDKPaymentError_Invoice,
8149 * An error occurring when finding a route.
8151 LDKPaymentError_Routing,
8153 * An error occurring when sending a payment.
8155 LDKPaymentError_Sending,
8157 * Must be last for serialization purposes
8159 LDKPaymentError_Sentinel,
8160 } LDKPaymentError_Tag;
8162 typedef struct MUST_USE_STRUCT LDKPaymentError {
8163 LDKPaymentError_Tag tag;
8166 struct LDKStr invoice;
8169 struct LDKLightningError routing;
8172 struct LDKPaymentSendFailure sending;
8178 * The contents of CResult_PaymentIdPaymentErrorZ
8180 typedef union LDKCResult_PaymentIdPaymentErrorZPtr {
8182 * A pointer to the contents in the success state.
8183 * Reading from this pointer when `result_ok` is not set is undefined.
8185 struct LDKThirtyTwoBytes *result;
8187 * A pointer to the contents in the error state.
8188 * Reading from this pointer when `result_ok` is set is undefined.
8190 struct LDKPaymentError *err;
8191 } LDKCResult_PaymentIdPaymentErrorZPtr;
8194 * A CResult_PaymentIdPaymentErrorZ represents the result of a fallible operation,
8195 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning_invoice::payment::PaymentError on failure.
8196 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8198 typedef struct LDKCResult_PaymentIdPaymentErrorZ {
8200 * The contents of this CResult_PaymentIdPaymentErrorZ, accessible via either
8201 * `err` or `result` depending on the state of `result_ok`.
8203 union LDKCResult_PaymentIdPaymentErrorZPtr contents;
8205 * Whether this CResult_PaymentIdPaymentErrorZ represents a success state.
8208 } LDKCResult_PaymentIdPaymentErrorZ;
8211 * Sub-errors which don't have specific information in them use this type.
8213 typedef struct LDKError {
8215 * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
8221 * Errors that indicate what is wrong with the invoice. They have some granularity for debug
8222 * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
8224 typedef enum LDKParseError_Tag {
8225 LDKParseError_Bech32Error,
8226 LDKParseError_ParseAmountError,
8227 LDKParseError_MalformedSignature,
8228 LDKParseError_BadPrefix,
8229 LDKParseError_UnknownCurrency,
8230 LDKParseError_UnknownSiPrefix,
8231 LDKParseError_MalformedHRP,
8232 LDKParseError_TooShortDataPart,
8233 LDKParseError_UnexpectedEndOfTaggedFields,
8234 LDKParseError_DescriptionDecodeError,
8235 LDKParseError_PaddingError,
8236 LDKParseError_IntegerOverflowError,
8237 LDKParseError_InvalidSegWitProgramLength,
8238 LDKParseError_InvalidPubKeyHashLength,
8239 LDKParseError_InvalidScriptHashLength,
8240 LDKParseError_InvalidRecoveryId,
8241 LDKParseError_InvalidSliceLength,
8243 * Not an error, but used internally to signal that a part of the invoice should be ignored
8244 * according to BOLT11
8248 * Must be last for serialization purposes
8250 LDKParseError_Sentinel,
8251 } LDKParseError_Tag;
8253 typedef struct MUST_USE_STRUCT LDKParseError {
8254 LDKParseError_Tag tag;
8257 struct LDKBech32Error bech32_error;
8260 struct LDKError parse_amount_error;
8263 enum LDKSecp256k1Error malformed_signature;
8266 struct LDKError description_decode_error;
8269 struct LDKStr invalid_slice_length;
8275 * The contents of CResult_SiPrefixParseErrorZ
8277 typedef union LDKCResult_SiPrefixParseErrorZPtr {
8279 * A pointer to the contents in the success state.
8280 * Reading from this pointer when `result_ok` is not set is undefined.
8282 enum LDKSiPrefix *result;
8284 * A pointer to the contents in the error state.
8285 * Reading from this pointer when `result_ok` is set is undefined.
8287 struct LDKParseError *err;
8288 } LDKCResult_SiPrefixParseErrorZPtr;
8291 * A CResult_SiPrefixParseErrorZ represents the result of a fallible operation,
8292 * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::ParseError on failure.
8293 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8295 typedef struct LDKCResult_SiPrefixParseErrorZ {
8297 * The contents of this CResult_SiPrefixParseErrorZ, accessible via either
8298 * `err` or `result` depending on the state of `result_ok`.
8300 union LDKCResult_SiPrefixParseErrorZPtr contents;
8302 * Whether this CResult_SiPrefixParseErrorZ represents a success state.
8305 } LDKCResult_SiPrefixParseErrorZ;
8310 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
8312 * There are three ways to construct an `Invoice`:
8313 * 1. using `InvoiceBuilder`
8314 * 2. using `Invoice::from_signed(SignedRawInvoice)`
8315 * 3. using `str::parse::<Invoice>(&str)`
8317 typedef struct MUST_USE_STRUCT LDKInvoice {
8319 * A pointer to the opaque Rust object.
8320 * Nearly everywhere, inner must be non-null, however in places where
8321 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8323 LDKnativeInvoice *inner;
8325 * Indicates that this is the only struct which contains the same pointer.
8326 * Rust functions which take ownership of an object provided via an argument require
8327 * this to be true and invalidate the object pointed to by inner.
8333 * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
8334 * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
8335 * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
8337 typedef enum LDKParseOrSemanticError_Tag {
8339 * The invoice couldn't be decoded
8341 LDKParseOrSemanticError_ParseError,
8343 * The invoice could be decoded but violates the BOLT11 standard
8345 LDKParseOrSemanticError_SemanticError,
8347 * Must be last for serialization purposes
8349 LDKParseOrSemanticError_Sentinel,
8350 } LDKParseOrSemanticError_Tag;
8352 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
8353 LDKParseOrSemanticError_Tag tag;
8356 struct LDKParseError parse_error;
8359 enum LDKSemanticError semantic_error;
8362 } LDKParseOrSemanticError;
8365 * The contents of CResult_InvoiceParseOrSemanticErrorZ
8367 typedef union LDKCResult_InvoiceParseOrSemanticErrorZPtr {
8369 * A pointer to the contents in the success state.
8370 * Reading from this pointer when `result_ok` is not set is undefined.
8372 struct LDKInvoice *result;
8374 * A pointer to the contents in the error state.
8375 * Reading from this pointer when `result_ok` is set is undefined.
8377 struct LDKParseOrSemanticError *err;
8378 } LDKCResult_InvoiceParseOrSemanticErrorZPtr;
8381 * A CResult_InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
8382 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
8383 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8385 typedef struct LDKCResult_InvoiceParseOrSemanticErrorZ {
8387 * The contents of this CResult_InvoiceParseOrSemanticErrorZ, accessible via either
8388 * `err` or `result` depending on the state of `result_ok`.
8390 union LDKCResult_InvoiceParseOrSemanticErrorZPtr contents;
8392 * Whether this CResult_InvoiceParseOrSemanticErrorZ represents a success state.
8395 } LDKCResult_InvoiceParseOrSemanticErrorZ;
8400 * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
8404 * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
8406 typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
8408 * A pointer to the opaque Rust object.
8409 * Nearly everywhere, inner must be non-null, however in places where
8410 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8412 LDKnativeSignedRawInvoice *inner;
8414 * Indicates that this is the only struct which contains the same pointer.
8415 * Rust functions which take ownership of an object provided via an argument require
8416 * this to be true and invalidate the object pointed to by inner.
8419 } LDKSignedRawInvoice;
8422 * The contents of CResult_SignedRawInvoiceParseErrorZ
8424 typedef union LDKCResult_SignedRawInvoiceParseErrorZPtr {
8426 * A pointer to the contents in the success state.
8427 * Reading from this pointer when `result_ok` is not set is undefined.
8429 struct LDKSignedRawInvoice *result;
8431 * A pointer to the contents in the error state.
8432 * Reading from this pointer when `result_ok` is set is undefined.
8434 struct LDKParseError *err;
8435 } LDKCResult_SignedRawInvoiceParseErrorZPtr;
8438 * A CResult_SignedRawInvoiceParseErrorZ represents the result of a fallible operation,
8439 * containing a crate::lightning_invoice::SignedRawInvoice on success and a crate::lightning_invoice::ParseError on failure.
8440 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8442 typedef struct LDKCResult_SignedRawInvoiceParseErrorZ {
8444 * The contents of this CResult_SignedRawInvoiceParseErrorZ, accessible via either
8445 * `err` or `result` depending on the state of `result_ok`.
8447 union LDKCResult_SignedRawInvoiceParseErrorZPtr contents;
8449 * Whether this CResult_SignedRawInvoiceParseErrorZ represents a success state.
8452 } LDKCResult_SignedRawInvoiceParseErrorZ;
8457 * Represents an syntactically correct Invoice for a payment on the lightning network,
8458 * but without the signature information.
8459 * De- and encoding should not lead to information loss but may lead to different hashes.
8461 * For methods without docs see the corresponding methods in `Invoice`.
8463 typedef struct MUST_USE_STRUCT LDKRawInvoice {
8465 * A pointer to the opaque Rust object.
8466 * Nearly everywhere, inner must be non-null, however in places where
8467 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8469 LDKnativeRawInvoice *inner;
8471 * Indicates that this is the only struct which contains the same pointer.
8472 * Rust functions which take ownership of an object provided via an argument require
8473 * this to be true and invalidate the object pointed to by inner.
8481 * Recoverable signature
8483 typedef struct MUST_USE_STRUCT LDKInvoiceSignature {
8485 * A pointer to the opaque Rust object.
8486 * Nearly everywhere, inner must be non-null, however in places where
8487 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8489 LDKnativeInvoiceSignature *inner;
8491 * Indicates that this is the only struct which contains the same pointer.
8492 * Rust functions which take ownership of an object provided via an argument require
8493 * this to be true and invalidate the object pointed to by inner.
8496 } LDKInvoiceSignature;
8499 * A tuple of 3 elements. See the individual fields for the types contained.
8501 typedef struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ {
8503 * The element at position 0
8505 struct LDKRawInvoice a;
8507 * The element at position 1
8509 struct LDKThirtyTwoBytes b;
8511 * The element at position 2
8513 struct LDKInvoiceSignature c;
8514 } LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ;
8521 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
8523 * A pointer to the opaque Rust object.
8524 * Nearly everywhere, inner must be non-null, however in places where
8525 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8527 LDKnativePayeePubKey *inner;
8529 * Indicates that this is the only struct which contains the same pointer.
8530 * Rust functions which take ownership of an object provided via an argument require
8531 * this to be true and invalidate the object pointed to by inner.
8537 * The contents of CResult_PayeePubKeyErrorZ
8539 typedef union LDKCResult_PayeePubKeyErrorZPtr {
8541 * A pointer to the contents in the success state.
8542 * Reading from this pointer when `result_ok` is not set is undefined.
8544 struct LDKPayeePubKey *result;
8546 * A pointer to the contents in the error state.
8547 * Reading from this pointer when `result_ok` is set is undefined.
8549 enum LDKSecp256k1Error *err;
8550 } LDKCResult_PayeePubKeyErrorZPtr;
8553 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
8554 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
8555 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8557 typedef struct LDKCResult_PayeePubKeyErrorZ {
8559 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
8560 * `err` or `result` depending on the state of `result_ok`.
8562 union LDKCResult_PayeePubKeyErrorZPtr contents;
8564 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
8567 } LDKCResult_PayeePubKeyErrorZ;
8572 * Private routing information
8575 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
8578 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
8580 * A pointer to the opaque Rust object.
8581 * Nearly everywhere, inner must be non-null, however in places where
8582 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8584 LDKnativePrivateRoute *inner;
8586 * Indicates that this is the only struct which contains the same pointer.
8587 * Rust functions which take ownership of an object provided via an argument require
8588 * this to be true and invalidate the object pointed to by inner.
8594 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
8595 * This corresponds to std::vector in C++
8597 typedef struct LDKCVec_PrivateRouteZ {
8599 * The elements in the array.
8600 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8602 struct LDKPrivateRoute *data;
8604 * The number of elements pointed to by `data`.
8607 } LDKCVec_PrivateRouteZ;
8612 * A timestamp that refers to a date after 1 January 1970.
8616 * The Unix timestamp representing the stored time has to be positive and no greater than
8617 * [`MAX_TIMESTAMP`].
8619 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
8621 * A pointer to the opaque Rust object.
8622 * Nearly everywhere, inner must be non-null, however in places where
8623 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8625 LDKnativePositiveTimestamp *inner;
8627 * Indicates that this is the only struct which contains the same pointer.
8628 * Rust functions which take ownership of an object provided via an argument require
8629 * this to be true and invalidate the object pointed to by inner.
8632 } LDKPositiveTimestamp;
8635 * The contents of CResult_PositiveTimestampCreationErrorZ
8637 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
8639 * A pointer to the contents in the success state.
8640 * Reading from this pointer when `result_ok` is not set is undefined.
8642 struct LDKPositiveTimestamp *result;
8644 * A pointer to the contents in the error state.
8645 * Reading from this pointer when `result_ok` is set is undefined.
8647 enum LDKCreationError *err;
8648 } LDKCResult_PositiveTimestampCreationErrorZPtr;
8651 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
8652 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
8653 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8655 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
8657 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
8658 * `err` or `result` depending on the state of `result_ok`.
8660 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
8662 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
8665 } LDKCResult_PositiveTimestampCreationErrorZ;
8668 * The contents of CResult_NoneSemanticErrorZ
8670 typedef union LDKCResult_NoneSemanticErrorZPtr {
8672 * Note that this value is always NULL, as there are no contents in the OK variant
8676 * A pointer to the contents in the error state.
8677 * Reading from this pointer when `result_ok` is set is undefined.
8679 enum LDKSemanticError *err;
8680 } LDKCResult_NoneSemanticErrorZPtr;
8683 * A CResult_NoneSemanticErrorZ represents the result of a fallible operation,
8684 * containing a () on success and a crate::lightning_invoice::SemanticError on failure.
8685 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8687 typedef struct LDKCResult_NoneSemanticErrorZ {
8689 * The contents of this CResult_NoneSemanticErrorZ, accessible via either
8690 * `err` or `result` depending on the state of `result_ok`.
8692 union LDKCResult_NoneSemanticErrorZPtr contents;
8694 * Whether this CResult_NoneSemanticErrorZ represents a success state.
8697 } LDKCResult_NoneSemanticErrorZ;
8700 * The contents of CResult_InvoiceSemanticErrorZ
8702 typedef union LDKCResult_InvoiceSemanticErrorZPtr {
8704 * A pointer to the contents in the success state.
8705 * Reading from this pointer when `result_ok` is not set is undefined.
8707 struct LDKInvoice *result;
8709 * A pointer to the contents in the error state.
8710 * Reading from this pointer when `result_ok` is set is undefined.
8712 enum LDKSemanticError *err;
8713 } LDKCResult_InvoiceSemanticErrorZPtr;
8716 * A CResult_InvoiceSemanticErrorZ represents the result of a fallible operation,
8717 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SemanticError on failure.
8718 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8720 typedef struct LDKCResult_InvoiceSemanticErrorZ {
8722 * The contents of this CResult_InvoiceSemanticErrorZ, accessible via either
8723 * `err` or `result` depending on the state of `result_ok`.
8725 union LDKCResult_InvoiceSemanticErrorZPtr contents;
8727 * Whether this CResult_InvoiceSemanticErrorZ represents a success state.
8730 } LDKCResult_InvoiceSemanticErrorZ;
8735 * Description string
8738 * The description can be at most 639 __bytes__ long
8740 typedef struct MUST_USE_STRUCT LDKDescription {
8742 * A pointer to the opaque Rust object.
8743 * Nearly everywhere, inner must be non-null, however in places where
8744 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8746 LDKnativeDescription *inner;
8748 * Indicates that this is the only struct which contains the same pointer.
8749 * Rust functions which take ownership of an object provided via an argument require
8750 * this to be true and invalidate the object pointed to by inner.
8756 * The contents of CResult_DescriptionCreationErrorZ
8758 typedef union LDKCResult_DescriptionCreationErrorZPtr {
8760 * A pointer to the contents in the success state.
8761 * Reading from this pointer when `result_ok` is not set is undefined.
8763 struct LDKDescription *result;
8765 * A pointer to the contents in the error state.
8766 * Reading from this pointer when `result_ok` is set is undefined.
8768 enum LDKCreationError *err;
8769 } LDKCResult_DescriptionCreationErrorZPtr;
8772 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
8773 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
8774 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8776 typedef struct LDKCResult_DescriptionCreationErrorZ {
8778 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
8779 * `err` or `result` depending on the state of `result_ok`.
8781 union LDKCResult_DescriptionCreationErrorZPtr contents;
8783 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
8786 } LDKCResult_DescriptionCreationErrorZ;
8789 * The contents of CResult_PrivateRouteCreationErrorZ
8791 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
8793 * A pointer to the contents in the success state.
8794 * Reading from this pointer when `result_ok` is not set is undefined.
8796 struct LDKPrivateRoute *result;
8798 * A pointer to the contents in the error state.
8799 * Reading from this pointer when `result_ok` is set is undefined.
8801 enum LDKCreationError *err;
8802 } LDKCResult_PrivateRouteCreationErrorZPtr;
8805 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
8806 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
8807 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8809 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
8811 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
8812 * `err` or `result` depending on the state of `result_ok`.
8814 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
8816 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
8819 } LDKCResult_PrivateRouteCreationErrorZ;
8822 * The contents of CResult_StringErrorZ
8824 typedef union LDKCResult_StringErrorZPtr {
8826 * A pointer to the contents in the success state.
8827 * Reading from this pointer when `result_ok` is not set is undefined.
8829 struct LDKStr *result;
8831 * A pointer to the contents in the error state.
8832 * Reading from this pointer when `result_ok` is set is undefined.
8834 enum LDKSecp256k1Error *err;
8835 } LDKCResult_StringErrorZPtr;
8838 * A CResult_StringErrorZ represents the result of a fallible operation,
8839 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
8840 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8842 typedef struct LDKCResult_StringErrorZ {
8844 * The contents of this CResult_StringErrorZ, accessible via either
8845 * `err` or `result` depending on the state of `result_ok`.
8847 union LDKCResult_StringErrorZPtr contents;
8849 * Whether this CResult_StringErrorZ represents a success state.
8852 } LDKCResult_StringErrorZ;
8855 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
8857 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
8859 * A pointer to the contents in the success state.
8860 * Reading from this pointer when `result_ok` is not set is undefined.
8862 struct LDKChannelMonitorUpdate *result;
8864 * A pointer to the contents in the error state.
8865 * Reading from this pointer when `result_ok` is set is undefined.
8867 struct LDKDecodeError *err;
8868 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
8871 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
8872 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
8873 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8875 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
8877 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
8878 * `err` or `result` depending on the state of `result_ok`.
8880 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
8882 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
8885 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
8888 * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
8890 typedef enum LDKCOption_MonitorEventZ_Tag {
8892 * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
8894 LDKCOption_MonitorEventZ_Some,
8896 * When we're in this state, this COption_MonitorEventZ contains nothing
8898 LDKCOption_MonitorEventZ_None,
8900 * Must be last for serialization purposes
8902 LDKCOption_MonitorEventZ_Sentinel,
8903 } LDKCOption_MonitorEventZ_Tag;
8905 typedef struct LDKCOption_MonitorEventZ {
8906 LDKCOption_MonitorEventZ_Tag tag;
8909 struct LDKMonitorEvent some;
8912 } LDKCOption_MonitorEventZ;
8915 * The contents of CResult_COption_MonitorEventZDecodeErrorZ
8917 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
8919 * A pointer to the contents in the success state.
8920 * Reading from this pointer when `result_ok` is not set is undefined.
8922 struct LDKCOption_MonitorEventZ *result;
8924 * A pointer to the contents in the error state.
8925 * Reading from this pointer when `result_ok` is set is undefined.
8927 struct LDKDecodeError *err;
8928 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
8931 * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
8932 * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
8933 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8935 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
8937 * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
8938 * `err` or `result` depending on the state of `result_ok`.
8940 union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
8942 * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
8945 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
8948 * The contents of CResult_HTLCUpdateDecodeErrorZ
8950 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
8952 * A pointer to the contents in the success state.
8953 * Reading from this pointer when `result_ok` is not set is undefined.
8955 struct LDKHTLCUpdate *result;
8957 * A pointer to the contents in the error state.
8958 * Reading from this pointer when `result_ok` is set is undefined.
8960 struct LDKDecodeError *err;
8961 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
8964 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
8965 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
8966 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8968 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
8970 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
8971 * `err` or `result` depending on the state of `result_ok`.
8973 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
8975 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
8978 } LDKCResult_HTLCUpdateDecodeErrorZ;
8981 * A tuple of 2 elements. See the individual fields for the types contained.
8983 typedef struct LDKC2Tuple_OutPointScriptZ {
8985 * The element at position 0
8987 struct LDKOutPoint a;
8989 * The element at position 1
8991 struct LDKCVec_u8Z b;
8992 } LDKC2Tuple_OutPointScriptZ;
8995 * A tuple of 2 elements. See the individual fields for the types contained.
8997 typedef struct LDKC2Tuple_u32ScriptZ {
8999 * The element at position 0
9003 * The element at position 1
9005 struct LDKCVec_u8Z b;
9006 } LDKC2Tuple_u32ScriptZ;
9009 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
9010 * This corresponds to std::vector in C++
9012 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
9014 * The elements in the array.
9015 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9017 struct LDKC2Tuple_u32ScriptZ *data;
9019 * The number of elements pointed to by `data`.
9022 } LDKCVec_C2Tuple_u32ScriptZZ;
9025 * A tuple of 2 elements. See the individual fields for the types contained.
9027 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
9029 * The element at position 0
9031 struct LDKThirtyTwoBytes a;
9033 * The element at position 1
9035 struct LDKCVec_C2Tuple_u32ScriptZZ b;
9036 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
9039 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
9040 * This corresponds to std::vector in C++
9042 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
9044 * The elements in the array.
9045 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9047 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
9049 * The number of elements pointed to by `data`.
9052 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
9055 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
9056 * This corresponds to std::vector in C++
9058 typedef struct LDKCVec_EventZ {
9060 * The elements in the array.
9061 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9063 struct LDKEvent *data;
9065 * The number of elements pointed to by `data`.
9071 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
9072 * This corresponds to std::vector in C++
9074 typedef struct LDKCVec_TransactionZ {
9076 * The elements in the array.
9077 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9079 struct LDKTransaction *data;
9081 * The number of elements pointed to by `data`.
9084 } LDKCVec_TransactionZ;
9087 * A tuple of 2 elements. See the individual fields for the types contained.
9089 typedef struct LDKC2Tuple_u32TxOutZ {
9091 * The element at position 0
9095 * The element at position 1
9098 } LDKC2Tuple_u32TxOutZ;
9101 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
9102 * This corresponds to std::vector in C++
9104 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
9106 * The elements in the array.
9107 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9109 struct LDKC2Tuple_u32TxOutZ *data;
9111 * The number of elements pointed to by `data`.
9114 } LDKCVec_C2Tuple_u32TxOutZZ;
9117 * A tuple of 2 elements. See the individual fields for the types contained.
9119 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
9121 * The element at position 0
9123 struct LDKThirtyTwoBytes a;
9125 * The element at position 1
9127 struct LDKCVec_C2Tuple_u32TxOutZZ b;
9128 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
9131 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
9132 * This corresponds to std::vector in C++
9134 typedef struct LDKCVec_TransactionOutputsZ {
9136 * The elements in the array.
9137 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9139 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
9141 * The number of elements pointed to by `data`.
9144 } LDKCVec_TransactionOutputsZ;
9147 * Details about the balance(s) available for spending once the channel appears on chain.
9149 * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
9152 typedef enum LDKBalance_Tag {
9154 * The channel is not yet closed (or the commitment or closing transaction has not yet
9155 * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
9158 LDKBalance_ClaimableOnChannelClose,
9160 * The channel has been closed, and the given balance is ours but awaiting confirmations until
9161 * we consider it spendable.
9163 LDKBalance_ClaimableAwaitingConfirmations,
9165 * The channel has been closed, and the given balance should be ours but awaiting spending
9166 * transaction confirmation. If the spending transaction does not confirm in time, it is
9167 * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
9169 * Once the spending transaction confirms, before it has reached enough confirmations to be
9170 * considered safe from chain reorganizations, the balance will instead be provided via
9171 * [`Balance::ClaimableAwaitingConfirmations`].
9173 LDKBalance_ContentiousClaimable,
9175 * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
9176 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
9177 * likely to be claimed by our counterparty before we do.
9179 LDKBalance_MaybeClaimableHTLCAwaitingTimeout,
9181 * Must be last for serialization purposes
9183 LDKBalance_Sentinel,
9186 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
9188 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
9189 * required to do so.
9191 uint64_t claimable_amount_satoshis;
9192 } LDKBalance_LDKClaimableOnChannelClose_Body;
9194 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
9196 * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
9197 * were spent in broadcasting the transaction.
9199 uint64_t claimable_amount_satoshis;
9201 * The height at which an [`Event::SpendableOutputs`] event will be generated for this
9204 uint32_t confirmation_height;
9205 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
9207 typedef struct LDKBalance_LDKContentiousClaimable_Body {
9209 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
9210 * required to do so.
9212 uint64_t claimable_amount_satoshis;
9214 * The height at which the counterparty may be able to claim the balance if we have not
9217 uint32_t timeout_height;
9218 } LDKBalance_LDKContentiousClaimable_Body;
9220 typedef struct LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body {
9222 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
9223 * required to do so.
9225 uint64_t claimable_amount_satoshis;
9227 * The height at which we will be able to claim the balance if our counterparty has not
9230 uint32_t claimable_height;
9231 } LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body;
9233 typedef struct MUST_USE_STRUCT LDKBalance {
9236 LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
9237 LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
9238 LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
9239 LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body maybe_claimable_htlc_awaiting_timeout;
9244 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
9245 * This corresponds to std::vector in C++
9247 typedef struct LDKCVec_BalanceZ {
9249 * The elements in the array.
9250 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9252 struct LDKBalance *data;
9254 * The number of elements pointed to by `data`.
9260 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
9262 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
9264 * A pointer to the contents in the success state.
9265 * Reading from this pointer when `result_ok` is not set is undefined.
9267 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
9269 * A pointer to the contents in the error state.
9270 * Reading from this pointer when `result_ok` is set is undefined.
9272 struct LDKDecodeError *err;
9273 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
9276 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
9277 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9278 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9280 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
9282 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
9283 * `err` or `result` depending on the state of `result_ok`.
9285 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
9287 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
9290 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
9293 * A tuple of 2 elements. See the individual fields for the types contained.
9295 typedef struct LDKC2Tuple_PublicKeyTypeZ {
9297 * The element at position 0
9299 struct LDKPublicKey a;
9301 * The element at position 1
9304 } LDKC2Tuple_PublicKeyTypeZ;
9307 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
9308 * This corresponds to std::vector in C++
9310 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
9312 * The elements in the array.
9313 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9315 struct LDKC2Tuple_PublicKeyTypeZ *data;
9317 * The number of elements pointed to by `data`.
9320 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
9323 * An enum which can either contain a crate::lightning::ln::msgs::NetAddress or not
9325 typedef enum LDKCOption_NetAddressZ_Tag {
9327 * When we're in this state, this COption_NetAddressZ contains a crate::lightning::ln::msgs::NetAddress
9329 LDKCOption_NetAddressZ_Some,
9331 * When we're in this state, this COption_NetAddressZ contains nothing
9333 LDKCOption_NetAddressZ_None,
9335 * Must be last for serialization purposes
9337 LDKCOption_NetAddressZ_Sentinel,
9338 } LDKCOption_NetAddressZ_Tag;
9340 typedef struct LDKCOption_NetAddressZ {
9341 LDKCOption_NetAddressZ_Tag tag;
9344 struct LDKNetAddress some;
9347 } LDKCOption_NetAddressZ;
9352 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
9353 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
9356 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
9358 * A pointer to the opaque Rust object.
9359 * Nearly everywhere, inner must be non-null, however in places where
9360 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9362 LDKnativePeerHandleError *inner;
9364 * Indicates that this is the only struct which contains the same pointer.
9365 * Rust functions which take ownership of an object provided via an argument require
9366 * this to be true and invalidate the object pointed to by inner.
9369 } LDKPeerHandleError;
9372 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
9374 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
9376 * A pointer to the contents in the success state.
9377 * Reading from this pointer when `result_ok` is not set is undefined.
9379 struct LDKCVec_u8Z *result;
9381 * A pointer to the contents in the error state.
9382 * Reading from this pointer when `result_ok` is set is undefined.
9384 struct LDKPeerHandleError *err;
9385 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
9388 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
9389 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9390 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9392 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
9394 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
9395 * `err` or `result` depending on the state of `result_ok`.
9397 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
9399 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
9402 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
9405 * The contents of CResult_NonePeerHandleErrorZ
9407 typedef union LDKCResult_NonePeerHandleErrorZPtr {
9409 * Note that this value is always NULL, as there are no contents in the OK variant
9413 * A pointer to the contents in the error state.
9414 * Reading from this pointer when `result_ok` is set is undefined.
9416 struct LDKPeerHandleError *err;
9417 } LDKCResult_NonePeerHandleErrorZPtr;
9420 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
9421 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9422 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9424 typedef struct LDKCResult_NonePeerHandleErrorZ {
9426 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
9427 * `err` or `result` depending on the state of `result_ok`.
9429 union LDKCResult_NonePeerHandleErrorZPtr contents;
9431 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
9434 } LDKCResult_NonePeerHandleErrorZ;
9437 * The contents of CResult_boolPeerHandleErrorZ
9439 typedef union LDKCResult_boolPeerHandleErrorZPtr {
9441 * A pointer to the contents in the success state.
9442 * Reading from this pointer when `result_ok` is not set is undefined.
9446 * A pointer to the contents in the error state.
9447 * Reading from this pointer when `result_ok` is set is undefined.
9449 struct LDKPeerHandleError *err;
9450 } LDKCResult_boolPeerHandleErrorZPtr;
9453 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
9454 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9455 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9457 typedef struct LDKCResult_boolPeerHandleErrorZ {
9459 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
9460 * `err` or `result` depending on the state of `result_ok`.
9462 union LDKCResult_boolPeerHandleErrorZPtr contents;
9464 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
9467 } LDKCResult_boolPeerHandleErrorZ;
9470 * All-encompassing standard error type that processing can return
9472 typedef enum LDKGraphSyncError_Tag {
9474 * Error trying to read the update data, typically due to an erroneous data length indication
9475 * that is greater than the actual amount of data provided
9477 LDKGraphSyncError_DecodeError,
9479 * Error applying the patch to the network graph, usually the result of updates that are too
9480 * old or missing prerequisite data to the application of updates out of order
9482 LDKGraphSyncError_LightningError,
9484 * Must be last for serialization purposes
9486 LDKGraphSyncError_Sentinel,
9487 } LDKGraphSyncError_Tag;
9489 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
9490 LDKGraphSyncError_Tag tag;
9493 struct LDKDecodeError decode_error;
9496 struct LDKLightningError lightning_error;
9499 } LDKGraphSyncError;
9502 * The contents of CResult_u32GraphSyncErrorZ
9504 typedef union LDKCResult_u32GraphSyncErrorZPtr {
9506 * A pointer to the contents in the success state.
9507 * Reading from this pointer when `result_ok` is not set is undefined.
9511 * A pointer to the contents in the error state.
9512 * Reading from this pointer when `result_ok` is set is undefined.
9514 struct LDKGraphSyncError *err;
9515 } LDKCResult_u32GraphSyncErrorZPtr;
9518 * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
9519 * containing a u32 on success and a crate::lightning_rapid_gossip_sync::error::GraphSyncError on failure.
9520 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9522 typedef struct LDKCResult_u32GraphSyncErrorZ {
9524 * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
9525 * `err` or `result` depending on the state of `result_ok`.
9527 union LDKCResult_u32GraphSyncErrorZPtr contents;
9529 * Whether this CResult_u32GraphSyncErrorZ represents a success state.
9532 } LDKCResult_u32GraphSyncErrorZ;
9535 * The contents of CResult_NetAddressDecodeErrorZ
9537 typedef union LDKCResult_NetAddressDecodeErrorZPtr {
9539 * A pointer to the contents in the success state.
9540 * Reading from this pointer when `result_ok` is not set is undefined.
9542 struct LDKNetAddress *result;
9544 * A pointer to the contents in the error state.
9545 * Reading from this pointer when `result_ok` is set is undefined.
9547 struct LDKDecodeError *err;
9548 } LDKCResult_NetAddressDecodeErrorZPtr;
9551 * A CResult_NetAddressDecodeErrorZ represents the result of a fallible operation,
9552 * containing a crate::lightning::ln::msgs::NetAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
9553 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9555 typedef struct LDKCResult_NetAddressDecodeErrorZ {
9557 * The contents of this CResult_NetAddressDecodeErrorZ, accessible via either
9558 * `err` or `result` depending on the state of `result_ok`.
9560 union LDKCResult_NetAddressDecodeErrorZPtr contents;
9562 * Whether this CResult_NetAddressDecodeErrorZ represents a success state.
9565 } LDKCResult_NetAddressDecodeErrorZ;
9570 * An update_add_htlc message to be sent or received from a peer
9572 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
9574 * A pointer to the opaque Rust object.
9575 * Nearly everywhere, inner must be non-null, however in places where
9576 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9578 LDKnativeUpdateAddHTLC *inner;
9580 * Indicates that this is the only struct which contains the same pointer.
9581 * Rust functions which take ownership of an object provided via an argument require
9582 * this to be true and invalidate the object pointed to by inner.
9588 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
9589 * This corresponds to std::vector in C++
9591 typedef struct LDKCVec_UpdateAddHTLCZ {
9593 * The elements in the array.
9594 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9596 struct LDKUpdateAddHTLC *data;
9598 * The number of elements pointed to by `data`.
9601 } LDKCVec_UpdateAddHTLCZ;
9606 * An update_fulfill_htlc message to be sent or received from a peer
9608 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
9610 * A pointer to the opaque Rust object.
9611 * Nearly everywhere, inner must be non-null, however in places where
9612 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9614 LDKnativeUpdateFulfillHTLC *inner;
9616 * Indicates that this is the only struct which contains the same pointer.
9617 * Rust functions which take ownership of an object provided via an argument require
9618 * this to be true and invalidate the object pointed to by inner.
9621 } LDKUpdateFulfillHTLC;
9624 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
9625 * This corresponds to std::vector in C++
9627 typedef struct LDKCVec_UpdateFulfillHTLCZ {
9629 * The elements in the array.
9630 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9632 struct LDKUpdateFulfillHTLC *data;
9634 * The number of elements pointed to by `data`.
9637 } LDKCVec_UpdateFulfillHTLCZ;
9642 * An update_fail_htlc message to be sent or received from a peer
9644 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
9646 * A pointer to the opaque Rust object.
9647 * Nearly everywhere, inner must be non-null, however in places where
9648 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9650 LDKnativeUpdateFailHTLC *inner;
9652 * Indicates that this is the only struct which contains the same pointer.
9653 * Rust functions which take ownership of an object provided via an argument require
9654 * this to be true and invalidate the object pointed to by inner.
9657 } LDKUpdateFailHTLC;
9660 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
9661 * This corresponds to std::vector in C++
9663 typedef struct LDKCVec_UpdateFailHTLCZ {
9665 * The elements in the array.
9666 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9668 struct LDKUpdateFailHTLC *data;
9670 * The number of elements pointed to by `data`.
9673 } LDKCVec_UpdateFailHTLCZ;
9678 * An update_fail_malformed_htlc message to be sent or received from a peer
9680 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
9682 * A pointer to the opaque Rust object.
9683 * Nearly everywhere, inner must be non-null, however in places where
9684 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9686 LDKnativeUpdateFailMalformedHTLC *inner;
9688 * Indicates that this is the only struct which contains the same pointer.
9689 * Rust functions which take ownership of an object provided via an argument require
9690 * this to be true and invalidate the object pointed to by inner.
9693 } LDKUpdateFailMalformedHTLC;
9696 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
9697 * This corresponds to std::vector in C++
9699 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
9701 * The elements in the array.
9702 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9704 struct LDKUpdateFailMalformedHTLC *data;
9706 * The number of elements pointed to by `data`.
9709 } LDKCVec_UpdateFailMalformedHTLCZ;
9712 * The contents of CResult_AcceptChannelDecodeErrorZ
9714 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
9716 * A pointer to the contents in the success state.
9717 * Reading from this pointer when `result_ok` is not set is undefined.
9719 struct LDKAcceptChannel *result;
9721 * A pointer to the contents in the error state.
9722 * Reading from this pointer when `result_ok` is set is undefined.
9724 struct LDKDecodeError *err;
9725 } LDKCResult_AcceptChannelDecodeErrorZPtr;
9728 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
9729 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
9730 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9732 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
9734 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
9735 * `err` or `result` depending on the state of `result_ok`.
9737 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
9739 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
9742 } LDKCResult_AcceptChannelDecodeErrorZ;
9745 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
9747 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
9749 * A pointer to the contents in the success state.
9750 * Reading from this pointer when `result_ok` is not set is undefined.
9752 struct LDKAnnouncementSignatures *result;
9754 * A pointer to the contents in the error state.
9755 * Reading from this pointer when `result_ok` is set is undefined.
9757 struct LDKDecodeError *err;
9758 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
9761 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
9762 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
9763 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9765 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
9767 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
9768 * `err` or `result` depending on the state of `result_ok`.
9770 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
9772 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
9775 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
9778 * The contents of CResult_ChannelReestablishDecodeErrorZ
9780 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
9782 * A pointer to the contents in the success state.
9783 * Reading from this pointer when `result_ok` is not set is undefined.
9785 struct LDKChannelReestablish *result;
9787 * A pointer to the contents in the error state.
9788 * Reading from this pointer when `result_ok` is set is undefined.
9790 struct LDKDecodeError *err;
9791 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
9794 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
9795 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
9796 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9798 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
9800 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
9801 * `err` or `result` depending on the state of `result_ok`.
9803 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
9805 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
9808 } LDKCResult_ChannelReestablishDecodeErrorZ;
9811 * The contents of CResult_ClosingSignedDecodeErrorZ
9813 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
9815 * A pointer to the contents in the success state.
9816 * Reading from this pointer when `result_ok` is not set is undefined.
9818 struct LDKClosingSigned *result;
9820 * A pointer to the contents in the error state.
9821 * Reading from this pointer when `result_ok` is set is undefined.
9823 struct LDKDecodeError *err;
9824 } LDKCResult_ClosingSignedDecodeErrorZPtr;
9827 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
9828 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
9829 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9831 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
9833 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
9834 * `err` or `result` depending on the state of `result_ok`.
9836 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
9838 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
9841 } LDKCResult_ClosingSignedDecodeErrorZ;
9846 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
9847 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
9850 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
9852 * A pointer to the opaque Rust object.
9853 * Nearly everywhere, inner must be non-null, however in places where
9854 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9856 LDKnativeClosingSignedFeeRange *inner;
9858 * Indicates that this is the only struct which contains the same pointer.
9859 * Rust functions which take ownership of an object provided via an argument require
9860 * this to be true and invalidate the object pointed to by inner.
9863 } LDKClosingSignedFeeRange;
9866 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
9868 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
9870 * A pointer to the contents in the success state.
9871 * Reading from this pointer when `result_ok` is not set is undefined.
9873 struct LDKClosingSignedFeeRange *result;
9875 * A pointer to the contents in the error state.
9876 * Reading from this pointer when `result_ok` is set is undefined.
9878 struct LDKDecodeError *err;
9879 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
9882 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
9883 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
9884 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9886 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
9888 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
9889 * `err` or `result` depending on the state of `result_ok`.
9891 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
9893 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
9896 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
9901 * A commitment_signed message to be sent or received from a peer
9903 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
9905 * A pointer to the opaque Rust object.
9906 * Nearly everywhere, inner must be non-null, however in places where
9907 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9909 LDKnativeCommitmentSigned *inner;
9911 * Indicates that this is the only struct which contains the same pointer.
9912 * Rust functions which take ownership of an object provided via an argument require
9913 * this to be true and invalidate the object pointed to by inner.
9916 } LDKCommitmentSigned;
9919 * The contents of CResult_CommitmentSignedDecodeErrorZ
9921 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
9923 * A pointer to the contents in the success state.
9924 * Reading from this pointer when `result_ok` is not set is undefined.
9926 struct LDKCommitmentSigned *result;
9928 * A pointer to the contents in the error state.
9929 * Reading from this pointer when `result_ok` is set is undefined.
9931 struct LDKDecodeError *err;
9932 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
9935 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
9936 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
9937 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9939 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
9941 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
9942 * `err` or `result` depending on the state of `result_ok`.
9944 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
9946 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
9949 } LDKCResult_CommitmentSignedDecodeErrorZ;
9952 * The contents of CResult_FundingCreatedDecodeErrorZ
9954 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
9956 * A pointer to the contents in the success state.
9957 * Reading from this pointer when `result_ok` is not set is undefined.
9959 struct LDKFundingCreated *result;
9961 * A pointer to the contents in the error state.
9962 * Reading from this pointer when `result_ok` is set is undefined.
9964 struct LDKDecodeError *err;
9965 } LDKCResult_FundingCreatedDecodeErrorZPtr;
9968 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
9969 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
9970 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9972 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
9974 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
9975 * `err` or `result` depending on the state of `result_ok`.
9977 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
9979 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
9982 } LDKCResult_FundingCreatedDecodeErrorZ;
9985 * The contents of CResult_FundingSignedDecodeErrorZ
9987 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
9989 * A pointer to the contents in the success state.
9990 * Reading from this pointer when `result_ok` is not set is undefined.
9992 struct LDKFundingSigned *result;
9994 * A pointer to the contents in the error state.
9995 * Reading from this pointer when `result_ok` is set is undefined.
9997 struct LDKDecodeError *err;
9998 } LDKCResult_FundingSignedDecodeErrorZPtr;
10001 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
10002 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
10003 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10005 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
10007 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
10008 * `err` or `result` depending on the state of `result_ok`.
10010 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
10012 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
10015 } LDKCResult_FundingSignedDecodeErrorZ;
10018 * The contents of CResult_ChannelReadyDecodeErrorZ
10020 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
10022 * A pointer to the contents in the success state.
10023 * Reading from this pointer when `result_ok` is not set is undefined.
10025 struct LDKChannelReady *result;
10027 * A pointer to the contents in the error state.
10028 * Reading from this pointer when `result_ok` is set is undefined.
10030 struct LDKDecodeError *err;
10031 } LDKCResult_ChannelReadyDecodeErrorZPtr;
10034 * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
10035 * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
10036 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10038 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
10040 * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
10041 * `err` or `result` depending on the state of `result_ok`.
10043 union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
10045 * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
10048 } LDKCResult_ChannelReadyDecodeErrorZ;
10053 * An init message to be sent or received from a peer
10055 typedef struct MUST_USE_STRUCT LDKInit {
10057 * A pointer to the opaque Rust object.
10058 * Nearly everywhere, inner must be non-null, however in places where
10059 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10061 LDKnativeInit *inner;
10063 * Indicates that this is the only struct which contains the same pointer.
10064 * Rust functions which take ownership of an object provided via an argument require
10065 * this to be true and invalidate the object pointed to by inner.
10071 * The contents of CResult_InitDecodeErrorZ
10073 typedef union LDKCResult_InitDecodeErrorZPtr {
10075 * A pointer to the contents in the success state.
10076 * Reading from this pointer when `result_ok` is not set is undefined.
10078 struct LDKInit *result;
10080 * A pointer to the contents in the error state.
10081 * Reading from this pointer when `result_ok` is set is undefined.
10083 struct LDKDecodeError *err;
10084 } LDKCResult_InitDecodeErrorZPtr;
10087 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
10088 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
10089 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10091 typedef struct LDKCResult_InitDecodeErrorZ {
10093 * The contents of this CResult_InitDecodeErrorZ, accessible via either
10094 * `err` or `result` depending on the state of `result_ok`.
10096 union LDKCResult_InitDecodeErrorZPtr contents;
10098 * Whether this CResult_InitDecodeErrorZ represents a success state.
10101 } LDKCResult_InitDecodeErrorZ;
10104 * The contents of CResult_OpenChannelDecodeErrorZ
10106 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
10108 * A pointer to the contents in the success state.
10109 * Reading from this pointer when `result_ok` is not set is undefined.
10111 struct LDKOpenChannel *result;
10113 * A pointer to the contents in the error state.
10114 * Reading from this pointer when `result_ok` is set is undefined.
10116 struct LDKDecodeError *err;
10117 } LDKCResult_OpenChannelDecodeErrorZPtr;
10120 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
10121 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
10122 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10124 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
10126 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
10127 * `err` or `result` depending on the state of `result_ok`.
10129 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
10131 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
10134 } LDKCResult_OpenChannelDecodeErrorZ;
10137 * The contents of CResult_RevokeAndACKDecodeErrorZ
10139 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
10141 * A pointer to the contents in the success state.
10142 * Reading from this pointer when `result_ok` is not set is undefined.
10144 struct LDKRevokeAndACK *result;
10146 * A pointer to the contents in the error state.
10147 * Reading from this pointer when `result_ok` is set is undefined.
10149 struct LDKDecodeError *err;
10150 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
10153 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
10154 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
10155 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10157 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
10159 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
10160 * `err` or `result` depending on the state of `result_ok`.
10162 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
10164 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
10167 } LDKCResult_RevokeAndACKDecodeErrorZ;
10170 * The contents of CResult_ShutdownDecodeErrorZ
10172 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
10174 * A pointer to the contents in the success state.
10175 * Reading from this pointer when `result_ok` is not set is undefined.
10177 struct LDKShutdown *result;
10179 * A pointer to the contents in the error state.
10180 * Reading from this pointer when `result_ok` is set is undefined.
10182 struct LDKDecodeError *err;
10183 } LDKCResult_ShutdownDecodeErrorZPtr;
10186 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
10187 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
10188 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10190 typedef struct LDKCResult_ShutdownDecodeErrorZ {
10192 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
10193 * `err` or `result` depending on the state of `result_ok`.
10195 union LDKCResult_ShutdownDecodeErrorZPtr contents;
10197 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
10200 } LDKCResult_ShutdownDecodeErrorZ;
10203 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
10205 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
10207 * A pointer to the contents in the success state.
10208 * Reading from this pointer when `result_ok` is not set is undefined.
10210 struct LDKUpdateFailHTLC *result;
10212 * A pointer to the contents in the error state.
10213 * Reading from this pointer when `result_ok` is set is undefined.
10215 struct LDKDecodeError *err;
10216 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
10219 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
10220 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
10221 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10223 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
10225 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
10226 * `err` or `result` depending on the state of `result_ok`.
10228 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
10230 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
10233 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
10236 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
10238 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
10240 * A pointer to the contents in the success state.
10241 * Reading from this pointer when `result_ok` is not set is undefined.
10243 struct LDKUpdateFailMalformedHTLC *result;
10245 * A pointer to the contents in the error state.
10246 * Reading from this pointer when `result_ok` is set is undefined.
10248 struct LDKDecodeError *err;
10249 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
10252 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
10253 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
10254 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10256 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
10258 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
10259 * `err` or `result` depending on the state of `result_ok`.
10261 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
10263 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
10266 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
10271 * An update_fee message to be sent or received from a peer
10273 typedef struct MUST_USE_STRUCT LDKUpdateFee {
10275 * A pointer to the opaque Rust object.
10276 * Nearly everywhere, inner must be non-null, however in places where
10277 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10279 LDKnativeUpdateFee *inner;
10281 * Indicates that this is the only struct which contains the same pointer.
10282 * Rust functions which take ownership of an object provided via an argument require
10283 * this to be true and invalidate the object pointed to by inner.
10289 * The contents of CResult_UpdateFeeDecodeErrorZ
10291 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
10293 * A pointer to the contents in the success state.
10294 * Reading from this pointer when `result_ok` is not set is undefined.
10296 struct LDKUpdateFee *result;
10298 * A pointer to the contents in the error state.
10299 * Reading from this pointer when `result_ok` is set is undefined.
10301 struct LDKDecodeError *err;
10302 } LDKCResult_UpdateFeeDecodeErrorZPtr;
10305 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
10306 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
10307 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10309 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
10311 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
10312 * `err` or `result` depending on the state of `result_ok`.
10314 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
10316 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
10319 } LDKCResult_UpdateFeeDecodeErrorZ;
10322 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
10324 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
10326 * A pointer to the contents in the success state.
10327 * Reading from this pointer when `result_ok` is not set is undefined.
10329 struct LDKUpdateFulfillHTLC *result;
10331 * A pointer to the contents in the error state.
10332 * Reading from this pointer when `result_ok` is set is undefined.
10334 struct LDKDecodeError *err;
10335 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
10338 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
10339 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
10340 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10342 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
10344 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
10345 * `err` or `result` depending on the state of `result_ok`.
10347 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
10349 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
10352 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
10355 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
10357 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
10359 * A pointer to the contents in the success state.
10360 * Reading from this pointer when `result_ok` is not set is undefined.
10362 struct LDKUpdateAddHTLC *result;
10364 * A pointer to the contents in the error state.
10365 * Reading from this pointer when `result_ok` is set is undefined.
10367 struct LDKDecodeError *err;
10368 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
10371 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
10372 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
10373 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10375 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
10377 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
10378 * `err` or `result` depending on the state of `result_ok`.
10380 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
10382 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
10385 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
10390 * A ping message to be sent or received from a peer
10392 typedef struct MUST_USE_STRUCT LDKPing {
10394 * A pointer to the opaque Rust object.
10395 * Nearly everywhere, inner must be non-null, however in places where
10396 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10398 LDKnativePing *inner;
10400 * Indicates that this is the only struct which contains the same pointer.
10401 * Rust functions which take ownership of an object provided via an argument require
10402 * this to be true and invalidate the object pointed to by inner.
10408 * The contents of CResult_PingDecodeErrorZ
10410 typedef union LDKCResult_PingDecodeErrorZPtr {
10412 * A pointer to the contents in the success state.
10413 * Reading from this pointer when `result_ok` is not set is undefined.
10415 struct LDKPing *result;
10417 * A pointer to the contents in the error state.
10418 * Reading from this pointer when `result_ok` is set is undefined.
10420 struct LDKDecodeError *err;
10421 } LDKCResult_PingDecodeErrorZPtr;
10424 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
10425 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
10426 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10428 typedef struct LDKCResult_PingDecodeErrorZ {
10430 * The contents of this CResult_PingDecodeErrorZ, accessible via either
10431 * `err` or `result` depending on the state of `result_ok`.
10433 union LDKCResult_PingDecodeErrorZPtr contents;
10435 * Whether this CResult_PingDecodeErrorZ represents a success state.
10438 } LDKCResult_PingDecodeErrorZ;
10443 * A pong message to be sent or received from a peer
10445 typedef struct MUST_USE_STRUCT LDKPong {
10447 * A pointer to the opaque Rust object.
10448 * Nearly everywhere, inner must be non-null, however in places where
10449 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10451 LDKnativePong *inner;
10453 * Indicates that this is the only struct which contains the same pointer.
10454 * Rust functions which take ownership of an object provided via an argument require
10455 * this to be true and invalidate the object pointed to by inner.
10461 * The contents of CResult_PongDecodeErrorZ
10463 typedef union LDKCResult_PongDecodeErrorZPtr {
10465 * A pointer to the contents in the success state.
10466 * Reading from this pointer when `result_ok` is not set is undefined.
10468 struct LDKPong *result;
10470 * A pointer to the contents in the error state.
10471 * Reading from this pointer when `result_ok` is set is undefined.
10473 struct LDKDecodeError *err;
10474 } LDKCResult_PongDecodeErrorZPtr;
10477 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
10478 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
10479 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10481 typedef struct LDKCResult_PongDecodeErrorZ {
10483 * The contents of this CResult_PongDecodeErrorZ, accessible via either
10484 * `err` or `result` depending on the state of `result_ok`.
10486 union LDKCResult_PongDecodeErrorZPtr contents;
10488 * Whether this CResult_PongDecodeErrorZ represents a success state.
10491 } LDKCResult_PongDecodeErrorZ;
10494 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
10496 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
10498 * A pointer to the contents in the success state.
10499 * Reading from this pointer when `result_ok` is not set is undefined.
10501 struct LDKUnsignedChannelAnnouncement *result;
10503 * A pointer to the contents in the error state.
10504 * Reading from this pointer when `result_ok` is set is undefined.
10506 struct LDKDecodeError *err;
10507 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
10510 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
10511 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10512 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10514 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
10516 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
10517 * `err` or `result` depending on the state of `result_ok`.
10519 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
10521 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
10524 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
10527 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
10529 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
10531 * A pointer to the contents in the success state.
10532 * Reading from this pointer when `result_ok` is not set is undefined.
10534 struct LDKChannelAnnouncement *result;
10536 * A pointer to the contents in the error state.
10537 * Reading from this pointer when `result_ok` is set is undefined.
10539 struct LDKDecodeError *err;
10540 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
10543 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
10544 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10545 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10547 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
10549 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
10550 * `err` or `result` depending on the state of `result_ok`.
10552 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
10554 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
10557 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
10562 * The unsigned part of a channel_update
10564 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
10566 * A pointer to the opaque Rust object.
10567 * Nearly everywhere, inner must be non-null, however in places where
10568 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10570 LDKnativeUnsignedChannelUpdate *inner;
10572 * Indicates that this is the only struct which contains the same pointer.
10573 * Rust functions which take ownership of an object provided via an argument require
10574 * this to be true and invalidate the object pointed to by inner.
10577 } LDKUnsignedChannelUpdate;
10580 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
10582 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
10584 * A pointer to the contents in the success state.
10585 * Reading from this pointer when `result_ok` is not set is undefined.
10587 struct LDKUnsignedChannelUpdate *result;
10589 * A pointer to the contents in the error state.
10590 * Reading from this pointer when `result_ok` is set is undefined.
10592 struct LDKDecodeError *err;
10593 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
10596 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
10597 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
10598 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10600 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
10602 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
10603 * `err` or `result` depending on the state of `result_ok`.
10605 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
10607 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
10610 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
10613 * The contents of CResult_ChannelUpdateDecodeErrorZ
10615 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
10617 * A pointer to the contents in the success state.
10618 * Reading from this pointer when `result_ok` is not set is undefined.
10620 struct LDKChannelUpdate *result;
10622 * A pointer to the contents in the error state.
10623 * Reading from this pointer when `result_ok` is set is undefined.
10625 struct LDKDecodeError *err;
10626 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
10629 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
10630 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
10631 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10633 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
10635 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
10636 * `err` or `result` depending on the state of `result_ok`.
10638 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
10640 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
10643 } LDKCResult_ChannelUpdateDecodeErrorZ;
10646 * The contents of CResult_ErrorMessageDecodeErrorZ
10648 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
10650 * A pointer to the contents in the success state.
10651 * Reading from this pointer when `result_ok` is not set is undefined.
10653 struct LDKErrorMessage *result;
10655 * A pointer to the contents in the error state.
10656 * Reading from this pointer when `result_ok` is set is undefined.
10658 struct LDKDecodeError *err;
10659 } LDKCResult_ErrorMessageDecodeErrorZPtr;
10662 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
10663 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
10664 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10666 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
10668 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
10669 * `err` or `result` depending on the state of `result_ok`.
10671 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
10673 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
10676 } LDKCResult_ErrorMessageDecodeErrorZ;
10679 * The contents of CResult_WarningMessageDecodeErrorZ
10681 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
10683 * A pointer to the contents in the success state.
10684 * Reading from this pointer when `result_ok` is not set is undefined.
10686 struct LDKWarningMessage *result;
10688 * A pointer to the contents in the error state.
10689 * Reading from this pointer when `result_ok` is set is undefined.
10691 struct LDKDecodeError *err;
10692 } LDKCResult_WarningMessageDecodeErrorZPtr;
10695 * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
10696 * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
10697 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10699 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
10701 * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
10702 * `err` or `result` depending on the state of `result_ok`.
10704 union LDKCResult_WarningMessageDecodeErrorZPtr contents;
10706 * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
10709 } LDKCResult_WarningMessageDecodeErrorZ;
10714 * The unsigned part of a node_announcement
10716 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
10718 * A pointer to the opaque Rust object.
10719 * Nearly everywhere, inner must be non-null, however in places where
10720 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10722 LDKnativeUnsignedNodeAnnouncement *inner;
10724 * Indicates that this is the only struct which contains the same pointer.
10725 * Rust functions which take ownership of an object provided via an argument require
10726 * this to be true and invalidate the object pointed to by inner.
10729 } LDKUnsignedNodeAnnouncement;
10732 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
10734 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
10736 * A pointer to the contents in the success state.
10737 * Reading from this pointer when `result_ok` is not set is undefined.
10739 struct LDKUnsignedNodeAnnouncement *result;
10741 * A pointer to the contents in the error state.
10742 * Reading from this pointer when `result_ok` is set is undefined.
10744 struct LDKDecodeError *err;
10745 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
10748 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
10749 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10750 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10752 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
10754 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
10755 * `err` or `result` depending on the state of `result_ok`.
10757 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
10759 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
10762 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
10765 * The contents of CResult_NodeAnnouncementDecodeErrorZ
10767 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
10769 * A pointer to the contents in the success state.
10770 * Reading from this pointer when `result_ok` is not set is undefined.
10772 struct LDKNodeAnnouncement *result;
10774 * A pointer to the contents in the error state.
10775 * Reading from this pointer when `result_ok` is set is undefined.
10777 struct LDKDecodeError *err;
10778 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
10781 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
10782 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10783 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10785 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
10787 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
10788 * `err` or `result` depending on the state of `result_ok`.
10790 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
10792 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
10795 } LDKCResult_NodeAnnouncementDecodeErrorZ;
10798 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
10800 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
10802 * A pointer to the contents in the success state.
10803 * Reading from this pointer when `result_ok` is not set is undefined.
10805 struct LDKQueryShortChannelIds *result;
10807 * A pointer to the contents in the error state.
10808 * Reading from this pointer when `result_ok` is set is undefined.
10810 struct LDKDecodeError *err;
10811 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
10814 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
10815 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
10816 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10818 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
10820 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
10821 * `err` or `result` depending on the state of `result_ok`.
10823 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
10825 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
10828 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
10833 * A reply_short_channel_ids_end message is sent as a reply to a
10834 * query_short_channel_ids message. The query recipient makes a best
10835 * effort to respond based on their local network view which may not be
10836 * a perfect view of the network.
10838 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
10840 * A pointer to the opaque Rust object.
10841 * Nearly everywhere, inner must be non-null, however in places where
10842 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10844 LDKnativeReplyShortChannelIdsEnd *inner;
10846 * Indicates that this is the only struct which contains the same pointer.
10847 * Rust functions which take ownership of an object provided via an argument require
10848 * this to be true and invalidate the object pointed to by inner.
10851 } LDKReplyShortChannelIdsEnd;
10854 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
10856 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
10858 * A pointer to the contents in the success state.
10859 * Reading from this pointer when `result_ok` is not set is undefined.
10861 struct LDKReplyShortChannelIdsEnd *result;
10863 * A pointer to the contents in the error state.
10864 * Reading from this pointer when `result_ok` is set is undefined.
10866 struct LDKDecodeError *err;
10867 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
10870 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
10871 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
10872 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10874 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
10876 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
10877 * `err` or `result` depending on the state of `result_ok`.
10879 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
10881 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
10884 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
10887 * The contents of CResult_QueryChannelRangeDecodeErrorZ
10889 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
10891 * A pointer to the contents in the success state.
10892 * Reading from this pointer when `result_ok` is not set is undefined.
10894 struct LDKQueryChannelRange *result;
10896 * A pointer to the contents in the error state.
10897 * Reading from this pointer when `result_ok` is set is undefined.
10899 struct LDKDecodeError *err;
10900 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
10903 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
10904 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
10905 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10907 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
10909 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
10910 * `err` or `result` depending on the state of `result_ok`.
10912 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
10914 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
10917 } LDKCResult_QueryChannelRangeDecodeErrorZ;
10920 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
10922 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
10924 * A pointer to the contents in the success state.
10925 * Reading from this pointer when `result_ok` is not set is undefined.
10927 struct LDKReplyChannelRange *result;
10929 * A pointer to the contents in the error state.
10930 * Reading from this pointer when `result_ok` is set is undefined.
10932 struct LDKDecodeError *err;
10933 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
10936 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
10937 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
10938 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10940 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
10942 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
10943 * `err` or `result` depending on the state of `result_ok`.
10945 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
10947 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
10950 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
10953 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
10955 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
10957 * A pointer to the contents in the success state.
10958 * Reading from this pointer when `result_ok` is not set is undefined.
10960 struct LDKGossipTimestampFilter *result;
10962 * A pointer to the contents in the error state.
10963 * Reading from this pointer when `result_ok` is set is undefined.
10965 struct LDKDecodeError *err;
10966 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
10969 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
10970 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
10971 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10973 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
10975 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
10976 * `err` or `result` depending on the state of `result_ok`.
10978 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
10980 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
10983 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
10986 * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
10987 * This corresponds to std::vector in C++
10989 typedef struct LDKCVec_PhantomRouteHintsZ {
10991 * The elements in the array.
10992 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10994 struct LDKPhantomRouteHints *data;
10996 * The number of elements pointed to by `data`.
10999 } LDKCVec_PhantomRouteHintsZ;
11002 * When signing using a fallible method either an user-supplied `SignError` or a `CreationError`
11005 typedef enum LDKSignOrCreationError_Tag {
11007 * An error occurred during signing
11009 LDKSignOrCreationError_SignError,
11011 * An error occurred while building the transaction
11013 LDKSignOrCreationError_CreationError,
11015 * Must be last for serialization purposes
11017 LDKSignOrCreationError_Sentinel,
11018 } LDKSignOrCreationError_Tag;
11020 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
11021 LDKSignOrCreationError_Tag tag;
11024 enum LDKCreationError creation_error;
11027 } LDKSignOrCreationError;
11030 * The contents of CResult_InvoiceSignOrCreationErrorZ
11032 typedef union LDKCResult_InvoiceSignOrCreationErrorZPtr {
11034 * A pointer to the contents in the success state.
11035 * Reading from this pointer when `result_ok` is not set is undefined.
11037 struct LDKInvoice *result;
11039 * A pointer to the contents in the error state.
11040 * Reading from this pointer when `result_ok` is set is undefined.
11042 struct LDKSignOrCreationError *err;
11043 } LDKCResult_InvoiceSignOrCreationErrorZPtr;
11046 * A CResult_InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
11047 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
11048 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11050 typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
11052 * The contents of this CResult_InvoiceSignOrCreationErrorZ, accessible via either
11053 * `err` or `result` depending on the state of `result_ok`.
11055 union LDKCResult_InvoiceSignOrCreationErrorZPtr contents;
11057 * Whether this CResult_InvoiceSignOrCreationErrorZ represents a success state.
11060 } LDKCResult_InvoiceSignOrCreationErrorZ;
11065 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
11067 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
11068 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
11069 * the return value of [`Filter::register_output`].
11071 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
11072 * may have been spent there. See [`Filter::register_output`] for details.
11074 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
11075 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
11077 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
11079 * A pointer to the opaque Rust object.
11080 * Nearly everywhere, inner must be non-null, however in places where
11081 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11083 LDKnativeWatchedOutput *inner;
11085 * Indicates that this is the only struct which contains the same pointer.
11086 * Rust functions which take ownership of an object provided via an argument require
11087 * this to be true and invalidate the object pointed to by inner.
11090 } LDKWatchedOutput;
11093 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
11096 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
11097 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
11098 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
11099 * receiving full blocks from a chain source, any further filtering is unnecessary.
11101 * After an output has been registered, subsequent block retrievals from the chain source must not
11102 * exclude any transactions matching the new criteria nor any in-block descendants of such
11105 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
11106 * should not block on I/O. Implementations should instead queue the newly monitored data to be
11107 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
11108 * invocation that has called the `Filter` must return [`TemporaryFailure`].
11110 * [`TemporaryFailure`]: ChannelMonitorUpdateErr::TemporaryFailure
11111 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
11112 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
11114 typedef struct LDKFilter {
11116 * An opaque pointer which is passed to your function implementations as an argument.
11117 * This has no meaning in the LDK, and can be NULL or any other value.
11121 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
11122 * a spending condition.
11124 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
11126 * Registers interest in spends of a transaction output.
11128 * Optionally, when `output.block_hash` is set, should return any transaction spending the
11129 * output that is found in the corresponding block along with its index.
11131 * This return value is useful for Electrum clients in order to supply in-block descendant
11132 * transactions which otherwise were not included. This is not necessary for other clients if
11133 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
11136 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
11138 * Frees any resources associated with this object given its this_arg pointer.
11139 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11141 void (*free)(void *this_arg);
11145 * An enum which can either contain a crate::lightning::chain::Filter or not
11147 typedef enum LDKCOption_FilterZ_Tag {
11149 * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
11151 LDKCOption_FilterZ_Some,
11153 * When we're in this state, this COption_FilterZ contains nothing
11155 LDKCOption_FilterZ_None,
11157 * Must be last for serialization purposes
11159 LDKCOption_FilterZ_Sentinel,
11160 } LDKCOption_FilterZ_Tag;
11162 typedef struct LDKCOption_FilterZ {
11163 LDKCOption_FilterZ_Tag tag;
11166 struct LDKFilter some;
11169 } LDKCOption_FilterZ;
11174 * A read-only reference to a current ChannelMonitor.
11176 * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
11179 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
11181 * A pointer to the opaque Rust object.
11182 * Nearly everywhere, inner must be non-null, however in places where
11183 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11185 LDKnativeLockedChannelMonitor *inner;
11187 * Indicates that this is the only struct which contains the same pointer.
11188 * Rust functions which take ownership of an object provided via an argument require
11189 * this to be true and invalidate the object pointed to by inner.
11192 } LDKLockedChannelMonitor;
11195 * The contents of CResult_LockedChannelMonitorNoneZ
11197 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
11199 * A pointer to the contents in the success state.
11200 * Reading from this pointer when `result_ok` is not set is undefined.
11202 struct LDKLockedChannelMonitor *result;
11204 * Note that this value is always NULL, as there are no contents in the Err variant
11207 } LDKCResult_LockedChannelMonitorNoneZPtr;
11210 * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
11211 * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
11212 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11214 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
11216 * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
11217 * `err` or `result` depending on the state of `result_ok`.
11219 union LDKCResult_LockedChannelMonitorNoneZPtr contents;
11221 * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
11224 } LDKCResult_LockedChannelMonitorNoneZ;
11227 * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
11228 * This corresponds to std::vector in C++
11230 typedef struct LDKCVec_OutPointZ {
11232 * The elements in the array.
11233 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11235 struct LDKOutPoint *data;
11237 * The number of elements pointed to by `data`.
11240 } LDKCVec_OutPointZ;
11243 * A trait indicating an object may generate message send events
11245 typedef struct LDKMessageSendEventsProvider {
11247 * An opaque pointer which is passed to your function implementations as an argument.
11248 * This has no meaning in the LDK, and can be NULL or any other value.
11252 * Gets the list of pending events which were generated by previous actions, clearing the list
11255 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
11257 * Frees any resources associated with this object given its this_arg pointer.
11258 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11260 void (*free)(void *this_arg);
11261 } LDKMessageSendEventsProvider;
11264 * A trait implemented for objects handling events from [`EventsProvider`].
11266 typedef struct LDKEventHandler {
11268 * An opaque pointer which is passed to your function implementations as an argument.
11269 * This has no meaning in the LDK, and can be NULL or any other value.
11273 * Handles the given [`Event`].
11275 * See [`EventsProvider`] for details that must be considered when implementing this method.
11277 void (*handle_event)(const void *this_arg, const struct LDKEvent *NONNULL_PTR event);
11279 * Frees any resources associated with this object given its this_arg pointer.
11280 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11282 void (*free)(void *this_arg);
11286 * A trait indicating an object may generate events.
11288 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
11292 * See [`process_pending_events`] for requirements around event processing.
11294 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
11295 * event since the last invocation. The handler must either act upon the event immediately
11296 * or preserve it for later handling.
11298 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
11299 * consult the provider's documentation on the implication of processing events and how a handler
11300 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
11301 * [`ChainMonitor::process_pending_events`]).
11303 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
11306 * [`process_pending_events`]: Self::process_pending_events
11307 * [`handle_event`]: EventHandler::handle_event
11308 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
11309 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
11311 typedef struct LDKEventsProvider {
11313 * An opaque pointer which is passed to your function implementations as an argument.
11314 * This has no meaning in the LDK, and can be NULL or any other value.
11318 * Processes any events generated since the last call using the given event handler.
11320 * Subsequent calls must only process new events. However, handlers must be capable of handling
11321 * duplicate events across process restarts. This may occur if the provider was recovered from
11322 * an old state (i.e., it hadn't been successfully persisted after processing pending events).
11324 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
11326 * Frees any resources associated with this object given its this_arg pointer.
11327 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11329 void (*free)(void *this_arg);
11330 } LDKEventsProvider;
11335 * Lightning TLV uses a custom variable-length integer called BigSize. It is similar to Bitcoin's
11336 * variable-length integers except that it is serialized in big-endian instead of little-endian.
11338 * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
11339 * encoded in several different ways, which we must check for at deserialization-time. Thus, if
11340 * you're looking for an example of a variable-length integer to use for your own project, move
11341 * along, this is a rather poor design.
11343 typedef struct MUST_USE_STRUCT LDKBigSize {
11345 * A pointer to the opaque Rust object.
11346 * Nearly everywhere, inner must be non-null, however in places where
11347 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11349 LDKnativeBigSize *inner;
11351 * Indicates that this is the only struct which contains the same pointer.
11352 * Rust functions which take ownership of an object provided via an argument require
11353 * this to be true and invalidate the object pointed to by inner.
11361 * Proposed use of a channel passed as a parameter to [`Score::channel_penalty_msat`].
11363 typedef struct MUST_USE_STRUCT LDKChannelUsage {
11365 * A pointer to the opaque Rust object.
11366 * Nearly everywhere, inner must be non-null, however in places where
11367 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11369 LDKnativeChannelUsage *inner;
11371 * Indicates that this is the only struct which contains the same pointer.
11372 * Rust functions which take ownership of an object provided via an argument require
11373 * this to be true and invalidate the object pointed to by inner.
11379 * An interface used to score payment channels for path finding.
11381 *\tScoring is in terms of fees willing to be paid in order to avoid routing through a channel.
11383 typedef struct LDKScore {
11385 * An opaque pointer which is passed to your function implementations as an argument.
11386 * This has no meaning in the LDK, and can be NULL or any other value.
11390 * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
11391 * given channel in the direction from `source` to `target`.
11393 * The channel's capacity (less any other MPP parts that are also being considered for use in
11394 * the same payment) is given by `capacity_msat`. It may be determined from various sources
11395 * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
11396 * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
11397 * Thus, implementations should be overflow-safe.
11399 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);
11401 * Handles updating channel penalties after failing to route through a channel.
11403 void (*payment_path_failed)(void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
11405 * Handles updating channel penalties after successfully routing along a path.
11407 void (*payment_path_successful)(void *this_arg, struct LDKCVec_RouteHopZ path);
11409 * Handles updating channel penalties after a probe over the given path failed.
11411 void (*probe_failed)(void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
11413 * Handles updating channel penalties after a probe over the given path succeeded.
11415 void (*probe_successful)(void *this_arg, struct LDKCVec_RouteHopZ path);
11417 * Serialize the object into a byte array
11419 struct LDKCVec_u8Z (*write)(const void *this_arg);
11421 * Frees any resources associated with this object given its this_arg pointer.
11422 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11424 void (*free)(void *this_arg);
11430 * A concrete implementation of [`LockableScore`] which supports multi-threading.
11432 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
11434 * A pointer to the opaque Rust object.
11435 * Nearly everywhere, inner must be non-null, however in places where
11436 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11438 LDKnativeMultiThreadedLockableScore *inner;
11440 * Indicates that this is the only struct which contains the same pointer.
11441 * Rust functions which take ownership of an object provided via an argument require
11442 * this to be true and invalidate the object pointed to by inner.
11445 } LDKMultiThreadedLockableScore;
11448 * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`MultiThreadedLockableScore`] to disk.
11450 typedef struct LDKPersister {
11452 * An opaque pointer which is passed to your function implementations as an argument.
11453 * This has no meaning in the LDK, and can be NULL or any other value.
11457 * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
11459 struct LDKCResult_NoneErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
11461 * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
11463 struct LDKCResult_NoneErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
11465 * Persist the given [`MultiThreadedLockableScore`] to disk, returning an error if persistence failed.
11467 struct LDKCResult_NoneErrorZ (*persist_scorer)(const void *this_arg, const struct LDKMultiThreadedLockableScore *NONNULL_PTR scorer);
11469 * Frees any resources associated with this object given its this_arg pointer.
11470 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11472 void (*free)(void *this_arg);
11478 * Configuration we set when applicable.
11480 * Default::default() provides sane defaults.
11482 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
11484 * A pointer to the opaque Rust object.
11485 * Nearly everywhere, inner must be non-null, however in places where
11486 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11488 LDKnativeChannelHandshakeConfig *inner;
11490 * Indicates that this is the only struct which contains the same pointer.
11491 * Rust functions which take ownership of an object provided via an argument require
11492 * this to be true and invalidate the object pointed to by inner.
11495 } LDKChannelHandshakeConfig;
11500 * Optional channel limits which are applied during channel creation.
11502 * These limits are only applied to our counterparty's limits, not our own.
11504 * Use 0/<type>::max_value() as appropriate to skip checking.
11506 * Provides sane defaults for most configurations.
11508 * Most additional limits are disabled except those with which specify a default in individual
11509 * field documentation. Note that this may result in barely-usable channels, but since they
11510 * are applied mostly only to incoming channels that's not much of a problem.
11512 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
11514 * A pointer to the opaque Rust object.
11515 * Nearly everywhere, inner must be non-null, however in places where
11516 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11518 LDKnativeChannelHandshakeLimits *inner;
11520 * Indicates that this is the only struct which contains the same pointer.
11521 * Rust functions which take ownership of an object provided via an argument require
11522 * this to be true and invalidate the object pointed to by inner.
11525 } LDKChannelHandshakeLimits;
11530 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
11532 * Default::default() provides sane defaults for most configurations
11533 * (but currently with 0 relay fees!)
11535 typedef struct MUST_USE_STRUCT LDKUserConfig {
11537 * A pointer to the opaque Rust object.
11538 * Nearly everywhere, inner must be non-null, however in places where
11539 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11541 LDKnativeUserConfig *inner;
11543 * Indicates that this is the only struct which contains the same pointer.
11544 * Rust functions which take ownership of an object provided via an argument require
11545 * this to be true and invalidate the object pointed to by inner.
11553 * The best known block as identified by its hash and height.
11555 typedef struct MUST_USE_STRUCT LDKBestBlock {
11557 * A pointer to the opaque Rust object.
11558 * Nearly everywhere, inner must be non-null, however in places where
11559 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11561 LDKnativeBestBlock *inner;
11563 * Indicates that this is the only struct which contains the same pointer.
11564 * Rust functions which take ownership of an object provided via an argument require
11565 * this to be true and invalidate the object pointed to by inner.
11571 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
11574 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
11575 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
11576 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
11579 * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
11580 * entire header chain and only blocks with matching transaction data using BIP 157 filters or
11581 * other similar filtering.
11583 typedef struct LDKListen {
11585 * An opaque pointer which is passed to your function implementations as an argument.
11586 * This has no meaning in the LDK, and can be NULL or any other value.
11590 * Notifies the listener that a block was added at the given height, with the transaction data
11591 * possibly filtered.
11593 void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
11595 * Notifies the listener that a block was added at the given height.
11597 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
11599 * Notifies the listener that a block was removed at the given height.
11601 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
11603 * Frees any resources associated with this object given its this_arg pointer.
11604 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11606 void (*free)(void *this_arg);
11610 * The `Confirm` trait is used to notify when transactions have been confirmed on chain or
11611 * unconfirmed during a chain reorganization.
11613 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
11614 * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity
11615 * related to registered transactions and outputs. Upon notification, it would pass along the
11616 * matching transactions using this interface.
11620 * The intended use is as follows:
11621 * - Call [`transactions_confirmed`] to process any on-chain activity of interest.
11622 * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`]
11623 * that has been reorganized out of the chain.
11624 * - Call [`best_block_updated`] whenever a new chain tip becomes available.
11628 * Clients must call these methods in chain order. Specifically:
11629 * - Transactions confirmed in a block must be given before transactions confirmed in a later
11631 * - Dependent transactions within the same block must be given in topological order, possibly in
11633 * - Unconfirmed transactions must be given after the original confirmations and before any
11636 * See individual method documentation for further details.
11638 * [`transactions_confirmed`]: Self::transactions_confirmed
11639 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
11640 * [`best_block_updated`]: Self::best_block_updated
11641 * [`get_relevant_txids`]: Self::get_relevant_txids
11643 typedef struct LDKConfirm {
11645 * An opaque pointer which is passed to your function implementations as an argument.
11646 * This has no meaning in the LDK, and can be NULL or any other value.
11650 * Processes transactions confirmed in a block with a given header and height.
11652 * Should be called for any transactions registered by [`Filter::register_tx`] or any
11653 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
11654 * appearing in the same block do not need to be included in the same call; instead, multiple
11655 * calls with additional transactions may be made so long as they are made in [chain order].
11657 * May be called before or after [`best_block_updated`] for the corresponding block. However,
11658 * in the event of a chain reorganization, it must not be called with a `header` that is no
11659 * longer in the chain as of the last call to [`best_block_updated`].
11661 * [chain order]: Confirm#Order
11662 * [`best_block_updated`]: Self::best_block_updated
11664 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
11666 * Processes a transaction that is no longer confirmed as result of a chain reorganization.
11668 * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
11669 * reorganized out of the best chain. Once called, the given transaction should not be returned
11670 * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`].
11672 * [`get_relevant_txids`]: Self::get_relevant_txids
11673 * [`transactions_confirmed`]: Self::transactions_confirmed
11675 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
11677 * Processes an update to the best header connected at the given height.
11679 * Should be called when a new header is available but may be skipped for intermediary blocks
11680 * if they become available at the same time.
11682 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
11684 * Returns transactions that should be monitored for reorganization out of the chain.
11686 * Should include any transactions passed to [`transactions_confirmed`] that have insufficient
11687 * confirmations to be safe from a chain reorganization. Should not include any transactions
11688 * passed to [`transaction_unconfirmed`] unless later reconfirmed.
11690 * May be called to determine the subset of transactions that must still be monitored for
11691 * reorganization. Will be idempotent between calls but may change as a result of calls to the
11692 * other interface methods. Thus, this is useful to determine which transactions may need to be
11693 * given to [`transaction_unconfirmed`].
11695 * [`transactions_confirmed`]: Self::transactions_confirmed
11696 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
11698 struct LDKCVec_TxidZ (*get_relevant_txids)(const void *this_arg);
11700 * Frees any resources associated with this object given its this_arg pointer.
11701 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11703 void (*free)(void *this_arg);
11709 * An opaque identifier describing a specific [`Persist`] method call.
11711 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
11713 * A pointer to the opaque Rust object.
11714 * Nearly everywhere, inner must be non-null, however in places where
11715 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11717 LDKnativeMonitorUpdateId *inner;
11719 * Indicates that this is the only struct which contains the same pointer.
11720 * Rust functions which take ownership of an object provided via an argument require
11721 * this to be true and invalidate the object pointed to by inner.
11724 } LDKMonitorUpdateId;
11727 * `Persist` defines behavior for persisting channel monitors: this could mean
11728 * writing once to disk, and/or uploading to one or more backup services.
11730 * Each method can return three possible values:
11731 * * If persistence (including any relevant `fsync()` calls) happens immediately, the
11732 * implementation should return `Ok(())`, indicating normal channel operation should continue.
11733 * * If persistence happens asynchronously, implementations should first ensure the
11734 * [`ChannelMonitor`] or [`ChannelMonitorUpdate`] are written durably to disk, and then return
11735 * `Err(ChannelMonitorUpdateErr::TemporaryFailure)` while the update continues in the
11736 * background. Once the update completes, [`ChainMonitor::channel_monitor_updated`] should be
11737 * called with the corresponding [`MonitorUpdateId`].
11739 * Note that unlike the direct [`chain::Watch`] interface,
11740 * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
11742 * * If persistence fails for some reason, implementations should return
11743 * `Err(ChannelMonitorUpdateErr::PermanentFailure)`, in which case the channel will likely be
11744 * closed without broadcasting the latest state. See
11745 * [`ChannelMonitorUpdateErr::PermanentFailure`] for more details.
11747 typedef struct LDKPersist {
11749 * An opaque pointer which is passed to your function implementations as an argument.
11750 * This has no meaning in the LDK, and can be NULL or any other value.
11754 * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
11755 * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
11757 * The data can be stored any way you want, but the identifier provided by LDK is the
11758 * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
11759 * and the stored channel data). Note that you **must** persist every new monitor to disk.
11761 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
11762 * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
11764 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
11765 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
11767 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11768 * [`Writeable::write`]: crate::util::ser::Writeable::write
11770 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
11772 * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
11775 * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
11776 * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
11779 * During blockchain synchronization operations, this may be called with no
11780 * [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
11781 * Note that after the full [`ChannelMonitor`] is persisted any previous
11782 * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
11783 * applied to the persisted [`ChannelMonitor`] as they were already applied.
11785 * If an implementer chooses to persist the updates only, they need to make
11786 * sure that all the updates are applied to the `ChannelMonitors` *before*
11787 * the set of channel monitors is given to the `ChannelManager`
11788 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
11789 * applying a monitor update to a monitor. If full `ChannelMonitors` are
11790 * persisted, then there is no need to persist individual updates.
11792 * Note that there could be a performance tradeoff between persisting complete
11793 * channel monitors on every update vs. persisting only updates and applying
11794 * them in batches. The size of each monitor grows `O(number of state updates)`
11795 * whereas updates are small and `O(1)`.
11797 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
11798 * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
11800 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
11801 * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
11802 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
11804 * [`Writeable::write`]: crate::util::ser::Writeable::write
11806 * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
11808 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);
11810 * Frees any resources associated with this object given its this_arg pointer.
11811 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11813 void (*free)(void *this_arg);
11819 * An implementation of [`chain::Watch`] for monitoring channels.
11821 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
11822 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
11823 * or used independently to monitor channels remotely. See the [module-level documentation] for
11826 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11827 * [module-level documentation]: crate::chain::chainmonitor
11829 typedef struct MUST_USE_STRUCT LDKChainMonitor {
11831 * A pointer to the opaque Rust object.
11832 * Nearly everywhere, inner must be non-null, however in places where
11833 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11835 LDKnativeChainMonitor *inner;
11837 * Indicates that this is the only struct which contains the same pointer.
11838 * Rust functions which take ownership of an object provided via an argument require
11839 * this to be true and invalidate the object pointed to by inner.
11847 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
11848 * and derives keys from that.
11850 * Your node_id is seed/0'
11851 * ChannelMonitor closes may use seed/1'
11852 * Cooperative closes may use seed/2'
11853 * The two close keys may be needed to claim on-chain funds!
11855 * This struct cannot be used for nodes that wish to support receiving phantom payments;
11856 * [`PhantomKeysManager`] must be used instead.
11858 * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
11859 * previously issued invoices and attempts to pay previous invoices will fail.
11861 typedef struct MUST_USE_STRUCT LDKKeysManager {
11863 * A pointer to the opaque Rust object.
11864 * Nearly everywhere, inner must be non-null, however in places where
11865 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11867 LDKnativeKeysManager *inner;
11869 * Indicates that this is the only struct which contains the same pointer.
11870 * Rust functions which take ownership of an object provided via an argument require
11871 * this to be true and invalidate the object pointed to by inner.
11879 * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
11882 * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
11883 * paid to one of multiple nodes. This works because we encode the invoice route hints such that
11884 * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
11885 * itself without ever needing to forward to this fake node.
11887 * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
11888 * provide some fault tolerance, because payers will automatically retry paying other provided
11889 * nodes in the case that one node goes down.
11891 * Note that multi-path payments are not supported in phantom invoices for security reasons.
11892 * Switching between this struct and [`KeysManager`] will invalidate any previously issued
11893 * invoices and attempts to pay previous invoices will fail.
11895 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
11897 * A pointer to the opaque Rust object.
11898 * Nearly everywhere, inner must be non-null, however in places where
11899 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11901 LDKnativePhantomKeysManager *inner;
11903 * Indicates that this is the only struct which contains the same pointer.
11904 * Rust functions which take ownership of an object provided via an argument require
11905 * this to be true and invalidate the object pointed to by inner.
11908 } LDKPhantomKeysManager;
11913 * Chain-related parameters used to construct a new `ChannelManager`.
11915 * Typically, the block-specific parameters are derived from the best block hash for the network,
11916 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
11917 * are not needed when deserializing a previously constructed `ChannelManager`.
11919 typedef struct MUST_USE_STRUCT LDKChainParameters {
11921 * A pointer to the opaque Rust object.
11922 * Nearly everywhere, inner must be non-null, however in places where
11923 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11925 LDKnativeChainParameters *inner;
11927 * Indicates that this is the only struct which contains the same pointer.
11928 * Rust functions which take ownership of an object provided via an argument require
11929 * this to be true and invalidate the object pointed to by inner.
11932 } LDKChainParameters;
11935 * A 3-byte byte array.
11937 typedef struct LDKThreeBytes {
11945 * A trait to describe an object which can receive channel messages.
11947 * Messages MAY be called in parallel when they originate from different their_node_ids, however
11948 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
11950 typedef struct LDKChannelMessageHandler {
11952 * An opaque pointer which is passed to your function implementations as an argument.
11953 * This has no meaning in the LDK, and can be NULL or any other value.
11957 * Handle an incoming open_channel message from the given peer.
11959 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
11961 * Handle an incoming accept_channel message from the given peer.
11963 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
11965 * Handle an incoming funding_created message from the given peer.
11967 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
11969 * Handle an incoming funding_signed message from the given peer.
11971 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
11973 * Handle an incoming channel_ready message from the given peer.
11975 void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
11977 * Handle an incoming shutdown message from the given peer.
11979 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);
11981 * Handle an incoming closing_signed message from the given peer.
11983 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
11985 * Handle an incoming update_add_htlc message from the given peer.
11987 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
11989 * Handle an incoming update_fulfill_htlc message from the given peer.
11991 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
11993 * Handle an incoming update_fail_htlc message from the given peer.
11995 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
11997 * Handle an incoming update_fail_malformed_htlc message from the given peer.
11999 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
12001 * Handle an incoming commitment_signed message from the given peer.
12003 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
12005 * Handle an incoming revoke_and_ack message from the given peer.
12007 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
12009 * Handle an incoming update_fee message from the given peer.
12011 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
12013 * Handle an incoming announcement_signatures message from the given peer.
12015 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
12017 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
12018 * is believed to be possible in the future (eg they're sending us messages we don't
12019 * understand or indicate they require unknown feature bits), no_connection_possible is set
12020 * and any outstanding channels should be failed.
12022 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
12024 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
12026 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
12028 * Handle an incoming channel_reestablish message from the given peer.
12030 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
12032 * Handle an incoming channel update from the given peer.
12034 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
12036 * Handle an incoming error message from the given peer.
12038 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
12040 * Implementation of MessageSendEventsProvider for this object.
12042 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
12044 * Frees any resources associated with this object given its this_arg pointer.
12045 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12047 void (*free)(void *this_arg);
12048 } LDKChannelMessageHandler;
12053 * Arguments for the creation of a ChannelManager that are not deserialized.
12055 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
12057 * 1) Deserialize all stored [`ChannelMonitor`]s.
12058 * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
12059 * `<(BlockHash, ChannelManager)>::read(reader, args)`
12060 * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
12061 * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
12062 * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
12063 * same way you would handle a [`chain::Filter`] call using
12064 * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
12065 * 4) Reconnect blocks on your [`ChannelMonitor`]s.
12066 * 5) Disconnect/connect blocks on the [`ChannelManager`].
12067 * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
12068 * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
12069 * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
12071 * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
12072 * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
12074 * Note that the ordering of #4-7 is not of importance, however all four must occur before you
12075 * call any other methods on the newly-deserialized [`ChannelManager`].
12077 * Note that because some channels may be closed during deserialization, it is critical that you
12078 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
12079 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
12080 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
12081 * not force-close the same channels but consider them live), you may end up revoking a state for
12082 * which you've already broadcasted the transaction.
12084 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
12086 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
12088 * A pointer to the opaque Rust object.
12089 * Nearly everywhere, inner must be non-null, however in places where
12090 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12092 LDKnativeChannelManagerReadArgs *inner;
12094 * Indicates that this is the only struct which contains the same pointer.
12095 * Rust functions which take ownership of an object provided via an argument require
12096 * this to be true and invalidate the object pointed to by inner.
12099 } LDKChannelManagerReadArgs;
12104 * A set of keys that were HKDF-expanded from an initial call to
12105 * [`KeysInterface::get_inbound_payment_key_material`].
12107 * [`KeysInterface::get_inbound_payment_key_material`]: crate::chain::keysinterface::KeysInterface::get_inbound_payment_key_material
12109 typedef struct MUST_USE_STRUCT LDKExpandedKey {
12111 * A pointer to the opaque Rust object.
12112 * Nearly everywhere, inner must be non-null, however in places where
12113 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12115 LDKnativeExpandedKey *inner;
12117 * Indicates that this is the only struct which contains the same pointer.
12118 * Rust functions which take ownership of an object provided via an argument require
12119 * this to be true and invalidate the object pointed to by inner.
12127 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
12128 * This is used to convince the recipient that the channel is at a certain commitment
12129 * number even if they lost that data due to a local failure. Of course, the peer may lie
12130 * and even later commitments may have been revoked.
12132 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
12134 * A pointer to the opaque Rust object.
12135 * Nearly everywhere, inner must be non-null, however in places where
12136 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12138 LDKnativeDataLossProtect *inner;
12140 * Indicates that this is the only struct which contains the same pointer.
12141 * Rust functions which take ownership of an object provided via an argument require
12142 * this to be true and invalidate the object pointed to by inner.
12145 } LDKDataLossProtect;
12148 * A trait to describe an object which can receive routing messages.
12150 * # Implementor DoS Warnings
12152 * For `gossip_queries` messages there are potential DoS vectors when handling
12153 * inbound queries. Implementors using an on-disk network graph should be aware of
12154 * repeated disk I/O for queries accessing different parts of the network graph.
12156 typedef struct LDKRoutingMessageHandler {
12158 * An opaque pointer which is passed to your function implementations as an argument.
12159 * This has no meaning in the LDK, and can be NULL or any other value.
12163 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
12164 * false or returning an Err otherwise.
12166 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
12168 * Handle a channel_announcement message, returning true if it should be forwarded on, false
12169 * or returning an Err otherwise.
12171 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
12173 * Handle an incoming channel_update message, returning true if it should be forwarded on,
12174 * false or returning an Err otherwise.
12176 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
12178 * Gets a subset of the channel announcements and updates required to dump our routing table
12179 * to a remote node, starting at the short_channel_id indicated by starting_point and
12180 * including the batch_amount entries immediately higher in numerical value than starting_point.
12182 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
12184 * Gets a subset of the node announcements required to dump our routing table to a remote node,
12185 * starting at the node *after* the provided publickey and including batch_amount entries
12186 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
12187 * If None is provided for starting_point, we start at the first node.
12189 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
12191 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
12193 * Called when a connection is established with a peer. This can be used to
12194 * perform routing table synchronization using a strategy defined by the
12197 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
12199 * Handles the reply of a query we initiated to learn about channels
12200 * for a given range of blocks. We can expect to receive one or more
12201 * replies to a single query.
12203 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
12205 * Handles the reply of a query we initiated asking for routing gossip
12206 * messages for a list of channels. We should receive this message when
12207 * a node has completed its best effort to send us the pertaining routing
12210 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
12212 * Handles when a peer asks us to send a list of short_channel_ids
12213 * for the requested range of blocks.
12215 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
12217 * Handles when a peer asks us to send routing gossip messages for a
12218 * list of short_channel_ids.
12220 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
12222 * Implementation of MessageSendEventsProvider for this object.
12224 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
12226 * Frees any resources associated with this object given its this_arg pointer.
12227 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12229 void (*free)(void *this_arg);
12230 } LDKRoutingMessageHandler;
12233 * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
12236 typedef struct LDKCustomMessageReader {
12238 * An opaque pointer which is passed to your function implementations as an argument.
12239 * This has no meaning in the LDK, and can be NULL or any other value.
12243 * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
12244 * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
12245 * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
12246 * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
12248 struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
12250 * Frees any resources associated with this object given its this_arg pointer.
12251 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12253 void (*free)(void *this_arg);
12254 } LDKCustomMessageReader;
12257 * Handler for BOLT1-compliant messages.
12259 typedef struct LDKCustomMessageHandler {
12261 * An opaque pointer which is passed to your function implementations as an argument.
12262 * This has no meaning in the LDK, and can be NULL or any other value.
12266 * Called with the message type that was received and the buffer to be read.
12267 * Can return a `MessageHandlingError` if the message could not be handled.
12269 struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
12271 * Gets the list of pending messages which were generated by the custom message
12272 * handler, clearing the list in the process. The first tuple element must
12273 * correspond to the intended recipients node ids. If no connection to one of the
12274 * specified node does not exist, the message is simply not sent to it.
12276 struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
12278 * Implementation of CustomMessageReader for this object.
12280 struct LDKCustomMessageReader CustomMessageReader;
12282 * Frees any resources associated with this object given its this_arg pointer.
12283 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12285 void (*free)(void *this_arg);
12286 } LDKCustomMessageHandler;
12291 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
12292 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
12294 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
12296 * A pointer to the opaque Rust object.
12297 * Nearly everywhere, inner must be non-null, however in places where
12298 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12300 LDKnativeIgnoringMessageHandler *inner;
12302 * Indicates that this is the only struct which contains the same pointer.
12303 * Rust functions which take ownership of an object provided via an argument require
12304 * this to be true and invalidate the object pointed to by inner.
12307 } LDKIgnoringMessageHandler;
12312 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
12313 * You can provide one of these as the route_handler in a MessageHandler.
12315 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
12317 * A pointer to the opaque Rust object.
12318 * Nearly everywhere, inner must be non-null, however in places where
12319 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12321 LDKnativeErroringMessageHandler *inner;
12323 * Indicates that this is the only struct which contains the same pointer.
12324 * Rust functions which take ownership of an object provided via an argument require
12325 * this to be true and invalidate the object pointed to by inner.
12328 } LDKErroringMessageHandler;
12333 * Provides references to trait impls which handle different types of messages.
12335 typedef struct MUST_USE_STRUCT LDKMessageHandler {
12337 * A pointer to the opaque Rust object.
12338 * Nearly everywhere, inner must be non-null, however in places where
12339 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12341 LDKnativeMessageHandler *inner;
12343 * Indicates that this is the only struct which contains the same pointer.
12344 * Rust functions which take ownership of an object provided via an argument require
12345 * this to be true and invalidate the object pointed to by inner.
12348 } LDKMessageHandler;
12351 * Provides an object which can be used to send data to and which uniquely identifies a connection
12352 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
12353 * implement Hash to meet the PeerManager API.
12355 * For efficiency, Clone should be relatively cheap for this type.
12357 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
12358 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
12359 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
12360 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
12361 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
12362 * to simply use another value which is guaranteed to be globally unique instead.
12364 typedef struct LDKSocketDescriptor {
12366 * An opaque pointer which is passed to your function implementations as an argument.
12367 * This has no meaning in the LDK, and can be NULL or any other value.
12371 * Attempts to send some data from the given slice to the peer.
12373 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
12374 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
12375 * called and further write attempts may occur until that time.
12377 * If the returned size is smaller than `data.len()`, a
12378 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
12379 * written. Additionally, until a `send_data` event completes fully, no further
12380 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
12381 * prevent denial-of-service issues, you should not read or buffer any data from the socket
12384 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
12385 * (indicating that read events should be paused to prevent DoS in the send buffer),
12386 * `resume_read` may be set indicating that read events on this descriptor should resume. A
12387 * `resume_read` of false carries no meaning, and should not cause any action.
12389 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
12391 * Disconnect the socket pointed to by this SocketDescriptor.
12393 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
12394 * call (doing so is a noop).
12396 void (*disconnect_socket)(void *this_arg);
12398 * Checks if two objects are equal given this object's this_arg pointer and another object.
12400 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
12402 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
12403 * This is used, for example, for inclusion of this object in a hash map.
12405 uint64_t (*hash)(const void *this_arg);
12407 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
12408 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
12409 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
12411 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
12413 * Frees any resources associated with this object given its this_arg pointer.
12414 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12416 void (*free)(void *this_arg);
12417 } LDKSocketDescriptor;
12422 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
12423 * socket events into messages which it passes on to its [`MessageHandler`].
12425 * Locks are taken internally, so you must never assume that reentrancy from a
12426 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
12428 * Calls to [`read_event`] will decode relevant messages and pass them to the
12429 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
12430 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
12431 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
12432 * calls only after previous ones have returned.
12434 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
12435 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
12436 * essentially you should default to using a SimpleRefPeerManager, and use a
12437 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
12438 * you're using lightning-net-tokio.
12440 * [`read_event`]: PeerManager::read_event
12442 typedef struct MUST_USE_STRUCT LDKPeerManager {
12444 * A pointer to the opaque Rust object.
12445 * Nearly everywhere, inner must be non-null, however in places where
12446 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12448 LDKnativePeerManager *inner;
12450 * Indicates that this is the only struct which contains the same pointer.
12451 * Rust functions which take ownership of an object provided via an argument require
12452 * this to be true and invalidate the object pointed to by inner.
12460 * Static channel fields used to build transactions given per-commitment fields, organized by
12461 * broadcaster/countersignatory.
12463 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
12464 * as_holder_broadcastable and as_counterparty_broadcastable functions.
12466 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
12468 * A pointer to the opaque Rust object.
12469 * Nearly everywhere, inner must be non-null, however in places where
12470 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12472 LDKnativeDirectedChannelTransactionParameters *inner;
12474 * Indicates that this is the only struct which contains the same pointer.
12475 * Rust functions which take ownership of an object provided via an argument require
12476 * this to be true and invalidate the object pointed to by inner.
12479 } LDKDirectedChannelTransactionParameters;
12482 * Integer in the range `0..=16`
12484 typedef struct LDKWitnessVersion {
12486 } LDKWitnessVersion;
12491 * A read-only view of [`NetworkGraph`].
12493 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
12495 * A pointer to the opaque Rust object.
12496 * Nearly everywhere, inner must be non-null, however in places where
12497 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12499 LDKnativeReadOnlyNetworkGraph *inner;
12501 * Indicates that this is the only struct which contains the same pointer.
12502 * Rust functions which take ownership of an object provided via an argument require
12503 * this to be true and invalidate the object pointed to by inner.
12506 } LDKReadOnlyNetworkGraph;
12511 * Receives and validates network updates from peers,
12512 * stores authentic and relevant data as a network graph.
12513 * This network graph is then used for routing payments.
12514 * Provides interface to help with initial routing sync by
12515 * serving historical announcements.
12517 * Serves as an [`EventHandler`] for applying updates from [`Event::PaymentPathFailed`] to the
12518 * [`NetworkGraph`].
12520 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
12522 * A pointer to the opaque Rust object.
12523 * Nearly everywhere, inner must be non-null, however in places where
12524 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12526 LDKnativeP2PGossipSync *inner;
12528 * Indicates that this is the only struct which contains the same pointer.
12529 * Rust functions which take ownership of an object provided via an argument require
12530 * this to be true and invalidate the object pointed to by inner.
12533 } LDKP2PGossipSync;
12538 * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
12539 * source node to a target node.
12541 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
12543 * A pointer to the opaque Rust object.
12544 * Nearly everywhere, inner must be non-null, however in places where
12545 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12547 LDKnativeDirectedChannelInfo *inner;
12549 * Indicates that this is the only struct which contains the same pointer.
12550 * Rust functions which take ownership of an object provided via an argument require
12551 * this to be true and invalidate the object pointed to by inner.
12554 } LDKDirectedChannelInfo;
12557 * The effective capacity of a channel for routing purposes.
12559 * While this may be smaller than the actual channel capacity, amounts greater than
12560 * [`Self::as_msat`] should not be routed through the channel.
12562 typedef enum LDKEffectiveCapacity_Tag {
12564 * The available liquidity in the channel known from being a channel counterparty, and thus a
12567 LDKEffectiveCapacity_ExactLiquidity,
12569 * The maximum HTLC amount in one direction as advertised on the gossip network.
12571 LDKEffectiveCapacity_MaximumHTLC,
12573 * The total capacity of the channel as determined by the funding transaction.
12575 LDKEffectiveCapacity_Total,
12577 * A capacity sufficient to route any payment, typically used for private channels provided by
12580 LDKEffectiveCapacity_Infinite,
12582 * A capacity that is unknown possibly because either the chain state is unavailable to know
12583 * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
12585 LDKEffectiveCapacity_Unknown,
12587 * Must be last for serialization purposes
12589 LDKEffectiveCapacity_Sentinel,
12590 } LDKEffectiveCapacity_Tag;
12592 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
12594 * Either the inbound or outbound liquidity depending on the direction, denominated in
12597 uint64_t liquidity_msat;
12598 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
12600 typedef struct LDKEffectiveCapacity_LDKMaximumHTLC_Body {
12602 * The maximum HTLC amount denominated in millisatoshi.
12604 uint64_t amount_msat;
12605 } LDKEffectiveCapacity_LDKMaximumHTLC_Body;
12607 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
12609 * The funding amount denominated in millisatoshi.
12611 uint64_t capacity_msat;
12613 * The maximum HTLC amount denominated in millisatoshi.
12615 struct LDKCOption_u64Z htlc_maximum_msat;
12616 } LDKEffectiveCapacity_LDKTotal_Body;
12618 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
12619 LDKEffectiveCapacity_Tag tag;
12621 LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
12622 LDKEffectiveCapacity_LDKMaximumHTLC_Body maximum_htlc;
12623 LDKEffectiveCapacity_LDKTotal_Body total;
12625 } LDKEffectiveCapacity;
12628 * A scorer that is accessed under a lock.
12630 * Needed so that calls to [`Score::channel_penalty_msat`] in [`find_route`] can be made while
12631 * having shared ownership of a scorer but without requiring internal locking in [`Score`]
12632 * implementations. Internal locking would be detrimental to route finding performance and could
12633 * result in [`Score::channel_penalty_msat`] returning a different value for the same channel.
12635 * [`find_route`]: crate::routing::router::find_route
12637 typedef struct LDKLockableScore {
12639 * An opaque pointer which is passed to your function implementations as an argument.
12640 * This has no meaning in the LDK, and can be NULL or any other value.
12644 * Returns the locked scorer.
12646 struct LDKScore (*lock)(const void *this_arg);
12648 * Frees any resources associated with this object given its this_arg pointer.
12649 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12651 void (*free)(void *this_arg);
12652 } LDKLockableScore;
12657 * Parameters for configuring [`ProbabilisticScorer`].
12659 * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
12660 * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
12662 * The penalty applied to any channel by the [`ProbabilisticScorer`] is the sum of each of the
12665 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringParameters {
12667 * A pointer to the opaque Rust object.
12668 * Nearly everywhere, inner must be non-null, however in places where
12669 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12671 LDKnativeProbabilisticScoringParameters *inner;
12673 * Indicates that this is the only struct which contains the same pointer.
12674 * Rust functions which take ownership of an object provided via an argument require
12675 * this to be true and invalidate the object pointed to by inner.
12678 } LDKProbabilisticScoringParameters;
12683 * FilesystemPersister persists channel data on disk, where each channel's
12684 * data is stored in a file named after its funding outpoint.
12686 * Warning: this module does the best it can with calls to persist data, but it
12687 * can only guarantee that the data is passed to the drive. It is up to the
12688 * drive manufacturers to do the actual persistence properly, which they often
12689 * don't (especially on consumer-grade hardware). Therefore, it is up to the
12690 * user to validate their entire storage stack, to ensure the writes are
12692 * Corollary: especially when dealing with larger amounts of money, it is best
12693 * practice to have multiple channel data backups and not rely only on one
12694 * FilesystemPersister.
12696 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
12698 * A pointer to the opaque Rust object.
12699 * Nearly everywhere, inner must be non-null, however in places where
12700 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12702 LDKnativeFilesystemPersister *inner;
12704 * Indicates that this is the only struct which contains the same pointer.
12705 * Rust functions which take ownership of an object provided via an argument require
12706 * this to be true and invalidate the object pointed to by inner.
12709 } LDKFilesystemPersister;
12714 * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
12715 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
12716 * responsibilities are:
12717 * * Processing [`Event`]s with a user-provided [`EventHandler`].
12718 * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
12719 * writing it to disk/backups by invoking the callback given to it at startup.
12720 * [`ChannelManager`] persistence should be done in the background.
12721 * * Calling [`ChannelManager::timer_tick_occurred`] and [`PeerManager::timer_tick_occurred`]
12722 * at the appropriate intervals.
12723 * * Calling [`NetworkGraph::remove_stale_channels`] (if a [`GossipSync`] with a [`NetworkGraph`]
12724 * is provided to [`BackgroundProcessor::start`]).
12726 * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
12727 * upon as doing so may result in high latency.
12731 * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
12732 * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
12733 * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
12734 * unilateral chain closure fees are at risk.
12736 * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
12737 * [`Event`]: lightning::util::events::Event
12738 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
12740 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
12742 * A pointer to the opaque Rust object.
12743 * Nearly everywhere, inner must be non-null, however in places where
12744 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12746 LDKnativeBackgroundProcessor *inner;
12748 * Indicates that this is the only struct which contains the same pointer.
12749 * Rust functions which take ownership of an object provided via an argument require
12750 * this to be true and invalidate the object pointed to by inner.
12753 } LDKBackgroundProcessor;
12758 * Rapid Gossip Sync struct
12759 * See [crate-level documentation] for usage.
12761 * [crate-level documentation]: crate
12763 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
12765 * A pointer to the opaque Rust object.
12766 * Nearly everywhere, inner must be non-null, however in places where
12767 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12769 LDKnativeRapidGossipSync *inner;
12771 * Indicates that this is the only struct which contains the same pointer.
12772 * Rust functions which take ownership of an object provided via an argument require
12773 * this to be true and invalidate the object pointed to by inner.
12776 } LDKRapidGossipSync;
12779 * Either [`P2PGossipSync`] or [`RapidGossipSync`].
12781 typedef enum LDKGossipSync_Tag {
12783 * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
12787 * Rapid gossip sync from a trusted server.
12789 LDKGossipSync_Rapid,
12793 LDKGossipSync_None,
12795 * Must be last for serialization purposes
12797 LDKGossipSync_Sentinel,
12798 } LDKGossipSync_Tag;
12800 typedef struct MUST_USE_STRUCT LDKGossipSync {
12801 LDKGossipSync_Tag tag;
12805 * Note that this field is expected to be a reference.
12807 struct LDKP2PGossipSync p2p;
12811 * Note that this field is expected to be a reference.
12813 struct LDKRapidGossipSync rapid;
12821 * Data of the `RawInvoice` that is encoded in the data part
12823 typedef struct MUST_USE_STRUCT LDKRawDataPart {
12825 * A pointer to the opaque Rust object.
12826 * Nearly everywhere, inner must be non-null, however in places where
12827 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12829 LDKnativeRawDataPart *inner;
12831 * Indicates that this is the only struct which contains the same pointer.
12832 * Rust functions which take ownership of an object provided via an argument require
12833 * this to be true and invalidate the object pointed to by inner.
12843 typedef struct MUST_USE_STRUCT LDKSha256 {
12845 * A pointer to the opaque Rust object.
12846 * Nearly everywhere, inner must be non-null, however in places where
12847 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12849 LDKnativeSha256 *inner;
12851 * Indicates that this is the only struct which contains the same pointer.
12852 * Rust functions which take ownership of an object provided via an argument require
12853 * this to be true and invalidate the object pointed to by inner.
12861 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
12864 typedef struct MUST_USE_STRUCT LDKExpiryTime {
12866 * A pointer to the opaque Rust object.
12867 * Nearly everywhere, inner must be non-null, however in places where
12868 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12870 LDKnativeExpiryTime *inner;
12872 * Indicates that this is the only struct which contains the same pointer.
12873 * Rust functions which take ownership of an object provided via an argument require
12874 * this to be true and invalidate the object pointed to by inner.
12882 * `min_final_cltv_expiry` to use for the last HTLC in the route
12884 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiry {
12886 * A pointer to the opaque Rust object.
12887 * Nearly everywhere, inner must be non-null, however in places where
12888 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12890 LDKnativeMinFinalCltvExpiry *inner;
12892 * Indicates that this is the only struct which contains the same pointer.
12893 * Rust functions which take ownership of an object provided via an argument require
12894 * this to be true and invalidate the object pointed to by inner.
12897 } LDKMinFinalCltvExpiry;
12900 * A 20-byte byte array.
12902 typedef struct LDKTwentyBytes {
12910 * Fallback address in case no LN payment is possible
12912 typedef enum LDKFallback_Tag {
12913 LDKFallback_SegWitProgram,
12914 LDKFallback_PubKeyHash,
12915 LDKFallback_ScriptHash,
12917 * Must be last for serialization purposes
12919 LDKFallback_Sentinel,
12922 typedef struct LDKFallback_LDKSegWitProgram_Body {
12923 struct LDKu5 version;
12924 struct LDKCVec_u8Z program;
12925 } LDKFallback_LDKSegWitProgram_Body;
12927 typedef struct MUST_USE_STRUCT LDKFallback {
12928 LDKFallback_Tag tag;
12930 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
12932 struct LDKTwentyBytes pub_key_hash;
12935 struct LDKTwentyBytes script_hash;
12941 * A trait defining behavior of an [`Invoice`] payer.
12943 typedef struct LDKPayer {
12945 * An opaque pointer which is passed to your function implementations as an argument.
12946 * This has no meaning in the LDK, and can be NULL or any other value.
12950 * Returns the payer's node id.
12952 struct LDKPublicKey (*node_id)(const void *this_arg);
12954 * Returns the payer's channels.
12956 struct LDKCVec_ChannelDetailsZ (*first_hops)(const void *this_arg);
12958 * Sends a payment over the Lightning Network using the given [`Route`].
12960 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
12962 struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
12964 * Sends a spontaneous payment over the Lightning Network using the given [`Route`].
12966 struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_spontaneous_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage);
12968 * Retries a failed payment path for the [`PaymentId`] using the given [`Route`].
12970 struct LDKCResult_NonePaymentSendFailureZ (*retry_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id);
12972 * Signals that no further retries for the given payment will occur.
12974 void (*abandon_payment)(const void *this_arg, struct LDKThirtyTwoBytes payment_id);
12976 * Frees any resources associated with this object given its this_arg pointer.
12977 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12979 void (*free)(void *this_arg);
12983 * A trait defining behavior for routing an [`Invoice`] payment.
12985 typedef struct LDKRouter {
12987 * An opaque pointer which is passed to your function implementations as an argument.
12988 * This has no meaning in the LDK, and can be NULL or any other value.
12992 * Finds a [`Route`] between `payer` and `payee` for a payment with the given values.
12994 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
12996 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);
12998 * Frees any resources associated with this object given its this_arg pointer.
12999 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13001 void (*free)(void *this_arg);
13007 * A utility for paying [`Invoice`]s and sending spontaneous payments.
13009 * See [module-level documentation] for details.
13011 * [module-level documentation]: crate::payment
13013 typedef struct MUST_USE_STRUCT LDKInvoicePayer {
13015 * A pointer to the opaque Rust object.
13016 * Nearly everywhere, inner must be non-null, however in places where
13017 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13019 LDKnativeInvoicePayer *inner;
13021 * Indicates that this is the only struct which contains the same pointer.
13022 * Rust functions which take ownership of an object provided via an argument require
13023 * this to be true and invalidate the object pointed to by inner.
13029 * Strategies available to retry payment path failures for an [`Invoice`].
13032 typedef enum LDKRetry_Tag {
13034 * Max number of attempts to retry payment.
13036 * Note that this is the number of *path* failures, not full payment retries. For multi-path
13037 * payments, if this is less than the total number of paths, we will never even retry all of the
13042 * Time elapsed before abandoning retries for a payment.
13046 * Must be last for serialization purposes
13051 typedef struct MUST_USE_STRUCT LDKRetry {
13055 uintptr_t attempts;
13066 * A [`Router`] implemented using [`find_route`].
13068 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
13070 * A pointer to the opaque Rust object.
13071 * Nearly everywhere, inner must be non-null, however in places where
13072 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13074 LDKnativeDefaultRouter *inner;
13076 * Indicates that this is the only struct which contains the same pointer.
13077 * Rust functions which take ownership of an object provided via an argument require
13078 * this to be true and invalidate the object pointed to by inner.
13081 } LDKDefaultRouter;
13083 extern const uintptr_t MAX_BUF_SIZE;
13085 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
13087 extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
13089 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
13091 extern const uint32_t ANTI_REORG_DELAY;
13093 extern const uint16_t BREAKDOWN_TIMEOUT;
13095 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
13097 extern const uint32_t MIN_FINAL_CLTV_EXPIRY;
13099 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
13101 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
13103 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
13105 extern const uint8_t DEFAULT_MAX_PATH_COUNT;
13107 extern const uint64_t MAX_TIMESTAMP;
13109 extern const uint64_t DEFAULT_EXPIRY_TIME;
13111 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY;
13113 extern const uint8_t TAG_PAYMENT_HASH;
13115 extern const uint8_t TAG_DESCRIPTION;
13117 extern const uint8_t TAG_PAYEE_PUB_KEY;
13119 extern const uint8_t TAG_DESCRIPTION_HASH;
13121 extern const uint8_t TAG_EXPIRY_TIME;
13123 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
13125 extern const uint8_t TAG_FALLBACK;
13127 extern const uint8_t TAG_PRIVATE_ROUTE;
13129 extern const uint8_t TAG_PAYMENT_SECRET;
13131 extern const uint8_t TAG_FEATURES;
13133 struct LDKStr _ldk_get_compiled_version(void);
13135 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
13138 * Creates a new Bech32Error which has the same data as `orig`
13140 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
13143 * Releases any memory held by the given `Bech32Error` (which is currently none)
13145 void Bech32Error_free(struct LDKBech32Error o);
13148 * Frees the data buffer, if data_is_owned is set and datalen > 0.
13150 void Transaction_free(struct LDKTransaction _res);
13153 * Convenience function for constructing a new TxOut
13155 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
13158 * Frees the data pointed to by script_pubkey.
13160 void TxOut_free(struct LDKTxOut _res);
13163 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
13165 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
13168 * Frees the data buffer, if chars_is_owned is set and len > 0.
13170 void Str_free(struct LDKStr _res);
13172 #if defined(LDK_DEBUG_BUILD)
13174 * This function exists for memory safety testing purposes. It should never be used in production
13177 const void *__unmangle_inner_ptr(const void *ptr);
13181 * Creates a new CResult_NoneNoneZ in the success state.
13183 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
13186 * Creates a new CResult_NoneNoneZ in the error state.
13188 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
13191 * Checks if the given object is currently in the success state
13193 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
13196 * Frees any resources used by the CResult_NoneNoneZ.
13198 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
13201 * Creates a new CResult_NoneNoneZ which has the same data as `orig`
13202 * but with all dynamically-allocated buffers duplicated in new buffers.
13204 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
13207 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
13209 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
13212 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
13214 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
13217 * Checks if the given object is currently in the success state
13219 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
13222 * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
13224 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
13227 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
13228 * but with all dynamically-allocated buffers duplicated in new buffers.
13230 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
13233 * Creates a new CResult_SecretKeyErrorZ in the success state.
13235 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
13238 * Creates a new CResult_SecretKeyErrorZ in the error state.
13240 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
13243 * Checks if the given object is currently in the success state
13245 bool CResult_SecretKeyErrorZ_is_ok(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR o);
13248 * Frees any resources used by the CResult_SecretKeyErrorZ.
13250 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
13253 * Creates a new CResult_SecretKeyErrorZ which has the same data as `orig`
13254 * but with all dynamically-allocated buffers duplicated in new buffers.
13256 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_clone(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR orig);
13259 * Creates a new CResult_PublicKeyErrorZ in the success state.
13261 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
13264 * Creates a new CResult_PublicKeyErrorZ in the error state.
13266 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
13269 * Checks if the given object is currently in the success state
13271 bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o);
13274 * Frees any resources used by the CResult_PublicKeyErrorZ.
13276 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
13279 * Creates a new CResult_PublicKeyErrorZ which has the same data as `orig`
13280 * but with all dynamically-allocated buffers duplicated in new buffers.
13282 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig);
13285 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
13287 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
13290 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
13292 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
13295 * Checks if the given object is currently in the success state
13297 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
13300 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
13302 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
13305 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
13306 * but with all dynamically-allocated buffers duplicated in new buffers.
13308 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
13311 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
13313 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
13316 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
13318 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
13321 * Checks if the given object is currently in the success state
13323 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
13326 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
13328 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
13331 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
13332 * but with all dynamically-allocated buffers duplicated in new buffers.
13334 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
13337 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
13339 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
13342 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
13344 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
13347 * Checks if the given object is currently in the success state
13349 bool CResult_TxCreationKeysErrorZ_is_ok(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR o);
13352 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
13354 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
13357 * Creates a new CResult_TxCreationKeysErrorZ which has the same data as `orig`
13358 * but with all dynamically-allocated buffers duplicated in new buffers.
13360 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_clone(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR orig);
13363 * Constructs a new COption_u32Z containing a u32
13365 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
13368 * Constructs a new COption_u32Z containing nothing
13370 struct LDKCOption_u32Z COption_u32Z_none(void);
13373 * Frees any resources associated with the u32, if we are in the Some state
13375 void COption_u32Z_free(struct LDKCOption_u32Z _res);
13378 * Creates a new COption_u32Z which has the same data as `orig`
13379 * but with all dynamically-allocated buffers duplicated in new buffers.
13381 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
13384 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
13386 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
13389 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
13391 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
13394 * Checks if the given object is currently in the success state
13396 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
13399 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
13401 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
13404 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
13405 * but with all dynamically-allocated buffers duplicated in new buffers.
13407 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
13410 * Constructs a new COption_NoneZ containing a
13412 enum LDKCOption_NoneZ COption_NoneZ_some(void);
13415 * Constructs a new COption_NoneZ containing nothing
13417 enum LDKCOption_NoneZ COption_NoneZ_none(void);
13420 * Frees any resources associated with the , if we are in the Some state
13422 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
13425 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
13427 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
13430 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
13432 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
13435 * Checks if the given object is currently in the success state
13437 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
13440 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
13442 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
13445 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
13446 * but with all dynamically-allocated buffers duplicated in new buffers.
13448 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
13451 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
13453 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
13456 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
13458 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
13461 * Checks if the given object is currently in the success state
13463 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
13466 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
13468 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
13471 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
13472 * but with all dynamically-allocated buffers duplicated in new buffers.
13474 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
13477 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13479 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
13482 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
13484 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
13487 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
13489 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
13492 * Checks if the given object is currently in the success state
13494 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
13497 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
13499 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
13502 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
13503 * but with all dynamically-allocated buffers duplicated in new buffers.
13505 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
13508 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
13510 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
13513 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
13515 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
13518 * Checks if the given object is currently in the success state
13520 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
13523 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
13525 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
13528 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
13529 * but with all dynamically-allocated buffers duplicated in new buffers.
13531 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
13534 * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
13536 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
13539 * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
13541 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
13544 * Checks if the given object is currently in the success state
13546 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
13549 * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
13551 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
13554 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
13556 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
13559 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
13561 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
13564 * Checks if the given object is currently in the success state
13566 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
13569 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
13571 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
13574 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
13575 * but with all dynamically-allocated buffers duplicated in new buffers.
13577 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
13580 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
13582 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
13585 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
13587 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
13590 * Checks if the given object is currently in the success state
13592 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
13595 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
13597 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
13600 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
13602 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
13605 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
13607 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
13610 * Checks if the given object is currently in the success state
13612 bool CResult_CVec_SignatureZNoneZ_is_ok(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR o);
13615 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
13617 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
13620 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
13621 * but with all dynamically-allocated buffers duplicated in new buffers.
13623 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
13626 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
13628 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
13631 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
13633 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
13636 * Checks if the given object is currently in the success state
13638 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
13641 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
13643 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
13646 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
13647 * but with all dynamically-allocated buffers duplicated in new buffers.
13649 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
13652 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
13654 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
13657 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
13659 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
13662 * Checks if the given object is currently in the success state
13664 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
13667 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
13669 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
13672 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
13673 * but with all dynamically-allocated buffers duplicated in new buffers.
13675 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
13678 * Creates a new CResult_NoneErrorZ in the success state.
13680 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
13683 * Creates a new CResult_NoneErrorZ in the error state.
13685 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
13688 * Checks if the given object is currently in the success state
13690 bool CResult_NoneErrorZ_is_ok(const struct LDKCResult_NoneErrorZ *NONNULL_PTR o);
13693 * Frees any resources used by the CResult_NoneErrorZ.
13695 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
13698 * Creates a new CResult_NoneErrorZ which has the same data as `orig`
13699 * but with all dynamically-allocated buffers duplicated in new buffers.
13701 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig);
13704 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
13706 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
13709 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
13711 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
13714 * Checks if the given object is currently in the success state
13716 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
13719 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
13721 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
13724 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
13725 * but with all dynamically-allocated buffers duplicated in new buffers.
13727 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
13730 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13732 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
13735 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13737 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
13740 * Creates a new CResult_RouteDecodeErrorZ in the success state.
13742 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
13745 * Creates a new CResult_RouteDecodeErrorZ in the error state.
13747 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
13750 * Checks if the given object is currently in the success state
13752 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
13755 * Frees any resources used by the CResult_RouteDecodeErrorZ.
13757 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
13760 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
13761 * but with all dynamically-allocated buffers duplicated in new buffers.
13763 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
13766 * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
13768 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
13771 * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
13773 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
13776 * Checks if the given object is currently in the success state
13778 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
13781 * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
13783 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
13786 * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
13787 * but with all dynamically-allocated buffers duplicated in new buffers.
13789 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
13792 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13794 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
13797 * Constructs a new COption_u64Z containing a u64
13799 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
13802 * Constructs a new COption_u64Z containing nothing
13804 struct LDKCOption_u64Z COption_u64Z_none(void);
13807 * Frees any resources associated with the u64, if we are in the Some state
13809 void COption_u64Z_free(struct LDKCOption_u64Z _res);
13812 * Creates a new COption_u64Z which has the same data as `orig`
13813 * but with all dynamically-allocated buffers duplicated in new buffers.
13815 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
13818 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13820 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
13823 * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
13825 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
13828 * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
13830 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
13833 * Checks if the given object is currently in the success state
13835 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
13838 * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
13840 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
13843 * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
13844 * but with all dynamically-allocated buffers duplicated in new buffers.
13846 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
13849 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13851 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
13854 * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
13856 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
13859 * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
13861 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
13864 * Checks if the given object is currently in the success state
13866 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
13869 * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
13871 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
13874 * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
13875 * but with all dynamically-allocated buffers duplicated in new buffers.
13877 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
13880 * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
13882 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
13885 * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
13887 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
13890 * Checks if the given object is currently in the success state
13892 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
13895 * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
13897 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
13900 * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
13901 * but with all dynamically-allocated buffers duplicated in new buffers.
13903 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
13906 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13908 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
13911 * Creates a new CResult_RouteLightningErrorZ in the success state.
13913 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
13916 * Creates a new CResult_RouteLightningErrorZ in the error state.
13918 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
13921 * Checks if the given object is currently in the success state
13923 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
13926 * Frees any resources used by the CResult_RouteLightningErrorZ.
13928 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
13931 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
13932 * but with all dynamically-allocated buffers duplicated in new buffers.
13934 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
13937 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13939 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
13942 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
13944 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
13947 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
13949 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
13952 * Checks if the given object is currently in the success state
13954 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
13957 * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
13959 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
13962 * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
13963 * but with all dynamically-allocated buffers duplicated in new buffers.
13965 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
13968 * Constructs a new COption_ClosureReasonZ containing a crate::lightning::util::events::ClosureReason
13970 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
13973 * Constructs a new COption_ClosureReasonZ containing nothing
13975 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
13978 * Frees any resources associated with the crate::lightning::util::events::ClosureReason, if we are in the Some state
13980 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
13983 * Creates a new COption_ClosureReasonZ which has the same data as `orig`
13984 * but with all dynamically-allocated buffers duplicated in new buffers.
13986 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
13989 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
13991 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
13994 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
13996 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
13999 * Checks if the given object is currently in the success state
14001 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
14004 * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
14006 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
14009 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
14010 * but with all dynamically-allocated buffers duplicated in new buffers.
14012 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
14015 * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::util::events::HTLCDestination
14017 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o);
14020 * Constructs a new COption_HTLCDestinationZ containing nothing
14022 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void);
14025 * Frees any resources associated with the crate::lightning::util::events::HTLCDestination, if we are in the Some state
14027 void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res);
14030 * Creates a new COption_HTLCDestinationZ which has the same data as `orig`
14031 * but with all dynamically-allocated buffers duplicated in new buffers.
14033 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig);
14036 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state.
14038 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o);
14041 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
14043 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e);
14046 * Checks if the given object is currently in the success state
14048 bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o);
14051 * Frees any resources used by the CResult_COption_HTLCDestinationZDecodeErrorZ.
14053 void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res);
14056 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ which has the same data as `orig`
14057 * but with all dynamically-allocated buffers duplicated in new buffers.
14059 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
14062 * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
14064 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
14067 * Constructs a new COption_NetworkUpdateZ containing nothing
14069 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
14072 * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
14074 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
14077 * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
14078 * but with all dynamically-allocated buffers duplicated in new buffers.
14080 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
14083 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14085 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
14088 * Constructs a new COption_EventZ containing a crate::lightning::util::events::Event
14090 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
14093 * Constructs a new COption_EventZ containing nothing
14095 struct LDKCOption_EventZ COption_EventZ_none(void);
14098 * Frees any resources associated with the crate::lightning::util::events::Event, if we are in the Some state
14100 void COption_EventZ_free(struct LDKCOption_EventZ _res);
14103 * Creates a new COption_EventZ which has the same data as `orig`
14104 * but with all dynamically-allocated buffers duplicated in new buffers.
14106 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
14109 * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
14111 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
14114 * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
14116 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
14119 * Checks if the given object is currently in the success state
14121 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
14124 * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
14126 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
14129 * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
14130 * but with all dynamically-allocated buffers duplicated in new buffers.
14132 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
14135 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14137 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
14140 * Creates a new CResult_TxOutAccessErrorZ in the success state.
14142 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
14145 * Creates a new CResult_TxOutAccessErrorZ in the error state.
14147 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
14150 * Checks if the given object is currently in the success state
14152 bool CResult_TxOutAccessErrorZ_is_ok(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR o);
14155 * Frees any resources used by the CResult_TxOutAccessErrorZ.
14157 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
14160 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
14161 * but with all dynamically-allocated buffers duplicated in new buffers.
14163 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
14166 * Creates a new tuple which has the same data as `orig`
14167 * but with all dynamically-allocated buffers duplicated in new buffers.
14169 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
14172 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
14174 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
14177 * Frees any resources used by the C2Tuple_usizeTransactionZ.
14179 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
14182 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14184 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
14187 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14189 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
14192 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
14194 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
14197 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
14199 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
14202 * Checks if the given object is currently in the success state
14204 bool CResult_NoneChannelMonitorUpdateErrZ_is_ok(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR o);
14207 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
14209 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
14212 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
14213 * but with all dynamically-allocated buffers duplicated in new buffers.
14215 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
14218 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14220 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
14223 * Creates a new tuple which has the same data as `orig`
14224 * but with all dynamically-allocated buffers duplicated in new buffers.
14226 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig);
14229 * Creates a new C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ from the contained elements.
14231 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b, struct LDKPublicKey c);
14234 * Frees any resources used by the C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ.
14236 void C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res);
14239 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14241 void CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res);
14244 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
14246 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
14249 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
14251 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
14254 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
14256 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
14259 * Creates a new COption_C2Tuple_usizeTransactionZZ which has the same data as `orig`
14260 * but with all dynamically-allocated buffers duplicated in new buffers.
14262 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_clone(const struct LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR orig);
14265 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
14267 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
14270 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
14272 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
14275 * Checks if the given object is currently in the success state
14277 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
14280 * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
14282 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
14285 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
14286 * but with all dynamically-allocated buffers duplicated in new buffers.
14288 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
14291 * Creates a new tuple which has the same data as `orig`
14292 * but with all dynamically-allocated buffers duplicated in new buffers.
14294 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
14297 * Creates a new C2Tuple_u64u64Z from the contained elements.
14299 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
14302 * Frees any resources used by the C2Tuple_u64u64Z.
14304 void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
14307 * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
14309 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
14312 * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
14314 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
14317 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
14319 void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
14322 * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
14323 * but with all dynamically-allocated buffers duplicated in new buffers.
14325 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
14328 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14330 void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
14333 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
14335 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
14338 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
14340 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
14343 * Checks if the given object is currently in the success state
14345 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
14348 * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
14350 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
14353 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
14355 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
14358 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
14360 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
14363 * Checks if the given object is currently in the success state
14365 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
14368 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
14370 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
14373 * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
14374 * but with all dynamically-allocated buffers duplicated in new buffers.
14376 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
14379 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
14381 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
14384 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
14386 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
14389 * Checks if the given object is currently in the success state
14391 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
14394 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
14396 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
14399 * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
14400 * but with all dynamically-allocated buffers duplicated in new buffers.
14402 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
14405 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
14407 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
14410 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
14412 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
14415 * Checks if the given object is currently in the success state
14417 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
14420 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
14422 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
14425 * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
14426 * but with all dynamically-allocated buffers duplicated in new buffers.
14428 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
14431 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
14433 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
14436 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
14438 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
14441 * Checks if the given object is currently in the success state
14443 bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
14446 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
14448 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
14451 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
14452 * but with all dynamically-allocated buffers duplicated in new buffers.
14454 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
14457 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
14459 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
14462 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
14464 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
14467 * Checks if the given object is currently in the success state
14469 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
14472 * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
14474 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
14477 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
14478 * but with all dynamically-allocated buffers duplicated in new buffers.
14480 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
14483 * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
14485 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
14488 * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
14490 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
14493 * Checks if the given object is currently in the success state
14495 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
14498 * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
14500 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
14503 * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
14504 * but with all dynamically-allocated buffers duplicated in new buffers.
14506 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
14509 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
14511 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
14514 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
14516 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
14519 * Checks if the given object is currently in the success state
14521 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
14524 * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
14526 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
14529 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
14530 * but with all dynamically-allocated buffers duplicated in new buffers.
14532 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
14535 * Constructs a new COption_AccessZ containing a crate::lightning::chain::Access
14537 struct LDKCOption_AccessZ COption_AccessZ_some(struct LDKAccess o);
14540 * Constructs a new COption_AccessZ containing nothing
14542 struct LDKCOption_AccessZ COption_AccessZ_none(void);
14545 * Frees any resources associated with the crate::lightning::chain::Access, if we are in the Some state
14547 void COption_AccessZ_free(struct LDKCOption_AccessZ _res);
14550 * Creates a new CResult_boolLightningErrorZ in the success state.
14552 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
14555 * Creates a new CResult_boolLightningErrorZ in the error state.
14557 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
14560 * Checks if the given object is currently in the success state
14562 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
14565 * Frees any resources used by the CResult_boolLightningErrorZ.
14567 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
14570 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
14571 * but with all dynamically-allocated buffers duplicated in new buffers.
14573 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
14576 * Creates a new tuple which has the same data as `orig`
14577 * but with all dynamically-allocated buffers duplicated in new buffers.
14579 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
14582 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
14584 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
14587 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
14589 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
14592 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14594 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
14597 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14599 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
14602 * Creates a new CResult_NoneLightningErrorZ in the success state.
14604 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
14607 * Creates a new CResult_NoneLightningErrorZ in the error state.
14609 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
14612 * Checks if the given object is currently in the success state
14614 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
14617 * Frees any resources used by the CResult_NoneLightningErrorZ.
14619 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
14622 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
14623 * but with all dynamically-allocated buffers duplicated in new buffers.
14625 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
14628 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
14630 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
14633 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
14635 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
14638 * Checks if the given object is currently in the success state
14640 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
14643 * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
14645 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
14648 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
14649 * but with all dynamically-allocated buffers duplicated in new buffers.
14651 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
14654 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
14656 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
14659 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
14661 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
14664 * Checks if the given object is currently in the success state
14666 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
14669 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
14671 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
14674 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
14675 * but with all dynamically-allocated buffers duplicated in new buffers.
14677 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
14680 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
14682 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
14685 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
14687 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
14690 * Checks if the given object is currently in the success state
14692 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
14695 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
14697 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
14700 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
14701 * but with all dynamically-allocated buffers duplicated in new buffers.
14703 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
14706 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14708 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
14711 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
14713 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
14716 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
14718 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
14721 * Checks if the given object is currently in the success state
14723 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
14726 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
14728 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
14731 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
14732 * but with all dynamically-allocated buffers duplicated in new buffers.
14734 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
14737 * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
14739 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
14742 * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
14744 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
14747 * Checks if the given object is currently in the success state
14749 bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
14752 * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
14754 void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
14757 * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
14758 * but with all dynamically-allocated buffers duplicated in new buffers.
14760 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
14763 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
14765 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
14768 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
14770 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
14773 * Checks if the given object is currently in the success state
14775 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
14778 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
14780 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
14783 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
14784 * but with all dynamically-allocated buffers duplicated in new buffers.
14786 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
14789 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
14791 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
14794 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
14796 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
14799 * Checks if the given object is currently in the success state
14801 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
14804 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
14806 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
14809 * Constructs a new COption_CVec_NetAddressZZ containing a crate::c_types::derived::CVec_NetAddressZ
14811 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o);
14814 * Constructs a new COption_CVec_NetAddressZZ containing nothing
14816 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void);
14819 * Frees any resources associated with the crate::c_types::derived::CVec_NetAddressZ, if we are in the Some state
14821 void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res);
14824 * Creates a new COption_CVec_NetAddressZZ which has the same data as `orig`
14825 * but with all dynamically-allocated buffers duplicated in new buffers.
14827 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig);
14830 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
14832 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
14835 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
14837 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
14840 * Checks if the given object is currently in the success state
14842 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
14845 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
14847 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
14850 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
14851 * but with all dynamically-allocated buffers duplicated in new buffers.
14853 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
14856 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
14858 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
14861 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
14863 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
14866 * Checks if the given object is currently in the success state
14868 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
14871 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
14873 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
14876 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
14877 * but with all dynamically-allocated buffers duplicated in new buffers.
14879 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
14882 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
14884 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
14887 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
14889 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
14892 * Checks if the given object is currently in the success state
14894 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
14897 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
14899 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
14902 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
14903 * but with all dynamically-allocated buffers duplicated in new buffers.
14905 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
14908 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14910 void CVec_PaymentPreimageZ_free(struct LDKCVec_PaymentPreimageZ _res);
14913 * Creates a new tuple which has the same data as `orig`
14914 * but with all dynamically-allocated buffers duplicated in new buffers.
14916 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
14919 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
14921 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
14924 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
14926 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
14929 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
14931 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
14934 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
14936 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
14939 * Checks if the given object is currently in the success state
14941 bool CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR o);
14944 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
14946 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
14949 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
14950 * but with all dynamically-allocated buffers duplicated in new buffers.
14952 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
14955 * Creates a new CResult_SignatureNoneZ in the success state.
14957 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
14960 * Creates a new CResult_SignatureNoneZ in the error state.
14962 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
14965 * Checks if the given object is currently in the success state
14967 bool CResult_SignatureNoneZ_is_ok(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR o);
14970 * Frees any resources used by the CResult_SignatureNoneZ.
14972 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
14975 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
14976 * but with all dynamically-allocated buffers duplicated in new buffers.
14978 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
14981 * Creates a new tuple which has the same data as `orig`
14982 * but with all dynamically-allocated buffers duplicated in new buffers.
14984 struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_clone(const struct LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR orig);
14987 * Creates a new C2Tuple_SignatureSignatureZ from the contained elements.
14989 struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_new(struct LDKSignature a, struct LDKSignature b);
14992 * Frees any resources used by the C2Tuple_SignatureSignatureZ.
14994 void C2Tuple_SignatureSignatureZ_free(struct LDKC2Tuple_SignatureSignatureZ _res);
14997 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the success state.
14999 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_ok(struct LDKC2Tuple_SignatureSignatureZ o);
15002 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the error state.
15004 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_err(void);
15007 * Checks if the given object is currently in the success state
15009 bool CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR o);
15012 * Frees any resources used by the CResult_C2Tuple_SignatureSignatureZNoneZ.
15014 void CResult_C2Tuple_SignatureSignatureZNoneZ_free(struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res);
15017 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ which has the same data as `orig`
15018 * but with all dynamically-allocated buffers duplicated in new buffers.
15020 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR orig);
15023 * Creates a new CResult_SecretKeyNoneZ in the success state.
15025 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_ok(struct LDKSecretKey o);
15028 * Creates a new CResult_SecretKeyNoneZ in the error state.
15030 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_err(void);
15033 * Checks if the given object is currently in the success state
15035 bool CResult_SecretKeyNoneZ_is_ok(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR o);
15038 * Frees any resources used by the CResult_SecretKeyNoneZ.
15040 void CResult_SecretKeyNoneZ_free(struct LDKCResult_SecretKeyNoneZ _res);
15043 * Creates a new CResult_SecretKeyNoneZ which has the same data as `orig`
15044 * but with all dynamically-allocated buffers duplicated in new buffers.
15046 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_clone(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR orig);
15049 * Creates a new CResult_SignDecodeErrorZ in the success state.
15051 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
15054 * Creates a new CResult_SignDecodeErrorZ in the error state.
15056 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
15059 * Checks if the given object is currently in the success state
15061 bool CResult_SignDecodeErrorZ_is_ok(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR o);
15064 * Frees any resources used by the CResult_SignDecodeErrorZ.
15066 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
15069 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
15070 * but with all dynamically-allocated buffers duplicated in new buffers.
15072 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
15075 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15077 void CVec_u5Z_free(struct LDKCVec_u5Z _res);
15080 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
15082 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
15085 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
15087 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
15090 * Checks if the given object is currently in the success state
15092 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
15095 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
15097 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
15100 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
15101 * but with all dynamically-allocated buffers duplicated in new buffers.
15103 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
15106 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15108 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
15111 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15113 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
15116 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
15118 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
15121 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
15123 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
15126 * Checks if the given object is currently in the success state
15128 bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o);
15131 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
15133 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
15136 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
15137 * but with all dynamically-allocated buffers duplicated in new buffers.
15139 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
15142 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
15144 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
15147 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
15149 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
15152 * Checks if the given object is currently in the success state
15154 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
15157 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
15159 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
15162 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
15163 * but with all dynamically-allocated buffers duplicated in new buffers.
15165 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
15168 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15170 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
15173 * Creates a new CResult_TransactionNoneZ in the success state.
15175 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
15178 * Creates a new CResult_TransactionNoneZ in the error state.
15180 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
15183 * Checks if the given object is currently in the success state
15185 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
15188 * Frees any resources used by the CResult_TransactionNoneZ.
15190 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
15193 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
15194 * but with all dynamically-allocated buffers duplicated in new buffers.
15196 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
15199 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
15201 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
15204 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
15206 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
15209 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15211 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
15214 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
15216 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
15219 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
15221 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
15224 * Checks if the given object is currently in the success state
15226 bool CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR o);
15229 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
15231 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
15234 * Constructs a new COption_u16Z containing a u16
15236 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
15239 * Constructs a new COption_u16Z containing nothing
15241 struct LDKCOption_u16Z COption_u16Z_none(void);
15244 * Frees any resources associated with the u16, if we are in the Some state
15246 void COption_u16Z_free(struct LDKCOption_u16Z _res);
15249 * Creates a new COption_u16Z which has the same data as `orig`
15250 * but with all dynamically-allocated buffers duplicated in new buffers.
15252 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
15255 * Creates a new CResult_NoneAPIErrorZ in the success state.
15257 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
15260 * Creates a new CResult_NoneAPIErrorZ in the error state.
15262 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
15265 * Checks if the given object is currently in the success state
15267 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
15270 * Frees any resources used by the CResult_NoneAPIErrorZ.
15272 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
15275 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
15276 * but with all dynamically-allocated buffers duplicated in new buffers.
15278 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
15281 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15283 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
15286 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15288 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
15291 * Creates a new CResult__u832APIErrorZ in the success state.
15293 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_ok(struct LDKThirtyTwoBytes o);
15296 * Creates a new CResult__u832APIErrorZ in the error state.
15298 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_err(struct LDKAPIError e);
15301 * Checks if the given object is currently in the success state
15303 bool CResult__u832APIErrorZ_is_ok(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR o);
15306 * Frees any resources used by the CResult__u832APIErrorZ.
15308 void CResult__u832APIErrorZ_free(struct LDKCResult__u832APIErrorZ _res);
15311 * Creates a new CResult__u832APIErrorZ which has the same data as `orig`
15312 * but with all dynamically-allocated buffers duplicated in new buffers.
15314 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig);
15317 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the success state.
15319 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
15322 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the error state.
15324 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
15327 * Checks if the given object is currently in the success state
15329 bool CResult_PaymentIdPaymentSendFailureZ_is_ok(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR o);
15332 * Frees any resources used by the CResult_PaymentIdPaymentSendFailureZ.
15334 void CResult_PaymentIdPaymentSendFailureZ_free(struct LDKCResult_PaymentIdPaymentSendFailureZ _res);
15337 * Creates a new CResult_PaymentIdPaymentSendFailureZ which has the same data as `orig`
15338 * but with all dynamically-allocated buffers duplicated in new buffers.
15340 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_clone(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR orig);
15343 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
15345 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
15348 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
15350 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
15353 * Checks if the given object is currently in the success state
15355 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
15358 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
15360 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
15363 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
15364 * but with all dynamically-allocated buffers duplicated in new buffers.
15366 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
15369 * Creates a new tuple which has the same data as `orig`
15370 * but with all dynamically-allocated buffers duplicated in new buffers.
15372 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig);
15375 * Creates a new C2Tuple_PaymentHashPaymentIdZ from the contained elements.
15377 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
15380 * Frees any resources used by the C2Tuple_PaymentHashPaymentIdZ.
15382 void C2Tuple_PaymentHashPaymentIdZ_free(struct LDKC2Tuple_PaymentHashPaymentIdZ _res);
15385 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the success state.
15387 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(struct LDKC2Tuple_PaymentHashPaymentIdZ o);
15390 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the error state.
15392 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
15395 * Checks if the given object is currently in the success state
15397 bool CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR o);
15400 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.
15402 void CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res);
15405 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ which has the same data as `orig`
15406 * but with all dynamically-allocated buffers duplicated in new buffers.
15408 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig);
15411 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15413 void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
15416 * Creates a new tuple which has the same data as `orig`
15417 * but with all dynamically-allocated buffers duplicated in new buffers.
15419 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig);
15422 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
15424 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
15427 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
15429 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
15432 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the success state.
15434 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
15437 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the error state.
15439 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(void);
15442 * Checks if the given object is currently in the success state
15444 bool CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR o);
15447 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ.
15449 void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res);
15452 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ which has the same data as `orig`
15453 * but with all dynamically-allocated buffers duplicated in new buffers.
15455 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR orig);
15458 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the success state.
15460 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
15463 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the error state.
15465 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(struct LDKAPIError e);
15468 * Checks if the given object is currently in the success state
15470 bool CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR o);
15473 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.
15475 void CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res);
15478 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ which has the same data as `orig`
15479 * but with all dynamically-allocated buffers duplicated in new buffers.
15481 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR orig);
15484 * Creates a new CResult_PaymentSecretNoneZ in the success state.
15486 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
15489 * Creates a new CResult_PaymentSecretNoneZ in the error state.
15491 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_err(void);
15494 * Checks if the given object is currently in the success state
15496 bool CResult_PaymentSecretNoneZ_is_ok(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR o);
15499 * Frees any resources used by the CResult_PaymentSecretNoneZ.
15501 void CResult_PaymentSecretNoneZ_free(struct LDKCResult_PaymentSecretNoneZ _res);
15504 * Creates a new CResult_PaymentSecretNoneZ which has the same data as `orig`
15505 * but with all dynamically-allocated buffers duplicated in new buffers.
15507 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_clone(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR orig);
15510 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
15512 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
15515 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
15517 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
15520 * Checks if the given object is currently in the success state
15522 bool CResult_PaymentSecretAPIErrorZ_is_ok(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR o);
15525 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
15527 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
15530 * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig`
15531 * but with all dynamically-allocated buffers duplicated in new buffers.
15533 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig);
15536 * Creates a new CResult_PaymentPreimageAPIErrorZ in the success state.
15538 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
15541 * Creates a new CResult_PaymentPreimageAPIErrorZ in the error state.
15543 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_err(struct LDKAPIError e);
15546 * Checks if the given object is currently in the success state
15548 bool CResult_PaymentPreimageAPIErrorZ_is_ok(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR o);
15551 * Frees any resources used by the CResult_PaymentPreimageAPIErrorZ.
15553 void CResult_PaymentPreimageAPIErrorZ_free(struct LDKCResult_PaymentPreimageAPIErrorZ _res);
15556 * Creates a new CResult_PaymentPreimageAPIErrorZ which has the same data as `orig`
15557 * but with all dynamically-allocated buffers duplicated in new buffers.
15559 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_clone(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR orig);
15562 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
15564 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
15567 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
15569 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
15572 * Checks if the given object is currently in the success state
15574 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
15577 * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
15579 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
15582 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
15583 * but with all dynamically-allocated buffers duplicated in new buffers.
15585 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
15588 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
15590 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
15593 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
15595 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
15598 * Checks if the given object is currently in the success state
15600 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
15603 * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
15605 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
15608 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
15609 * but with all dynamically-allocated buffers duplicated in new buffers.
15611 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
15614 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
15616 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
15619 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
15621 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
15624 * Checks if the given object is currently in the success state
15626 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
15629 * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
15631 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
15634 * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
15635 * but with all dynamically-allocated buffers duplicated in new buffers.
15637 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
15640 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
15642 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
15645 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
15647 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
15650 * Checks if the given object is currently in the success state
15652 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
15655 * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
15657 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
15660 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
15661 * but with all dynamically-allocated buffers duplicated in new buffers.
15663 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
15666 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15668 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
15671 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
15673 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
15676 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
15678 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
15681 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
15683 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
15686 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
15688 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
15691 * Checks if the given object is currently in the success state
15693 bool CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR o);
15696 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
15698 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
15701 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
15703 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
15706 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
15708 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
15711 * Checks if the given object is currently in the success state
15713 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
15716 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
15718 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
15721 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
15722 * but with all dynamically-allocated buffers duplicated in new buffers.
15724 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
15727 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
15729 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
15732 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
15734 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
15737 * Checks if the given object is currently in the success state
15739 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
15742 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
15744 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
15747 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
15748 * but with all dynamically-allocated buffers duplicated in new buffers.
15750 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
15753 * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
15755 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
15758 * Constructs a new COption_TypeZ containing nothing
15760 struct LDKCOption_TypeZ COption_TypeZ_none(void);
15763 * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
15765 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
15768 * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
15770 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
15773 * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
15775 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
15778 * Checks if the given object is currently in the success state
15780 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
15783 * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
15785 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
15788 * Creates a new CResult_PaymentIdPaymentErrorZ in the success state.
15790 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
15793 * Creates a new CResult_PaymentIdPaymentErrorZ in the error state.
15795 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e);
15798 * Checks if the given object is currently in the success state
15800 bool CResult_PaymentIdPaymentErrorZ_is_ok(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR o);
15803 * Frees any resources used by the CResult_PaymentIdPaymentErrorZ.
15805 void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res);
15808 * Creates a new CResult_PaymentIdPaymentErrorZ which has the same data as `orig`
15809 * but with all dynamically-allocated buffers duplicated in new buffers.
15811 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig);
15814 * Creates a new CResult_SiPrefixParseErrorZ in the success state.
15816 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_ok(enum LDKSiPrefix o);
15819 * Creates a new CResult_SiPrefixParseErrorZ in the error state.
15821 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_err(struct LDKParseError e);
15824 * Checks if the given object is currently in the success state
15826 bool CResult_SiPrefixParseErrorZ_is_ok(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR o);
15829 * Frees any resources used by the CResult_SiPrefixParseErrorZ.
15831 void CResult_SiPrefixParseErrorZ_free(struct LDKCResult_SiPrefixParseErrorZ _res);
15834 * Creates a new CResult_SiPrefixParseErrorZ which has the same data as `orig`
15835 * but with all dynamically-allocated buffers duplicated in new buffers.
15837 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_clone(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR orig);
15840 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the success state.
15842 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_ok(struct LDKInvoice o);
15845 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the error state.
15847 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
15850 * Checks if the given object is currently in the success state
15852 bool CResult_InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
15855 * Frees any resources used by the CResult_InvoiceParseOrSemanticErrorZ.
15857 void CResult_InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_InvoiceParseOrSemanticErrorZ _res);
15860 * Creates a new CResult_InvoiceParseOrSemanticErrorZ which has the same data as `orig`
15861 * but with all dynamically-allocated buffers duplicated in new buffers.
15863 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
15866 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the success state.
15868 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_ok(struct LDKSignedRawInvoice o);
15871 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the error state.
15873 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_err(struct LDKParseError e);
15876 * Checks if the given object is currently in the success state
15878 bool CResult_SignedRawInvoiceParseErrorZ_is_ok(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR o);
15881 * Frees any resources used by the CResult_SignedRawInvoiceParseErrorZ.
15883 void CResult_SignedRawInvoiceParseErrorZ_free(struct LDKCResult_SignedRawInvoiceParseErrorZ _res);
15886 * Creates a new CResult_SignedRawInvoiceParseErrorZ which has the same data as `orig`
15887 * but with all dynamically-allocated buffers duplicated in new buffers.
15889 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_clone(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR orig);
15892 * Creates a new tuple which has the same data as `orig`
15893 * but with all dynamically-allocated buffers duplicated in new buffers.
15895 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig);
15898 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
15900 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
15903 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
15905 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
15908 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
15910 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
15913 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
15915 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
15918 * Checks if the given object is currently in the success state
15920 bool CResult_PayeePubKeyErrorZ_is_ok(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR o);
15923 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
15925 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
15928 * Creates a new CResult_PayeePubKeyErrorZ which has the same data as `orig`
15929 * but with all dynamically-allocated buffers duplicated in new buffers.
15931 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig);
15934 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15936 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
15939 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
15941 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
15944 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
15946 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
15949 * Checks if the given object is currently in the success state
15951 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
15954 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
15956 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
15959 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
15960 * but with all dynamically-allocated buffers duplicated in new buffers.
15962 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
15965 * Creates a new CResult_NoneSemanticErrorZ in the success state.
15967 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
15970 * Creates a new CResult_NoneSemanticErrorZ in the error state.
15972 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
15975 * Checks if the given object is currently in the success state
15977 bool CResult_NoneSemanticErrorZ_is_ok(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR o);
15980 * Frees any resources used by the CResult_NoneSemanticErrorZ.
15982 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
15985 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
15986 * but with all dynamically-allocated buffers duplicated in new buffers.
15988 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
15991 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
15993 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
15996 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
15998 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
16001 * Checks if the given object is currently in the success state
16003 bool CResult_InvoiceSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR o);
16006 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
16008 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
16011 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
16012 * but with all dynamically-allocated buffers duplicated in new buffers.
16014 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
16017 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
16019 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
16022 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
16024 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
16027 * Checks if the given object is currently in the success state
16029 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
16032 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
16034 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
16037 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
16038 * but with all dynamically-allocated buffers duplicated in new buffers.
16040 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
16043 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
16045 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
16048 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
16050 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
16053 * Checks if the given object is currently in the success state
16055 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
16058 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
16060 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
16063 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
16064 * but with all dynamically-allocated buffers duplicated in new buffers.
16066 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
16069 * Creates a new CResult_StringErrorZ in the success state.
16071 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
16074 * Creates a new CResult_StringErrorZ in the error state.
16076 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
16079 * Checks if the given object is currently in the success state
16081 bool CResult_StringErrorZ_is_ok(const struct LDKCResult_StringErrorZ *NONNULL_PTR o);
16084 * Frees any resources used by the CResult_StringErrorZ.
16086 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
16089 * Creates a new CResult_StringErrorZ which has the same data as `orig`
16090 * but with all dynamically-allocated buffers duplicated in new buffers.
16092 struct LDKCResult_StringErrorZ CResult_StringErrorZ_clone(const struct LDKCResult_StringErrorZ *NONNULL_PTR orig);
16095 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
16097 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
16100 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
16102 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
16105 * Checks if the given object is currently in the success state
16107 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
16110 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
16112 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
16115 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
16116 * but with all dynamically-allocated buffers duplicated in new buffers.
16118 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
16121 * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
16123 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
16126 * Constructs a new COption_MonitorEventZ containing nothing
16128 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
16131 * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
16133 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
16136 * Creates a new COption_MonitorEventZ which has the same data as `orig`
16137 * but with all dynamically-allocated buffers duplicated in new buffers.
16139 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
16142 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
16144 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
16147 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
16149 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
16152 * Checks if the given object is currently in the success state
16154 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
16157 * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
16159 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
16162 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
16163 * but with all dynamically-allocated buffers duplicated in new buffers.
16165 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
16168 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
16170 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
16173 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
16175 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
16178 * Checks if the given object is currently in the success state
16180 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
16183 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
16185 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
16188 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
16189 * but with all dynamically-allocated buffers duplicated in new buffers.
16191 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
16194 * Creates a new tuple which has the same data as `orig`
16195 * but with all dynamically-allocated buffers duplicated in new buffers.
16197 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
16200 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
16202 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
16205 * Frees any resources used by the C2Tuple_OutPointScriptZ.
16207 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
16210 * Creates a new tuple which has the same data as `orig`
16211 * but with all dynamically-allocated buffers duplicated in new buffers.
16213 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
16216 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
16218 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
16221 * Frees any resources used by the C2Tuple_u32ScriptZ.
16223 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
16226 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16228 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
16231 * Creates a new tuple which has the same data as `orig`
16232 * but with all dynamically-allocated buffers duplicated in new buffers.
16234 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig);
16237 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
16239 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
16242 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
16244 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
16247 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16249 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
16252 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16254 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
16257 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16259 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
16262 * Creates a new tuple which has the same data as `orig`
16263 * but with all dynamically-allocated buffers duplicated in new buffers.
16265 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
16268 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
16270 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
16273 * Frees any resources used by the C2Tuple_u32TxOutZ.
16275 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
16278 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16280 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
16283 * Creates a new tuple which has the same data as `orig`
16284 * but with all dynamically-allocated buffers duplicated in new buffers.
16286 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
16289 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
16291 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
16294 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
16296 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
16299 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16301 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
16304 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16306 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
16309 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
16311 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
16314 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
16316 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
16319 * Checks if the given object is currently in the success state
16321 bool CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
16324 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
16326 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
16329 * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
16331 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
16334 * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
16336 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
16339 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16341 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
16344 * Constructs a new COption_NetAddressZ containing a crate::lightning::ln::msgs::NetAddress
16346 struct LDKCOption_NetAddressZ COption_NetAddressZ_some(struct LDKNetAddress o);
16349 * Constructs a new COption_NetAddressZ containing nothing
16351 struct LDKCOption_NetAddressZ COption_NetAddressZ_none(void);
16354 * Frees any resources associated with the crate::lightning::ln::msgs::NetAddress, if we are in the Some state
16356 void COption_NetAddressZ_free(struct LDKCOption_NetAddressZ _res);
16359 * Creates a new COption_NetAddressZ which has the same data as `orig`
16360 * but with all dynamically-allocated buffers duplicated in new buffers.
16362 struct LDKCOption_NetAddressZ COption_NetAddressZ_clone(const struct LDKCOption_NetAddressZ *NONNULL_PTR orig);
16365 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
16367 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
16370 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
16372 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
16375 * Checks if the given object is currently in the success state
16377 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
16380 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
16382 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
16385 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
16386 * but with all dynamically-allocated buffers duplicated in new buffers.
16388 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
16391 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
16393 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
16396 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
16398 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
16401 * Checks if the given object is currently in the success state
16403 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
16406 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
16408 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
16411 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
16412 * but with all dynamically-allocated buffers duplicated in new buffers.
16414 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
16417 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
16419 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
16422 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
16424 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
16427 * Checks if the given object is currently in the success state
16429 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
16432 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
16434 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
16437 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
16438 * but with all dynamically-allocated buffers duplicated in new buffers.
16440 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
16443 * Creates a new CResult_u32GraphSyncErrorZ in the success state.
16445 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
16448 * Creates a new CResult_u32GraphSyncErrorZ in the error state.
16450 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
16453 * Checks if the given object is currently in the success state
16455 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
16458 * Frees any resources used by the CResult_u32GraphSyncErrorZ.
16460 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
16463 * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
16465 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
16468 * Creates a new CResult_NetAddressDecodeErrorZ in the error state.
16470 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
16473 * Checks if the given object is currently in the success state
16475 bool CResult_NetAddressDecodeErrorZ_is_ok(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR o);
16478 * Frees any resources used by the CResult_NetAddressDecodeErrorZ.
16480 void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
16483 * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig`
16484 * but with all dynamically-allocated buffers duplicated in new buffers.
16486 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
16489 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16491 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
16494 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16496 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
16499 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16501 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
16504 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16506 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
16509 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
16511 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
16514 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
16516 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
16519 * Checks if the given object is currently in the success state
16521 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
16524 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
16526 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
16529 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
16530 * but with all dynamically-allocated buffers duplicated in new buffers.
16532 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
16535 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
16537 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
16540 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
16542 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
16545 * Checks if the given object is currently in the success state
16547 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
16550 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
16552 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
16555 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
16556 * but with all dynamically-allocated buffers duplicated in new buffers.
16558 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
16561 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
16563 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
16566 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
16568 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
16571 * Checks if the given object is currently in the success state
16573 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
16576 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
16578 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
16581 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
16582 * but with all dynamically-allocated buffers duplicated in new buffers.
16584 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
16587 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
16589 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
16592 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
16594 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
16597 * Checks if the given object is currently in the success state
16599 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
16602 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
16604 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
16607 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
16608 * but with all dynamically-allocated buffers duplicated in new buffers.
16610 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
16613 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
16615 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
16618 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
16620 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
16623 * Checks if the given object is currently in the success state
16625 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
16628 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
16630 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
16633 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
16634 * but with all dynamically-allocated buffers duplicated in new buffers.
16636 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
16639 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
16641 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
16644 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
16646 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
16649 * Checks if the given object is currently in the success state
16651 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
16654 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
16656 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
16659 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
16660 * but with all dynamically-allocated buffers duplicated in new buffers.
16662 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
16665 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
16667 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
16670 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
16672 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
16675 * Checks if the given object is currently in the success state
16677 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
16680 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
16682 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
16685 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
16686 * but with all dynamically-allocated buffers duplicated in new buffers.
16688 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
16691 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
16693 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
16696 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
16698 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
16701 * Checks if the given object is currently in the success state
16703 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
16706 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
16708 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
16711 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
16712 * but with all dynamically-allocated buffers duplicated in new buffers.
16714 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
16717 * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
16719 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
16722 * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
16724 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
16727 * Checks if the given object is currently in the success state
16729 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
16732 * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
16734 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
16737 * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
16738 * but with all dynamically-allocated buffers duplicated in new buffers.
16740 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
16743 * Creates a new CResult_InitDecodeErrorZ in the success state.
16745 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
16748 * Creates a new CResult_InitDecodeErrorZ in the error state.
16750 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
16753 * Checks if the given object is currently in the success state
16755 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
16758 * Frees any resources used by the CResult_InitDecodeErrorZ.
16760 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
16763 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
16764 * but with all dynamically-allocated buffers duplicated in new buffers.
16766 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
16769 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
16771 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
16774 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
16776 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
16779 * Checks if the given object is currently in the success state
16781 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
16784 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
16786 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
16789 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
16790 * but with all dynamically-allocated buffers duplicated in new buffers.
16792 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
16795 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
16797 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
16800 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
16802 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
16805 * Checks if the given object is currently in the success state
16807 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
16810 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
16812 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
16815 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
16816 * but with all dynamically-allocated buffers duplicated in new buffers.
16818 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
16821 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
16823 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
16826 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
16828 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
16831 * Checks if the given object is currently in the success state
16833 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
16836 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
16838 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
16841 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
16842 * but with all dynamically-allocated buffers duplicated in new buffers.
16844 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
16847 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
16849 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
16852 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
16854 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16857 * Checks if the given object is currently in the success state
16859 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
16862 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
16864 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
16867 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
16868 * but with all dynamically-allocated buffers duplicated in new buffers.
16870 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
16873 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
16875 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
16878 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
16880 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16883 * Checks if the given object is currently in the success state
16885 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
16888 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
16890 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
16893 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
16894 * but with all dynamically-allocated buffers duplicated in new buffers.
16896 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
16899 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
16901 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
16904 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
16906 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
16909 * Checks if the given object is currently in the success state
16911 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
16914 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
16916 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
16919 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
16920 * but with all dynamically-allocated buffers duplicated in new buffers.
16922 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
16925 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
16927 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
16930 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
16932 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16935 * Checks if the given object is currently in the success state
16937 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
16940 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
16942 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
16945 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
16946 * but with all dynamically-allocated buffers duplicated in new buffers.
16948 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
16951 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
16953 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
16956 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
16958 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16961 * Checks if the given object is currently in the success state
16963 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
16966 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
16968 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
16971 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
16972 * but with all dynamically-allocated buffers duplicated in new buffers.
16974 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
16977 * Creates a new CResult_PingDecodeErrorZ in the success state.
16979 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
16982 * Creates a new CResult_PingDecodeErrorZ in the error state.
16984 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
16987 * Checks if the given object is currently in the success state
16989 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
16992 * Frees any resources used by the CResult_PingDecodeErrorZ.
16994 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
16997 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
16998 * but with all dynamically-allocated buffers duplicated in new buffers.
17000 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
17003 * Creates a new CResult_PongDecodeErrorZ in the success state.
17005 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
17008 * Creates a new CResult_PongDecodeErrorZ in the error state.
17010 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
17013 * Checks if the given object is currently in the success state
17015 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
17018 * Frees any resources used by the CResult_PongDecodeErrorZ.
17020 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
17023 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
17024 * but with all dynamically-allocated buffers duplicated in new buffers.
17026 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
17029 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
17031 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
17034 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
17036 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
17039 * Checks if the given object is currently in the success state
17041 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
17044 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
17046 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
17049 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
17050 * but with all dynamically-allocated buffers duplicated in new buffers.
17052 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
17055 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
17057 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
17060 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
17062 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
17065 * Checks if the given object is currently in the success state
17067 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
17070 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
17072 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
17075 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
17076 * but with all dynamically-allocated buffers duplicated in new buffers.
17078 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
17081 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
17083 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
17086 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
17088 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
17091 * Checks if the given object is currently in the success state
17093 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
17096 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
17098 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
17101 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
17102 * but with all dynamically-allocated buffers duplicated in new buffers.
17104 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
17107 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
17109 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
17112 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
17114 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
17117 * Checks if the given object is currently in the success state
17119 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
17122 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
17124 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
17127 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
17128 * but with all dynamically-allocated buffers duplicated in new buffers.
17130 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
17133 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
17135 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
17138 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
17140 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
17143 * Checks if the given object is currently in the success state
17145 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
17148 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
17150 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
17153 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
17154 * but with all dynamically-allocated buffers duplicated in new buffers.
17156 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
17159 * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
17161 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
17164 * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
17166 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
17169 * Checks if the given object is currently in the success state
17171 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
17174 * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
17176 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
17179 * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
17180 * but with all dynamically-allocated buffers duplicated in new buffers.
17182 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
17185 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
17187 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
17190 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
17192 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
17195 * Checks if the given object is currently in the success state
17197 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
17200 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
17202 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
17205 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
17206 * but with all dynamically-allocated buffers duplicated in new buffers.
17208 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
17211 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
17213 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
17216 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
17218 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
17221 * Checks if the given object is currently in the success state
17223 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
17226 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
17228 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
17231 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
17232 * but with all dynamically-allocated buffers duplicated in new buffers.
17234 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
17237 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
17239 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
17242 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
17244 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
17247 * Checks if the given object is currently in the success state
17249 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
17252 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
17254 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
17257 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
17258 * but with all dynamically-allocated buffers duplicated in new buffers.
17260 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
17263 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
17265 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
17268 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
17270 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
17273 * Checks if the given object is currently in the success state
17275 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
17278 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
17280 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
17283 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
17284 * but with all dynamically-allocated buffers duplicated in new buffers.
17286 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
17289 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
17291 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
17294 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
17296 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
17299 * Checks if the given object is currently in the success state
17301 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
17304 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
17306 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
17309 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
17310 * but with all dynamically-allocated buffers duplicated in new buffers.
17312 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
17315 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
17317 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
17320 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
17322 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
17325 * Checks if the given object is currently in the success state
17327 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
17330 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
17332 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
17335 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
17336 * but with all dynamically-allocated buffers duplicated in new buffers.
17338 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
17341 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
17343 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
17346 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
17348 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
17351 * Checks if the given object is currently in the success state
17353 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
17356 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
17358 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
17361 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
17362 * but with all dynamically-allocated buffers duplicated in new buffers.
17364 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
17367 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17369 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
17372 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state.
17374 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o);
17377 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state.
17379 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
17382 * Checks if the given object is currently in the success state
17384 bool CResult_InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
17387 * Frees any resources used by the CResult_InvoiceSignOrCreationErrorZ.
17389 void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res);
17392 * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig`
17393 * but with all dynamically-allocated buffers duplicated in new buffers.
17395 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
17398 * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
17400 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
17403 * Constructs a new COption_FilterZ containing nothing
17405 struct LDKCOption_FilterZ COption_FilterZ_none(void);
17408 * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
17410 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
17413 * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
17415 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
17418 * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
17420 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
17423 * Checks if the given object is currently in the success state
17425 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
17428 * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
17430 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
17433 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17435 void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
17438 * Frees any resources used by the PaymentPurpose
17440 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
17443 * Creates a copy of the PaymentPurpose
17445 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
17448 * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
17450 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret);
17453 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
17455 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
17458 * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
17460 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
17463 * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
17465 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
17468 * Frees any resources used by the ClosureReason
17470 void ClosureReason_free(struct LDKClosureReason this_ptr);
17473 * Creates a copy of the ClosureReason
17475 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
17478 * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
17480 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKStr peer_msg);
17483 * Utility method to constructs a new HolderForceClosed-variant ClosureReason
17485 struct LDKClosureReason ClosureReason_holder_force_closed(void);
17488 * Utility method to constructs a new CooperativeClosure-variant ClosureReason
17490 struct LDKClosureReason ClosureReason_cooperative_closure(void);
17493 * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
17495 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
17498 * Utility method to constructs a new FundingTimedOut-variant ClosureReason
17500 struct LDKClosureReason ClosureReason_funding_timed_out(void);
17503 * Utility method to constructs a new ProcessingError-variant ClosureReason
17505 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
17508 * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
17510 struct LDKClosureReason ClosureReason_disconnected_peer(void);
17513 * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
17515 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
17518 * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
17520 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
17523 * Read a ClosureReason from a byte array, created by ClosureReason_write
17525 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
17528 * Frees any resources used by the HTLCDestination
17530 void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
17533 * Creates a copy of the HTLCDestination
17535 struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
17538 * Utility method to constructs a new NextHopChannel-variant HTLCDestination
17540 struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKThirtyTwoBytes channel_id);
17543 * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
17545 struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
17548 * Utility method to constructs a new FailedPayment-variant HTLCDestination
17550 struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
17553 * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
17555 struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
17558 * Read a HTLCDestination from a byte array, created by HTLCDestination_write
17560 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
17563 * Frees any resources used by the Event
17565 void Event_free(struct LDKEvent this_ptr);
17568 * Creates a copy of the Event
17570 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
17573 * Utility method to constructs a new FundingGenerationReady-variant Event
17575 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);
17578 * Utility method to constructs a new PaymentReceived-variant Event
17580 struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose);
17583 * Utility method to constructs a new PaymentClaimed-variant Event
17585 struct LDKEvent Event_payment_claimed(struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose);
17588 * Utility method to constructs a new PaymentSent-variant Event
17590 struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
17593 * Utility method to constructs a new PaymentFailed-variant Event
17595 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
17598 * Utility method to constructs a new PaymentPathSuccessful-variant Event
17600 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
17603 * Utility method to constructs a new PaymentPathFailed-variant Event
17605 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);
17608 * Utility method to constructs a new ProbeSuccessful-variant Event
17610 struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
17613 * Utility method to constructs a new ProbeFailed-variant Event
17615 struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id);
17618 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
17620 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
17623 * Utility method to constructs a new SpendableOutputs-variant Event
17625 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs);
17628 * Utility method to constructs a new PaymentForwarded-variant Event
17630 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);
17633 * Utility method to constructs a new ChannelClosed-variant Event
17635 struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, uint64_t user_channel_id, struct LDKClosureReason reason);
17638 * Utility method to constructs a new DiscardFunding-variant Event
17640 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
17643 * Utility method to constructs a new OpenChannelRequest-variant Event
17645 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);
17648 * Utility method to constructs a new HTLCHandlingFailed-variant Event
17650 struct LDKEvent Event_htlchandling_failed(struct LDKThirtyTwoBytes prev_channel_id, struct LDKHTLCDestination failed_next_destination);
17653 * Serialize the Event object into a byte array which can be read by Event_read
17655 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
17658 * Read a Event from a byte array, created by Event_write
17660 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
17663 * Frees any resources used by the MessageSendEvent
17665 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
17668 * Creates a copy of the MessageSendEvent
17670 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
17673 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
17675 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
17678 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
17680 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
17683 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
17685 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
17688 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
17690 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
17693 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
17695 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
17698 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
17700 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
17703 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
17705 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
17708 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
17710 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
17713 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
17715 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
17718 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
17720 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
17723 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
17725 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
17728 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
17730 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
17733 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
17735 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
17738 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
17740 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
17743 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
17745 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
17748 * Utility method to constructs a new HandleError-variant MessageSendEvent
17750 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
17753 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
17755 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
17758 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
17760 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
17763 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
17765 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
17768 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
17770 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
17773 * Calls the free function if one is set
17775 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
17778 * Calls the free function if one is set
17780 void EventsProvider_free(struct LDKEventsProvider this_ptr);
17783 * Calls the free function if one is set
17785 void EventHandler_free(struct LDKEventHandler this_ptr);
17788 * Frees any resources used by the APIError
17790 void APIError_free(struct LDKAPIError this_ptr);
17793 * Creates a copy of the APIError
17795 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
17798 * Utility method to constructs a new APIMisuseError-variant APIError
17800 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
17803 * Utility method to constructs a new FeeRateTooHigh-variant APIError
17805 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
17808 * Utility method to constructs a new RouteError-variant APIError
17810 struct LDKAPIError APIError_route_error(struct LDKStr err);
17813 * Utility method to constructs a new ChannelUnavailable-variant APIError
17815 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
17818 * Utility method to constructs a new MonitorUpdateFailed-variant APIError
17820 struct LDKAPIError APIError_monitor_update_failed(void);
17823 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
17825 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
17828 * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
17830 void BigSize_free(struct LDKBigSize this_obj);
17832 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
17834 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
17837 * Constructs a new BigSize given each field
17839 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
17842 * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
17844 void Hostname_free(struct LDKHostname this_obj);
17847 * Creates a copy of the Hostname
17849 struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
17852 * Returns the length of the hostname.
17854 MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
17857 * Creates a digital signature of a message given a SecretKey, like the node's secret.
17858 * 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.
17859 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
17861 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
17864 * Recovers the PublicKey of the signer of the message given the message and the signature.
17866 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
17869 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
17870 * and the PublicKey.
17872 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
17875 * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
17877 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z data_without_signature);
17880 * Calls the free function if one is set
17882 void Persister_free(struct LDKPersister this_ptr);
17885 * Creates a copy of the Level
17887 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
17890 * Utility method to constructs a new Gossip-variant Level
17892 enum LDKLevel Level_gossip(void);
17895 * Utility method to constructs a new Trace-variant Level
17897 enum LDKLevel Level_trace(void);
17900 * Utility method to constructs a new Debug-variant Level
17902 enum LDKLevel Level_debug(void);
17905 * Utility method to constructs a new Info-variant Level
17907 enum LDKLevel Level_info(void);
17910 * Utility method to constructs a new Warn-variant Level
17912 enum LDKLevel Level_warn(void);
17915 * Utility method to constructs a new Error-variant Level
17917 enum LDKLevel Level_error(void);
17920 * Checks if two Levels contain equal inner contents.
17921 * This ignores pointers and is_owned flags and looks at the values in fields.
17923 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
17926 * Checks if two Levels contain equal inner contents.
17928 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
17931 * Returns the most verbose logging level.
17933 MUST_USE_RES enum LDKLevel Level_max(void);
17936 * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
17938 void Record_free(struct LDKRecord this_obj);
17941 * The verbosity level of the message.
17943 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
17946 * The verbosity level of the message.
17948 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
17951 * The message body.
17953 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
17956 * The message body.
17958 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
17961 * The module path of the message.
17963 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
17966 * The module path of the message.
17968 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
17971 * The source file containing the message.
17973 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
17976 * The source file containing the message.
17978 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
17981 * The line containing the message.
17983 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
17986 * The line containing the message.
17988 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
17991 * Creates a copy of the Record
17993 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
17996 * Calls the free function if one is set
17998 void Logger_free(struct LDKLogger this_ptr);
18001 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
18003 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
18006 * Confirmations we will wait for before considering the channel locked in.
18007 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
18008 * equivalent limit applied to outbound channels).
18010 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
18011 * transaction before operation. If you wish to accept channels with zero confirmations, see
18012 * [`UserConfig::manually_accept_inbound_channels`] and
18013 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
18015 * Default value: 6.
18017 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18018 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
18020 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
18023 * Confirmations we will wait for before considering the channel locked in.
18024 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
18025 * equivalent limit applied to outbound channels).
18027 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
18028 * transaction before operation. If you wish to accept channels with zero confirmations, see
18029 * [`UserConfig::manually_accept_inbound_channels`] and
18030 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
18032 * Default value: 6.
18034 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18035 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
18037 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
18040 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
18041 * the number of blocks we have to punish our counterparty if they broadcast a revoked
18044 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
18045 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
18046 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
18047 * possibly with time in between to RBF the spending transaction).
18049 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
18050 * case of an honest unilateral channel close, which implicitly decrease the economic value of
18053 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
18054 * can tweak config to ask for more security, not less.
18056 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
18059 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
18060 * the number of blocks we have to punish our counterparty if they broadcast a revoked
18063 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
18064 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
18065 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
18066 * possibly with time in between to RBF the spending transaction).
18068 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
18069 * case of an honest unilateral channel close, which implicitly decrease the economic value of
18072 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
18073 * can tweak config to ask for more security, not less.
18075 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
18078 * Set to the smallest value HTLC we will accept to process.
18080 * This value is sent to our counterparty on channel-open and we close the channel any time
18081 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
18083 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
18086 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
18089 * Set to the smallest value HTLC we will accept to process.
18091 * This value is sent to our counterparty on channel-open and we close the channel any time
18092 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
18094 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
18097 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
18100 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
18103 * This can be set to a value between 1-100, where the value corresponds to the percent of the
18104 * channel value in whole percentages.
18107 * * If configured to another value than the default value 10, any new channels created with
18108 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
18109 * `ChannelManager`.
18111 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
18112 * no way to configure the cap for the total value of outbound HTLCs in-flight.
18114 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
18115 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
18116 * restrict exposure to loss due to being offline for too long.
18117 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
18118 * for more information.
18120 * Default value: 10.
18121 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
18122 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
18124 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
18127 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
18130 * This can be set to a value between 1-100, where the value corresponds to the percent of the
18131 * channel value in whole percentages.
18134 * * If configured to another value than the default value 10, any new channels created with
18135 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
18136 * `ChannelManager`.
18138 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
18139 * no way to configure the cap for the total value of outbound HTLCs in-flight.
18141 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
18142 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
18143 * restrict exposure to loss due to being offline for too long.
18144 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
18145 * for more information.
18147 * Default value: 10.
18148 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
18149 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
18151 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
18154 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
18155 * BOLTs) option for outbound private channels. This provides better privacy by not including
18156 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
18157 * relay HTLCs to us using the channel's SCID alias.
18159 * If this option is set, channels may be created that will not be readable by LDK versions
18160 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
18161 * [`DecodeError::InvalidValue`].
18163 * Note that setting this to true does *not* prevent us from opening channels with
18164 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
18165 * private channel without that option.
18167 * Ignored if the channel is negotiated to be announced, see
18168 * [`ChannelHandshakeConfig::announced_channel`] and
18169 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
18171 * Default value: false. This value is likely to change to true in the future.
18173 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
18174 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
18176 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
18179 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
18180 * BOLTs) option for outbound private channels. This provides better privacy by not including
18181 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
18182 * relay HTLCs to us using the channel's SCID alias.
18184 * If this option is set, channels may be created that will not be readable by LDK versions
18185 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
18186 * [`DecodeError::InvalidValue`].
18188 * Note that setting this to true does *not* prevent us from opening channels with
18189 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
18190 * private channel without that option.
18192 * Ignored if the channel is negotiated to be announced, see
18193 * [`ChannelHandshakeConfig::announced_channel`] and
18194 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
18196 * Default value: false. This value is likely to change to true in the future.
18198 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
18199 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
18201 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
18204 * Set to announce the channel publicly and notify all nodes that they can route via this
18207 * This should only be set to true for nodes which expect to be online reliably.
18209 * As the node which funds a channel picks this value this will only apply for new outbound
18210 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
18212 * Default value: false.
18214 bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
18217 * Set to announce the channel publicly and notify all nodes that they can route via this
18220 * This should only be set to true for nodes which expect to be online reliably.
18222 * As the node which funds a channel picks this value this will only apply for new outbound
18223 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
18225 * Default value: false.
18227 void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
18230 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
18231 * supports it, they will then enforce the mutual-close output to us matches what we provided
18232 * at intialization, preventing us from closing to an alternate pubkey.
18234 * This is set to true by default to provide a slight increase in security, though ultimately
18235 * any attacker who is able to take control of a channel can just as easily send the funds via
18236 * lightning payments, so we never require that our counterparties support this option.
18238 * The upfront key committed is provided from [`KeysInterface::get_shutdown_scriptpubkey`].
18240 * Default value: true.
18242 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
18244 bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
18247 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
18248 * supports it, they will then enforce the mutual-close output to us matches what we provided
18249 * at intialization, preventing us from closing to an alternate pubkey.
18251 * This is set to true by default to provide a slight increase in security, though ultimately
18252 * any attacker who is able to take control of a channel can just as easily send the funds via
18253 * lightning payments, so we never require that our counterparties support this option.
18255 * The upfront key committed is provided from [`KeysInterface::get_shutdown_scriptpubkey`].
18257 * Default value: true.
18259 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
18261 void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
18264 * Constructs a new ChannelHandshakeConfig given each field
18266 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);
18269 * Creates a copy of the ChannelHandshakeConfig
18271 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
18274 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
18276 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
18279 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
18281 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
18284 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
18285 * only applies to inbound channels.
18287 * Default value: 0.
18289 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18292 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
18293 * only applies to inbound channels.
18295 * Default value: 0.
18297 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
18300 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
18301 * only applies to inbound channels.
18303 * Default value: 2^24 - 1.
18305 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18308 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
18309 * only applies to inbound channels.
18311 * Default value: 2^24 - 1.
18313 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
18316 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
18317 * you to limit the maximum minimum-size they can require.
18319 * Default value: u64::max_value.
18321 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18324 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
18325 * you to limit the maximum minimum-size they can require.
18327 * Default value: u64::max_value.
18329 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
18332 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
18333 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
18335 * Default value: 0.
18337 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18340 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
18341 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
18343 * Default value: 0.
18345 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
18348 * The remote node will require we keep a certain amount in direct payment to ourselves at all
18349 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
18350 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
18352 * Default value: u64::max_value.
18354 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18357 * The remote node will require we keep a certain amount in direct payment to ourselves at all
18358 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
18359 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
18361 * Default value: u64::max_value.
18363 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
18366 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
18367 * time. This allows you to set a minimum such value.
18369 * Default value: 0.
18371 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18374 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
18375 * time. This allows you to set a minimum such value.
18377 * Default value: 0.
18379 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
18382 * Before a channel is usable the funding transaction will need to be confirmed by at least a
18383 * certain number of blocks, specified by the node which is not the funder (as the funder can
18384 * assume they aren't going to double-spend themselves).
18385 * This config allows you to set a limit on the maximum amount of time to wait.
18387 * Default value: 144, or roughly one day and only applies to outbound channels.
18389 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18392 * Before a channel is usable the funding transaction will need to be confirmed by at least a
18393 * certain number of blocks, specified by the node which is not the funder (as the funder can
18394 * assume they aren't going to double-spend themselves).
18395 * This config allows you to set a limit on the maximum amount of time to wait.
18397 * Default value: 144, or roughly one day and only applies to outbound channels.
18399 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
18402 * Whether we implicitly trust funding transactions generated by us for our own outbound
18403 * channels to not be double-spent.
18405 * If this is set, we assume that our own funding transactions are *never* double-spent, and
18406 * thus we can trust them without any confirmations. This is generally a reasonable
18407 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
18408 * control of the signing keys).
18410 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
18411 * double-spend the funding transaction to RBF with an alternative channel open.
18413 * This only applies if our counterparty set their confirmations-required value to 0, and we
18414 * always trust our own funding transaction at 1 confirmation irrespective of this value.
18415 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
18416 * `true` (0) and `false` (1).
18418 * Default value: true
18420 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18423 * Whether we implicitly trust funding transactions generated by us for our own outbound
18424 * channels to not be double-spent.
18426 * If this is set, we assume that our own funding transactions are *never* double-spent, and
18427 * thus we can trust them without any confirmations. This is generally a reasonable
18428 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
18429 * control of the signing keys).
18431 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
18432 * double-spend the funding transaction to RBF with an alternative channel open.
18434 * This only applies if our counterparty set their confirmations-required value to 0, and we
18435 * always trust our own funding transaction at 1 confirmation irrespective of this value.
18436 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
18437 * `true` (0) and `false` (1).
18439 * Default value: true
18441 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
18444 * Set to force an incoming channel to match our announced channel preference in
18445 * [`ChannelHandshakeConfig::announced_channel`].
18447 * For a node which is not online reliably, this should be set to true and
18448 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
18449 * channels will ever be opened.
18451 * Default value: true.
18453 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18456 * Set to force an incoming channel to match our announced channel preference in
18457 * [`ChannelHandshakeConfig::announced_channel`].
18459 * For a node which is not online reliably, this should be set to true and
18460 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
18461 * channels will ever be opened.
18463 * Default value: true.
18465 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
18468 * Set to the amount of time we're willing to wait to claim money back to us.
18470 * Not checking this value would be a security issue, as our peer would be able to set it to
18471 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
18473 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
18474 * reduce the loss of having useless locked funds (if your peer accepts)
18476 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18479 * Set to the amount of time we're willing to wait to claim money back to us.
18481 * Not checking this value would be a security issue, as our peer would be able to set it to
18482 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
18484 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
18485 * reduce the loss of having useless locked funds (if your peer accepts)
18487 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
18490 * Constructs a new ChannelHandshakeLimits given each field
18492 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);
18495 * Creates a copy of the ChannelHandshakeLimits
18497 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
18500 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
18502 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
18505 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
18507 void ChannelConfig_free(struct LDKChannelConfig this_obj);
18510 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
18511 * over the channel.
18512 * This may be allowed to change at runtime in a later update, however doing so must result in
18513 * update messages sent to notify all nodes of our updated relay fee.
18515 * Default value: 0.
18517 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18520 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
18521 * over the channel.
18522 * This may be allowed to change at runtime in a later update, however doing so must result in
18523 * update messages sent to notify all nodes of our updated relay fee.
18525 * Default value: 0.
18527 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
18530 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
18531 * excess of [`forwarding_fee_proportional_millionths`].
18532 * This may be allowed to change at runtime in a later update, however doing so must result in
18533 * update messages sent to notify all nodes of our updated relay fee.
18535 * The default value of a single satoshi roughly matches the market rate on many routing nodes
18536 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
18539 * Default value: 1000.
18541 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
18543 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18546 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
18547 * excess of [`forwarding_fee_proportional_millionths`].
18548 * This may be allowed to change at runtime in a later update, however doing so must result in
18549 * update messages sent to notify all nodes of our updated relay fee.
18551 * The default value of a single satoshi roughly matches the market rate on many routing nodes
18552 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
18555 * Default value: 1000.
18557 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
18559 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
18562 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
18563 * the channel this config applies to.
18565 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
18566 * HTLC balance when a channel appears on-chain whereas
18567 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
18568 * (non-HTLC-encumbered) balance.
18570 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
18571 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
18572 * commitment transaction at least once per this many blocks (minus some margin to allow us
18573 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
18574 * the spending transaction).
18576 * Default value: 72 (12 hours at an average of 6 blocks/hour).
18577 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
18578 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
18580 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
18582 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18585 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
18586 * the channel this config applies to.
18588 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
18589 * HTLC balance when a channel appears on-chain whereas
18590 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
18591 * (non-HTLC-encumbered) balance.
18593 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
18594 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
18595 * commitment transaction at least once per this many blocks (minus some margin to allow us
18596 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
18597 * the spending transaction).
18599 * Default value: 72 (12 hours at an average of 6 blocks/hour).
18600 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
18601 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
18603 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
18605 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
18608 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
18609 * small to claim on-chain.
18611 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
18612 * not be claimable on-chain, instead being turned into additional miner fees if either
18613 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
18614 * to such payments may be sustantial if there are many dust HTLCs present when the
18615 * channel is force-closed.
18617 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
18618 * exposure across all three types per-channel. Setting this too low may prevent the
18619 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
18620 * important to prevent stealing of dust HTLCs by miners.
18622 * Default value: 5_000_000 msat.
18624 uint64_t ChannelConfig_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18627 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
18628 * small to claim on-chain.
18630 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
18631 * not be claimable on-chain, instead being turned into additional miner fees if either
18632 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
18633 * to such payments may be sustantial if there are many dust HTLCs present when the
18634 * channel is force-closed.
18636 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
18637 * exposure across all three types per-channel. Setting this too low may prevent the
18638 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
18639 * important to prevent stealing of dust HTLCs by miners.
18641 * Default value: 5_000_000 msat.
18643 void ChannelConfig_set_max_dust_htlc_exposure_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
18646 * The additional fee we're willing to pay to avoid waiting for the counterparty's
18647 * `to_self_delay` to reclaim funds.
18649 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
18650 * closing transaction which both sides find acceptable, ultimately paid by the channel
18651 * funder/initiator.
18653 * When we are the funder, because we have to pay the channel closing fee, we bound the
18654 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
18655 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
18656 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
18657 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
18660 * When we are not the funder, we require the closing transaction fee pay at least our
18661 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
18662 * Thus, this value is ignored when we are not the funder.
18664 * Default value: 1000 satoshis.
18666 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
18667 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
18669 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18672 * The additional fee we're willing to pay to avoid waiting for the counterparty's
18673 * `to_self_delay` to reclaim funds.
18675 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
18676 * closing transaction which both sides find acceptable, ultimately paid by the channel
18677 * funder/initiator.
18679 * When we are the funder, because we have to pay the channel closing fee, we bound the
18680 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
18681 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
18682 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
18683 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
18686 * When we are not the funder, we require the closing transaction fee pay at least our
18687 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
18688 * Thus, this value is ignored when we are not the funder.
18690 * Default value: 1000 satoshis.
18692 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
18693 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
18695 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
18698 * Constructs a new ChannelConfig given each field
18700 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);
18703 * Creates a copy of the ChannelConfig
18705 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
18708 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
18710 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
18713 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
18715 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
18718 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
18720 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
18723 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
18725 void UserConfig_free(struct LDKUserConfig this_obj);
18728 * Channel handshake config that we propose to our counterparty.
18730 struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18733 * Channel handshake config that we propose to our counterparty.
18735 void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
18738 * Limits applied to our counterparty's proposed channel handshake config settings.
18740 struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18743 * Limits applied to our counterparty's proposed channel handshake config settings.
18745 void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
18748 * Channel config which affects behavior during channel lifetime.
18750 struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18753 * Channel config which affects behavior during channel lifetime.
18755 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
18758 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
18759 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
18760 * node which is not online reliably.
18762 * For nodes which are not online reliably, you should set all channels to *not* be announced
18763 * (using [`ChannelHandshakeConfig::announced_channel`] and
18764 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
18765 * ensure you are not exposed to any forwarding risk.
18767 * Note that because you cannot change a channel's announced state after creation, there is no
18768 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
18769 * from a publicly-announced forwarding node to a private non-forwarding node you must close
18770 * all your channels and open new ones. For privacy, you should also change your node_id
18771 * (swapping all private and public key material for new ones) at that time.
18773 * Default value: false.
18775 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18778 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
18779 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
18780 * node which is not online reliably.
18782 * For nodes which are not online reliably, you should set all channels to *not* be announced
18783 * (using [`ChannelHandshakeConfig::announced_channel`] and
18784 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
18785 * ensure you are not exposed to any forwarding risk.
18787 * Note that because you cannot change a channel's announced state after creation, there is no
18788 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
18789 * from a publicly-announced forwarding node to a private non-forwarding node you must close
18790 * all your channels and open new ones. For privacy, you should also change your node_id
18791 * (swapping all private and public key material for new ones) at that time.
18793 * Default value: false.
18795 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
18798 * If this is set to false, we do not accept inbound requests to open a new channel.
18799 * Default value: true.
18801 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18804 * If this is set to false, we do not accept inbound requests to open a new channel.
18805 * Default value: true.
18807 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
18810 * If this is set to true, the user needs to manually accept inbound requests to open a new
18813 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
18814 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
18815 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
18816 * user explicitly chooses to accept the request.
18818 * Default value: false.
18820 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
18821 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
18822 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
18824 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18827 * If this is set to true, the user needs to manually accept inbound requests to open a new
18830 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
18831 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
18832 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
18833 * user explicitly chooses to accept the request.
18835 * Default value: false.
18837 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
18838 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
18839 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
18841 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
18844 * Constructs a new UserConfig given each field
18846 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);
18849 * Creates a copy of the UserConfig
18851 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
18854 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
18856 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
18859 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
18861 void BestBlock_free(struct LDKBestBlock this_obj);
18864 * Creates a copy of the BestBlock
18866 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
18869 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
18872 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
18875 * Returns a `BestBlock` as identified by the given block hash and height.
18877 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
18880 * Returns the best block hash.
18882 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
18885 * Returns the best block height.
18887 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
18890 * Creates a copy of the AccessError
18892 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
18895 * Utility method to constructs a new UnknownChain-variant AccessError
18897 enum LDKAccessError AccessError_unknown_chain(void);
18900 * Utility method to constructs a new UnknownTx-variant AccessError
18902 enum LDKAccessError AccessError_unknown_tx(void);
18905 * Calls the free function if one is set
18907 void Access_free(struct LDKAccess this_ptr);
18910 * Calls the free function if one is set
18912 void Listen_free(struct LDKListen this_ptr);
18915 * Calls the free function if one is set
18917 void Confirm_free(struct LDKConfirm this_ptr);
18920 * Creates a copy of the ChannelMonitorUpdateErr
18922 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
18925 * Utility method to constructs a new TemporaryFailure-variant ChannelMonitorUpdateErr
18927 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_temporary_failure(void);
18930 * Utility method to constructs a new PermanentFailure-variant ChannelMonitorUpdateErr
18932 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_permanent_failure(void);
18935 * Calls the free function if one is set
18937 void Watch_free(struct LDKWatch this_ptr);
18940 * Calls the free function if one is set
18942 void Filter_free(struct LDKFilter this_ptr);
18945 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
18947 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
18950 * First block where the transaction output may have been spent.
18952 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18954 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
18957 * First block where the transaction output may have been spent.
18959 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
18961 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18964 * Outpoint identifying the transaction output.
18966 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
18969 * Outpoint identifying the transaction output.
18971 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
18974 * Spending condition of the transaction output.
18976 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
18979 * Spending condition of the transaction output.
18981 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
18984 * Constructs a new WatchedOutput given each field
18986 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
18989 * Creates a copy of the WatchedOutput
18991 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
18994 * Checks if two WatchedOutputs contain equal inner contents.
18996 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
18999 * Calls the free function if one is set
19001 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
19004 * Creates a copy of the ConfirmationTarget
19006 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
19009 * Utility method to constructs a new Background-variant ConfirmationTarget
19011 enum LDKConfirmationTarget ConfirmationTarget_background(void);
19014 * Utility method to constructs a new Normal-variant ConfirmationTarget
19016 enum LDKConfirmationTarget ConfirmationTarget_normal(void);
19019 * Utility method to constructs a new HighPriority-variant ConfirmationTarget
19021 enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
19024 * Checks if two ConfirmationTargets contain equal inner contents.
19025 * This ignores pointers and is_owned flags and looks at the values in fields.
19027 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
19030 * Calls the free function if one is set
19032 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
19035 * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
19037 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
19040 * Creates a copy of the MonitorUpdateId
19042 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
19045 * Checks if two MonitorUpdateIds contain equal inner contents.
19047 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
19050 * Checks if two MonitorUpdateIds contain equal inner contents.
19051 * This ignores pointers and is_owned flags and looks at the values in fields.
19052 * Two objects with NULL inner values will be considered "equal" here.
19054 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
19057 * Calls the free function if one is set
19059 void Persist_free(struct LDKPersist this_ptr);
19062 * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
19064 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
19067 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
19069 void ChainMonitor_free(struct LDKChainMonitor this_obj);
19072 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
19074 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
19075 * will call back to it indicating transactions and outputs of interest. This allows clients to
19076 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
19077 * always need to fetch full blocks absent another means for determining which blocks contain
19078 * transactions relevant to the watched channels.
19080 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
19083 * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
19084 * claims which are awaiting confirmation.
19086 * Includes the balances from each [`ChannelMonitor`] *except* those included in
19087 * `ignored_channels`, allowing you to filter out balances from channels which are still open
19088 * (and whose balance should likely be pulled from the [`ChannelDetails`]).
19090 * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
19091 * inclusion in the return value.
19093 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
19096 * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
19097 * such [`ChannelMonitor`] is currently being monitored for.
19099 * Note that the result holds a mutex over our monitor set, and should not be held
19102 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
19105 * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
19107 * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
19108 * monitoring for on-chain state resolutions.
19110 MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
19113 * Indicates the persistence of a [`ChannelMonitor`] has completed after
19114 * [`ChannelMonitorUpdateErr::TemporaryFailure`] was returned from an update operation.
19116 * Thus, the anticipated use is, at a high level:
19117 * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
19118 * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
19119 * returning [`ChannelMonitorUpdateErr::TemporaryFailure`],
19120 * 2) once all remote copies are updated, you call this function with the
19121 * `completed_update_id` that completed, and once all pending updates have completed the
19122 * channel will be re-enabled.
19124 * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
19125 * registered [`ChannelMonitor`]s.
19127 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);
19130 * Constructs a new Listen which calls the relevant methods on this_arg.
19131 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
19133 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
19136 * Constructs a new Confirm which calls the relevant methods on this_arg.
19137 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
19139 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
19142 * Constructs a new Watch which calls the relevant methods on this_arg.
19143 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
19145 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
19148 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
19149 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
19151 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
19154 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
19156 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
19159 * The sequence number of this update. Updates *must* be replayed in-order according to this
19160 * sequence number (and updates may panic if they are not). The update_id values are strictly
19161 * increasing and increase by one for each new update, with one exception specified below.
19163 * This sequence number is also used to track up to which points updates which returned
19164 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
19165 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
19167 * The only instance where update_id values are not strictly increasing is the case where we
19168 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
19169 * its docs for more details.
19171 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
19174 * The sequence number of this update. Updates *must* be replayed in-order according to this
19175 * sequence number (and updates may panic if they are not). The update_id values are strictly
19176 * increasing and increase by one for each new update, with one exception specified below.
19178 * This sequence number is also used to track up to which points updates which returned
19179 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
19180 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
19182 * The only instance where update_id values are not strictly increasing is the case where we
19183 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
19184 * its docs for more details.
19186 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
19189 * Creates a copy of the ChannelMonitorUpdate
19191 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
19194 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
19196 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
19199 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
19201 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
19204 * Frees any resources used by the MonitorEvent
19206 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
19209 * Creates a copy of the MonitorEvent
19211 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
19214 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
19216 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
19219 * Utility method to constructs a new CommitmentTxConfirmed-variant MonitorEvent
19221 struct LDKMonitorEvent MonitorEvent_commitment_tx_confirmed(struct LDKOutPoint a);
19224 * Utility method to constructs a new UpdateCompleted-variant MonitorEvent
19226 struct LDKMonitorEvent MonitorEvent_update_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
19229 * Utility method to constructs a new UpdateFailed-variant MonitorEvent
19231 struct LDKMonitorEvent MonitorEvent_update_failed(struct LDKOutPoint a);
19234 * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
19236 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
19239 * Read a MonitorEvent from a byte array, created by MonitorEvent_write
19241 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
19244 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
19246 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
19249 * Creates a copy of the HTLCUpdate
19251 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
19254 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
19256 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
19259 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
19261 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
19264 * Frees any resources used by the Balance
19266 void Balance_free(struct LDKBalance this_ptr);
19269 * Creates a copy of the Balance
19271 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
19274 * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
19276 struct LDKBalance Balance_claimable_on_channel_close(uint64_t claimable_amount_satoshis);
19279 * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
19281 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t claimable_amount_satoshis, uint32_t confirmation_height);
19284 * Utility method to constructs a new ContentiousClaimable-variant Balance
19286 struct LDKBalance Balance_contentious_claimable(uint64_t claimable_amount_satoshis, uint32_t timeout_height);
19289 * Utility method to constructs a new MaybeClaimableHTLCAwaitingTimeout-variant Balance
19291 struct LDKBalance Balance_maybe_claimable_htlcawaiting_timeout(uint64_t claimable_amount_satoshis, uint32_t claimable_height);
19294 * Checks if two Balances contain equal inner contents.
19295 * This ignores pointers and is_owned flags and looks at the values in fields.
19297 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
19300 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
19302 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
19305 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
19307 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
19310 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
19313 * panics if the given update is not the next update by update_id.
19315 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, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
19318 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
19321 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19324 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
19326 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19329 * Gets a list of txids, with their output scripts (in the order they appear in the
19330 * transaction), which we must learn about spends of via block_connected().
19332 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19335 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
19336 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
19337 * have been registered.
19339 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
19342 * Get the list of HTLCs who's status has been updated on chain. This should be called by
19343 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
19345 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19348 * Gets the list of pending events which were generated by previous actions, clearing the list
19351 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
19352 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
19353 * no internal locking in ChannelMonitors.
19355 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19358 * Gets the `node_id` of the counterparty for this channel.
19360 * Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
19363 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19365 MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19368 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
19369 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
19370 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
19371 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
19372 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
19373 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
19374 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
19375 * out-of-band the other node operator to coordinate with him if option is available to you.
19376 * In any-case, choice is up to the user.
19378 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);
19381 * Processes transactions in a newly connected block, which may result in any of the following:
19382 * - update the monitor's state against resolved HTLCs
19383 * - punish the counterparty in the case of seeing a revoked commitment transaction
19384 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
19385 * - detect settled outputs for later spending
19386 * - schedule and bump any in-flight claims
19388 * Returns any new outputs to watch from `txdata`; after called, these are also included in
19389 * [`get_outputs_to_watch`].
19391 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
19393 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);
19396 * Determines if the disconnected block contained any transactions of interest and updates
19399 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);
19402 * Processes transactions confirmed in a block with the given header and height, returning new
19403 * outputs to watch. See [`block_connected`] for details.
19405 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
19406 * blocks. See [`chain::Confirm`] for calling expectations.
19408 * [`block_connected`]: Self::block_connected
19410 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);
19413 * Processes a transaction that was reorganized out of the chain.
19415 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
19416 * than blocks. See [`chain::Confirm`] for calling expectations.
19418 * [`block_disconnected`]: Self::block_disconnected
19420 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);
19423 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
19424 * [`block_connected`] for details.
19426 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
19427 * blocks. See [`chain::Confirm`] for calling expectations.
19429 * [`block_connected`]: Self::block_connected
19431 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);
19434 * Returns the set of txids that should be monitored for re-organization out of the chain.
19436 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19439 * Gets the latest best block which was connected either via the [`chain::Listen`] or
19440 * [`chain::Confirm`] interfaces.
19442 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19445 * Gets the balances in this channel which are either claimable by us if we were to
19446 * force-close the channel now or which are claimable on-chain (possibly awaiting
19449 * Any balances in the channel which are available on-chain (excluding on-chain fees) are
19450 * included here until an [`Event::SpendableOutputs`] event has been generated for the
19451 * balance, or until our counterparty has claimed the balance and accrued several
19452 * confirmations on the claim transaction.
19454 * Note that the balances available when you or your counterparty have broadcasted revoked
19455 * state(s) may not be fully captured here.
19457 * See [`Balance`] for additional details on the types of claimable balances which
19458 * may be returned here and their meanings.
19460 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19463 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
19465 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
19468 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
19470 void OutPoint_free(struct LDKOutPoint this_obj);
19473 * The referenced transaction's txid.
19475 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
19478 * The referenced transaction's txid.
19480 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19483 * The index of the referenced output in its transaction's vout.
19485 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
19488 * The index of the referenced output in its transaction's vout.
19490 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
19493 * Constructs a new OutPoint given each field
19495 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
19498 * Creates a copy of the OutPoint
19500 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
19503 * Checks if two OutPoints contain equal inner contents.
19504 * This ignores pointers and is_owned flags and looks at the values in fields.
19505 * Two objects with NULL inner values will be considered "equal" here.
19507 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
19510 * Checks if two OutPoints contain equal inner contents.
19512 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
19515 * Convert an `OutPoint` to a lightning channel id.
19517 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
19520 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
19522 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
19525 * Read a OutPoint from a byte array, created by OutPoint_write
19527 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
19530 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
19532 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
19535 * The outpoint which is spendable
19537 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19540 * The outpoint which is spendable
19542 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
19545 * Per commitment point to derive delayed_payment_key by key holder
19547 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19550 * Per commitment point to derive delayed_payment_key by key holder
19552 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19555 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
19556 * the witness_script.
19558 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19561 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
19562 * the witness_script.
19564 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
19567 * The output which is referenced by the given outpoint
19569 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
19572 * The revocation point specific to the commitment transaction which was broadcast. Used to
19573 * derive the witnessScript for this output.
19575 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19578 * The revocation point specific to the commitment transaction which was broadcast. Used to
19579 * derive the witnessScript for this output.
19581 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19584 * Arbitrary identification information returned by a call to
19585 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
19586 * the channel to spend the output.
19588 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
19591 * Arbitrary identification information returned by a call to
19592 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
19593 * the channel to spend the output.
19595 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19598 * The value of the channel which this output originated from, possibly indirectly.
19600 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19603 * The value of the channel which this output originated from, possibly indirectly.
19605 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
19608 * Constructs a new DelayedPaymentOutputDescriptor given each field
19610 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);
19613 * Creates a copy of the DelayedPaymentOutputDescriptor
19615 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
19618 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
19620 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
19623 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
19625 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
19628 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
19630 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
19633 * The outpoint which is spendable
19635 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19638 * The outpoint which is spendable
19640 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
19643 * The output which is referenced by the given outpoint
19645 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
19648 * Arbitrary identification information returned by a call to
19649 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
19650 * the channel to spend the output.
19652 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
19655 * Arbitrary identification information returned by a call to
19656 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
19657 * the channel to spend the output.
19659 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19662 * The value of the channel which this transactions spends.
19664 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19667 * The value of the channel which this transactions spends.
19669 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
19672 * Constructs a new StaticPaymentOutputDescriptor given each field
19674 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);
19677 * Creates a copy of the StaticPaymentOutputDescriptor
19679 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
19682 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
19684 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
19687 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
19689 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
19692 * Frees any resources used by the SpendableOutputDescriptor
19694 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
19697 * Creates a copy of the SpendableOutputDescriptor
19699 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
19702 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
19704 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
19707 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
19709 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
19712 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
19714 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
19717 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
19719 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
19722 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
19724 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
19727 * Calls the free function if one is set
19729 void BaseSign_free(struct LDKBaseSign this_ptr);
19732 * Creates a copy of a Sign
19734 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
19737 * Calls the free function if one is set
19739 void Sign_free(struct LDKSign this_ptr);
19742 * Creates a copy of the Recipient
19744 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
19747 * Utility method to constructs a new Node-variant Recipient
19749 enum LDKRecipient Recipient_node(void);
19752 * Utility method to constructs a new PhantomNode-variant Recipient
19754 enum LDKRecipient Recipient_phantom_node(void);
19757 * Calls the free function if one is set
19759 void KeysInterface_free(struct LDKKeysInterface this_ptr);
19762 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
19764 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
19767 * Private key of anchor tx
19769 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19772 * Private key of anchor tx
19774 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19777 * Holder secret key for blinded revocation pubkey
19779 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19782 * Holder secret key for blinded revocation pubkey
19784 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19787 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
19789 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19792 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
19794 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19797 * Holder secret key used in HTLC tx
19799 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19802 * Holder secret key used in HTLC tx
19804 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19807 * Holder htlc secret key used in commitment tx htlc outputs
19809 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19812 * Holder htlc secret key used in commitment tx htlc outputs
19814 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19819 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19824 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19827 * Creates a copy of the InMemorySigner
19829 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
19832 * Create a new InMemorySigner
19834 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);
19837 * Counterparty pubkeys.
19838 * Will panic if ready_channel wasn't called.
19840 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19843 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
19844 * transactions, ie the amount of time that we have to wait to recover our funds if we
19845 * broadcast a transaction.
19846 * Will panic if ready_channel wasn't called.
19848 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19851 * The contest_delay value specified by us and applied on transactions broadcastable
19852 * by our counterparty, ie the amount of time that they have to wait to recover their funds
19853 * if they broadcast a transaction.
19854 * Will panic if ready_channel wasn't called.
19856 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19859 * Whether the holder is the initiator
19860 * Will panic if ready_channel wasn't called.
19862 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19866 * Will panic if ready_channel wasn't called.
19868 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19871 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
19872 * building transactions.
19874 * Will panic if ready_channel wasn't called.
19876 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19879 * Whether anchors should be used.
19880 * Will panic if ready_channel wasn't called.
19882 MUST_USE_RES bool InMemorySigner_opt_anchors(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19885 * Sign the single input of spend_tx at index `input_idx` which spends the output
19886 * described by descriptor, returning the witness stack for the input.
19888 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
19889 * is not spending the outpoint described by `descriptor.outpoint`,
19890 * or if an output descriptor script_pubkey does not match the one we can spend.
19892 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);
19895 * Sign the single input of spend_tx at index `input_idx` which spends the output
19896 * described by descriptor, returning the witness stack for the input.
19898 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
19899 * is not spending the outpoint described by `descriptor.outpoint`, does not have a
19900 * sequence set to `descriptor.to_self_delay`, or if an output descriptor
19901 * script_pubkey does not match the one we can spend.
19903 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);
19906 * Constructs a new BaseSign which calls the relevant methods on this_arg.
19907 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
19909 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19912 * Constructs a new Sign which calls the relevant methods on this_arg.
19913 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
19915 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19918 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
19920 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
19923 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
19925 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKSecretKey arg);
19928 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
19930 void KeysManager_free(struct LDKKeysManager this_obj);
19933 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
19934 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
19935 * starting_time isn't strictly required to actually be a time, but it must absolutely,
19936 * without a doubt, be unique to this instance. ie if you start multiple times with the same
19937 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
19938 * simply use the current time (with very high precision).
19940 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
19941 * obviously, starting_time should be unique every time you reload the library - it is only
19942 * used to generate new ephemeral key data (which will be stored by the individual channel if
19945 * Note that the seed is required to recover certain on-chain funds independent of
19946 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
19947 * channel, and some on-chain during-closing funds.
19949 * Note that until the 0.1 release there is no guarantee of backward compatibility between
19950 * versions. Once the library is more fully supported, the docs will be updated to include a
19951 * detailed description of the guarantee.
19953 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
19956 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
19958 * Key derivation parameters are accessible through a per-channel secrets
19959 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
19960 * onchain output detection for which a corresponding delayed_payment_key must be derived.
19962 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]);
19965 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
19966 * output to the given change destination (if sufficient change value remains). The
19967 * transaction will have a feerate, at least, of the given value.
19969 * Returns `Err(())` if the output value is greater than the input value minus required fee,
19970 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
19971 * does not match the one we can spend.
19973 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
19975 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
19976 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
19978 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);
19981 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
19982 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
19984 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
19987 * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
19989 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
19992 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
19993 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
19995 struct LDKKeysInterface PhantomKeysManager_as_KeysInterface(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
19998 * Constructs a `PhantomKeysManager` given a 32-byte seed and an additional `cross_node_seed`
19999 * that is shared across all nodes that intend to participate in [phantom node payments] together.
20001 * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
20002 * `starting_time_nanos`.
20004 * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
20005 * same across restarts, or else inbound payments may fail.
20007 * [phantom node payments]: PhantomKeysManager
20009 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]);
20012 * See [`KeysManager::spend_spendable_outputs`] for documentation on this method.
20014 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);
20017 * See [`KeysManager::derive_channel_keys`] for documentation on this method.
20019 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]);
20022 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
20024 void ChannelManager_free(struct LDKChannelManager this_obj);
20027 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
20029 void ChainParameters_free(struct LDKChainParameters this_obj);
20032 * The network for determining the `chain_hash` in Lightning messages.
20034 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
20037 * The network for determining the `chain_hash` in Lightning messages.
20039 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
20042 * The hash and height of the latest block successfully connected.
20044 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
20046 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
20049 * The hash and height of the latest block successfully connected.
20051 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
20053 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
20056 * Constructs a new ChainParameters given each field
20058 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
20061 * Creates a copy of the ChainParameters
20063 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
20066 * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
20068 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
20071 * Base routing fee in millisatoshis.
20073 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
20076 * Base routing fee in millisatoshis.
20078 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
20081 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
20083 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
20086 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
20088 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
20091 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
20092 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
20093 * `cltv_expiry_delta` for more details.
20095 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
20098 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
20099 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
20100 * `cltv_expiry_delta` for more details.
20102 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
20105 * Constructs a new CounterpartyForwardingInfo given each field
20107 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);
20110 * Creates a copy of the CounterpartyForwardingInfo
20112 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
20115 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
20117 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
20120 * The node_id of our counterparty
20122 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
20125 * The node_id of our counterparty
20127 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20130 * The Features the channel counterparty provided upon last connection.
20131 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
20132 * many routing-relevant features are present in the init context.
20134 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
20137 * The Features the channel counterparty provided upon last connection.
20138 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
20139 * many routing-relevant features are present in the init context.
20141 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
20144 * The value, in satoshis, that must always be held in the channel for our counterparty. This
20145 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
20146 * claiming at least this value on chain.
20148 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
20150 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
20152 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
20155 * The value, in satoshis, that must always be held in the channel for our counterparty. This
20156 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
20157 * claiming at least this value on chain.
20159 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
20161 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
20163 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
20166 * Information on the fees and requirements that the counterparty requires when forwarding
20167 * payments to us through this channel.
20169 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20171 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
20174 * Information on the fees and requirements that the counterparty requires when forwarding
20175 * payments to us through this channel.
20177 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
20179 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
20182 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
20183 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
20184 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
20186 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
20189 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
20190 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
20191 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
20193 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20196 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
20198 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
20201 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
20203 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20206 * Constructs a new ChannelCounterparty given each field
20208 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);
20211 * Creates a copy of the ChannelCounterparty
20213 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
20216 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
20218 void ChannelDetails_free(struct LDKChannelDetails this_obj);
20221 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
20222 * thereafter this is the txid of the funding transaction xor the funding transaction output).
20223 * Note that this means this value is *not* persistent - it can change once during the
20224 * lifetime of the channel.
20226 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
20229 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
20230 * thereafter this is the txid of the funding transaction xor the funding transaction output).
20231 * Note that this means this value is *not* persistent - it can change once during the
20232 * lifetime of the channel.
20234 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20237 * Parameters which apply to our counterparty. See individual fields for more information.
20239 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20242 * Parameters which apply to our counterparty. See individual fields for more information.
20244 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
20247 * The Channel's funding transaction output, if we've negotiated the funding transaction with
20248 * our counterparty already.
20250 * Note that, if this has been set, `channel_id` will be equivalent to
20251 * `funding_txo.unwrap().to_channel_id()`.
20253 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20255 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20258 * The Channel's funding transaction output, if we've negotiated the funding transaction with
20259 * our counterparty already.
20261 * Note that, if this has been set, `channel_id` will be equivalent to
20262 * `funding_txo.unwrap().to_channel_id()`.
20264 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
20266 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
20269 * The features which this channel operates with. See individual features for more info.
20271 * `None` until negotiation completes and the channel type is finalized.
20273 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20275 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20278 * The features which this channel operates with. See individual features for more info.
20280 * `None` until negotiation completes and the channel type is finalized.
20282 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
20284 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
20287 * The position of the funding transaction in the chain. None if the funding transaction has
20288 * not yet been confirmed and the channel fully opened.
20290 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
20291 * payments instead of this. See [`get_inbound_payment_scid`].
20293 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
20294 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
20296 * [`inbound_scid_alias`]: Self::inbound_scid_alias
20297 * [`outbound_scid_alias`]: Self::outbound_scid_alias
20298 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
20299 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
20300 * [`confirmations_required`]: Self::confirmations_required
20302 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20305 * The position of the funding transaction in the chain. None if the funding transaction has
20306 * not yet been confirmed and the channel fully opened.
20308 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
20309 * payments instead of this. See [`get_inbound_payment_scid`].
20311 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
20312 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
20314 * [`inbound_scid_alias`]: Self::inbound_scid_alias
20315 * [`outbound_scid_alias`]: Self::outbound_scid_alias
20316 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
20317 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
20318 * [`confirmations_required`]: Self::confirmations_required
20320 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20323 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
20324 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
20325 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
20328 * This will be `None` as long as the channel is not available for routing outbound payments.
20330 * [`short_channel_id`]: Self::short_channel_id
20331 * [`confirmations_required`]: Self::confirmations_required
20333 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20336 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
20337 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
20338 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
20341 * This will be `None` as long as the channel is not available for routing outbound payments.
20343 * [`short_channel_id`]: Self::short_channel_id
20344 * [`confirmations_required`]: Self::confirmations_required
20346 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20349 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
20350 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
20351 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
20352 * when they see a payment to be routed to us.
20354 * Our counterparty may choose to rotate this value at any time, though will always recognize
20355 * previous values for inbound payment forwarding.
20357 * [`short_channel_id`]: Self::short_channel_id
20359 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20362 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
20363 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
20364 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
20365 * when they see a payment to be routed to us.
20367 * Our counterparty may choose to rotate this value at any time, though will always recognize
20368 * previous values for inbound payment forwarding.
20370 * [`short_channel_id`]: Self::short_channel_id
20372 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20375 * The value, in satoshis, of this channel as appears in the funding output
20377 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20380 * The value, in satoshis, of this channel as appears in the funding output
20382 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
20385 * The value, in satoshis, that must always be held in the channel for us. This value ensures
20386 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
20387 * this value on chain.
20389 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
20391 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20393 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
20395 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20398 * The value, in satoshis, that must always be held in the channel for us. This value ensures
20399 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
20400 * this value on chain.
20402 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
20404 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20406 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
20408 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20411 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
20413 uint64_t ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20416 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
20418 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
20421 * Our total balance. This is the amount we would get if we close the channel.
20422 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
20423 * amount is not likely to be recoverable on close.
20425 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
20426 * balance is not available for inclusion in new outbound HTLCs). This further does not include
20427 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
20428 * This does not consider any on-chain fees.
20430 * See also [`ChannelDetails::outbound_capacity_msat`]
20432 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20435 * Our total balance. This is the amount we would get if we close the channel.
20436 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
20437 * amount is not likely to be recoverable on close.
20439 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
20440 * balance is not available for inclusion in new outbound HTLCs). This further does not include
20441 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
20442 * This does not consider any on-chain fees.
20444 * See also [`ChannelDetails::outbound_capacity_msat`]
20446 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
20449 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
20450 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
20451 * available for inclusion in new outbound HTLCs). This further does not include any pending
20452 * outgoing HTLCs which are awaiting some other resolution to be sent.
20454 * See also [`ChannelDetails::balance_msat`]
20456 * This value is not exact. Due to various in-flight changes, feerate changes, and our
20457 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
20458 * should be able to spend nearly this amount.
20460 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20463 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
20464 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
20465 * available for inclusion in new outbound HTLCs). This further does not include any pending
20466 * outgoing HTLCs which are awaiting some other resolution to be sent.
20468 * See also [`ChannelDetails::balance_msat`]
20470 * This value is not exact. Due to various in-flight changes, feerate changes, and our
20471 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
20472 * should be able to spend nearly this amount.
20474 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
20477 * The available outbound capacity for sending a single HTLC to the remote peer. This is
20478 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
20479 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
20480 * to use a limit as close as possible to the HTLC limit we can currently send.
20482 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
20484 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20487 * The available outbound capacity for sending a single HTLC to the remote peer. This is
20488 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
20489 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
20490 * to use a limit as close as possible to the HTLC limit we can currently send.
20492 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
20494 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
20497 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
20498 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
20499 * available for inclusion in new inbound HTLCs).
20500 * Note that there are some corner cases not fully handled here, so the actual available
20501 * inbound capacity may be slightly higher than this.
20503 * This value is not exact. Due to various in-flight changes, feerate changes, and our
20504 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
20505 * However, our counterparty should be able to spend nearly this amount.
20507 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20510 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
20511 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
20512 * available for inclusion in new inbound HTLCs).
20513 * Note that there are some corner cases not fully handled here, so the actual available
20514 * inbound capacity may be slightly higher than this.
20516 * This value is not exact. Due to various in-flight changes, feerate changes, and our
20517 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
20518 * However, our counterparty should be able to spend nearly this amount.
20520 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
20523 * The number of required confirmations on the funding transaction before the funding will be
20524 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
20525 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
20526 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
20527 * [`ChannelHandshakeLimits::max_minimum_depth`].
20529 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20531 * [`is_outbound`]: ChannelDetails::is_outbound
20532 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
20533 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
20535 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20538 * The number of required confirmations on the funding transaction before the funding will be
20539 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
20540 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
20541 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
20542 * [`ChannelHandshakeLimits::max_minimum_depth`].
20544 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20546 * [`is_outbound`]: ChannelDetails::is_outbound
20547 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
20548 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
20550 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
20553 * The number of blocks (after our commitment transaction confirms) that we will need to wait
20554 * until we can claim our funds after we force-close the channel. During this time our
20555 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
20556 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
20557 * time to claim our non-HTLC-encumbered funds.
20559 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20561 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20564 * The number of blocks (after our commitment transaction confirms) that we will need to wait
20565 * until we can claim our funds after we force-close the channel. During this time our
20566 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
20567 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
20568 * time to claim our non-HTLC-encumbered funds.
20570 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20572 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
20575 * True if the channel was initiated (and thus funded) by us.
20577 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20580 * True if the channel was initiated (and thus funded) by us.
20582 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
20585 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
20586 * channel is not currently being shut down. `channel_ready` message exchange implies the
20587 * required confirmation count has been reached (and we were connected to the peer at some
20588 * point after the funding transaction received enough confirmations). The required
20589 * confirmation count is provided in [`confirmations_required`].
20591 * [`confirmations_required`]: ChannelDetails::confirmations_required
20593 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20596 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
20597 * channel is not currently being shut down. `channel_ready` message exchange implies the
20598 * required confirmation count has been reached (and we were connected to the peer at some
20599 * point after the funding transaction received enough confirmations). The required
20600 * confirmation count is provided in [`confirmations_required`].
20602 * [`confirmations_required`]: ChannelDetails::confirmations_required
20604 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
20607 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
20608 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
20610 * This is a strict superset of `is_channel_ready`.
20612 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20615 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
20616 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
20618 * This is a strict superset of `is_channel_ready`.
20620 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
20623 * True if this channel is (or will be) publicly-announced.
20625 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20628 * True if this channel is (or will be) publicly-announced.
20630 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
20633 * The smallest value HTLC (in msat) we will accept, for this channel. This field
20634 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
20636 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20639 * The smallest value HTLC (in msat) we will accept, for this channel. This field
20640 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
20642 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20645 * The largest value HTLC (in msat) we currently will accept, for this channel.
20647 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20650 * The largest value HTLC (in msat) we currently will accept, for this channel.
20652 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20655 * Set of configurable parameters that affect channel operation.
20657 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
20659 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20661 struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20664 * Set of configurable parameters that affect channel operation.
20666 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
20668 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
20670 void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
20673 * Constructs a new ChannelDetails given each field
20675 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);
20678 * Creates a copy of the ChannelDetails
20680 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
20683 * Gets the current SCID which should be used to identify this channel for inbound payments.
20684 * This should be used for providing invoice hints or in any other context where our
20685 * counterparty will forward a payment to us.
20687 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
20688 * [`ChannelDetails::short_channel_id`]. See those for more information.
20690 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
20693 * Gets the current SCID which should be used to identify this channel for outbound payments.
20694 * This should be used in [`Route`]s to describe the first hop or in other contexts where
20695 * we're sending or forwarding a payment outbound over this channel.
20697 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
20698 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
20700 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
20703 * Frees any resources used by the PaymentSendFailure
20705 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
20708 * Creates a copy of the PaymentSendFailure
20710 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
20713 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
20715 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
20718 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
20720 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
20723 * Utility method to constructs a new AllFailedRetrySafe-variant PaymentSendFailure
20725 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_retry_safe(struct LDKCVec_APIErrorZ a);
20728 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
20730 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
20733 * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
20735 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
20738 * The list of channels to be included in the invoice route hints.
20740 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
20743 * The list of channels to be included in the invoice route hints.
20745 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
20748 * A fake scid used for representing the phantom node's fake channel in generating the invoice
20751 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
20754 * A fake scid used for representing the phantom node's fake channel in generating the invoice
20757 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
20760 * The pubkey of the real backing node that would ultimately receive the payment.
20762 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
20765 * The pubkey of the real backing node that would ultimately receive the payment.
20767 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20770 * Constructs a new PhantomRouteHints given each field
20772 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
20775 * Creates a copy of the PhantomRouteHints
20777 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
20780 * Constructs a new ChannelManager to hold several channels and route between them.
20782 * This is the main \"logic hub\" for all channel-related actions, and implements
20783 * ChannelMessageHandler.
20785 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
20787 * Users need to notify the new ChannelManager when a new block is connected or
20788 * disconnected using its `block_connected` and `block_disconnected` methods, starting
20789 * from after `params.latest_hash`.
20791 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);
20794 * Gets the current configuration applied to all new channels, as
20796 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
20799 * Creates a new outbound channel to the given remote node and with the given value.
20801 * `user_channel_id` will be provided back as in
20802 * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
20803 * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to 0
20804 * for inbound channels, so you may wish to avoid using 0 for `user_channel_id` here.
20805 * `user_channel_id` has no meaning inside of LDK, it is simply copied to events and otherwise
20808 * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
20809 * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
20811 * Note that we do not check if you are currently connected to the given peer. If no
20812 * connection is available, the outbound `open_channel` message may fail to send, resulting in
20813 * the channel eventually being silently forgotten (dropped on reload).
20815 * Returns the new Channel's temporary `channel_id`. This ID will appear as
20816 * [`Event::FundingGenerationReady::temporary_channel_id`] and in
20817 * [`ChannelDetails::channel_id`] until after
20818 * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
20819 * one derived from the funding transaction's TXID. If the counterparty rejects the channel
20820 * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
20822 * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
20823 * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
20824 * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
20826 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
20828 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);
20831 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
20832 * more information.
20834 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
20837 * Gets the list of usable channels, in random order. Useful as an argument to [`find_route`]
20838 * to ensure non-announced channels are used.
20840 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
20841 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
20844 * [`find_route`]: crate::routing::router::find_route
20846 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
20849 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
20850 * will be accepted on the given channel, and after additional timeout/the closing of all
20851 * pending HTLCs, the channel will be closed on chain.
20853 * * If we are the channel initiator, we will pay between our [`Background`] and
20854 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
20856 * * If our counterparty is the channel initiator, we will require a channel closing
20857 * transaction feerate of at least our [`Background`] feerate or the feerate which
20858 * would appear on a force-closure transaction, whichever is lower. We will allow our
20859 * counterparty to pay as much fee as they'd like, however.
20861 * May generate a SendShutdown message event on success, which should be relayed.
20863 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
20864 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
20865 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
20867 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);
20870 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
20871 * will be accepted on the given channel, and after additional timeout/the closing of all
20872 * pending HTLCs, the channel will be closed on chain.
20874 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
20875 * the channel being closed or not:
20876 * * If we are the channel initiator, we will pay at least this feerate on the closing
20877 * transaction. The upper-bound is set by
20878 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
20879 * estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
20880 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
20881 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
20882 * will appear on a force-closure transaction, whichever is lower).
20884 * May generate a SendShutdown message event on success, which should be relayed.
20886 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
20887 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
20888 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
20890 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);
20893 * Force closes a channel, immediately broadcasting the latest local transaction(s) and
20894 * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
20895 * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
20898 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);
20901 * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
20902 * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
20903 * `counterparty_node_id` isn't the counterparty of the corresponding channel.
20905 * You can always get the latest local transaction(s) to broadcast from
20906 * [`ChannelMonitor::get_latest_holder_commitment_txn`].
20908 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);
20911 * Force close all channels, immediately broadcasting the latest local commitment transaction
20912 * for each to the chain and rejecting new HTLCs on each.
20914 void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
20917 * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
20918 * local transaction(s).
20920 void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
20923 * Sends a payment along a given route.
20925 * Value parameters are provided via the last hop in route, see documentation for RouteHop
20926 * fields for more info.
20928 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
20929 * payment), we don't do anything to stop you! We always try to ensure that if the provided
20930 * next hop knows the preimage to payment_hash they can claim an additional amount as
20931 * specified in the last hop in the route! Thus, you should probably do your own
20932 * payment_preimage tracking (which you should already be doing as they represent \"proof of
20933 * payment\") and prevent double-sends yourself.
20935 * May generate SendHTLCs message(s) event on success, which should be relayed.
20937 * Each path may have a different return value, and PaymentSendValue may return a Vec with
20938 * each entry matching the corresponding-index entry in the route paths, see
20939 * PaymentSendFailure for more info.
20941 * In general, a path may raise:
20942 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
20943 * node public key) is specified.
20944 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
20945 * (including due to previous monitor update failure or new permanent monitor update
20947 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
20948 * relevant updates.
20950 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
20951 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
20952 * different route unless you intend to pay twice!
20954 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
20955 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
20956 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
20957 * must not contain multiple paths as multi-path payments require a recipient-provided
20959 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
20960 * bit set (either as required or as available). If multiple paths are present in the Route,
20961 * we assume the invoice had the basic_mpp feature set.
20963 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
20965 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);
20968 * Retries a payment along the given [`Route`].
20970 * Errors returned are a superset of those returned from [`send_payment`], so see
20971 * [`send_payment`] documentation for more details on errors. This method will also error if the
20972 * retry amount puts the payment more than 10% over the payment's total amount, if the payment
20973 * for the given `payment_id` cannot be found (likely due to timeout or success), or if
20974 * further retries have been disabled with [`abandon_payment`].
20976 * [`send_payment`]: [`ChannelManager::send_payment`]
20977 * [`abandon_payment`]: [`ChannelManager::abandon_payment`]
20979 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);
20982 * Signals that no further retries for the given payment will occur.
20984 * After this method returns, any future calls to [`retry_payment`] for the given `payment_id`
20985 * will fail with [`PaymentSendFailure::ParameterError`]. If no such event has been generated,
20986 * an [`Event::PaymentFailed`] event will be generated as soon as there are no remaining
20987 * pending HTLCs for this payment.
20989 * Note that calling this method does *not* prevent a payment from succeeding. You must still
20990 * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
20991 * determine the ultimate status of a payment.
20993 * [`retry_payment`]: Self::retry_payment
20994 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
20995 * [`Event::PaymentSent`]: events::Event::PaymentSent
20997 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
21000 * Send a spontaneous payment, which is a payment that does not require the recipient to have
21001 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
21002 * the preimage, it must be a cryptographically secure random value that no intermediate node
21003 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
21004 * never reach the recipient.
21006 * See [`send_payment`] documentation for more details on the return value of this function.
21008 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
21009 * [`send_payment`] for more information about the risks of duplicate preimage usage.
21011 * Note that `route` must have exactly one path.
21013 * [`send_payment`]: Self::send_payment
21015 * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
21017 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);
21020 * Send a payment that is probing the given route for liquidity. We calculate the
21021 * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
21022 * us to easily discern them from real payments.
21024 MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ hops);
21027 * Call this upon creation of a funding transaction for the given channel.
21029 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
21030 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
21032 * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
21033 * across the p2p network.
21035 * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
21036 * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
21038 * May panic if the output found in the funding transaction is duplicative with some other
21039 * channel (note that this should be trivially prevented by using unique funding transaction
21040 * keys per-channel).
21042 * Do NOT broadcast the funding transaction yourself. When we have safely received our
21043 * counterparty's signature the funding transaction will automatically be broadcast via the
21044 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
21046 * Note that this includes RBF or similar transaction replacement strategies - lightning does
21047 * not currently support replacing a funding transaction on an existing channel. Instead,
21048 * create a new channel with a conflicting funding transaction.
21050 * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
21051 * the wallet software generating the funding transaction to apply anti-fee sniping as
21052 * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
21053 * for more details.
21055 * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
21056 * [`Event::ChannelClosed`]: crate::util::events::Event::ChannelClosed
21058 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);
21061 * Regenerates channel_announcements and generates a signed node_announcement from the given
21062 * arguments, providing them in corresponding events via
21063 * [`get_and_clear_pending_msg_events`], if at least one public channel has been confirmed
21064 * on-chain. This effectively re-broadcasts all channel announcements and sends our node
21065 * announcement to ensure that the lightning P2P network is aware of the channels we have and
21066 * our network addresses.
21068 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
21069 * node to humans. They carry no in-protocol meaning.
21071 * `addresses` represent the set (possibly empty) of socket addresses on which this node
21072 * accepts incoming connections. These will be included in the node_announcement, publicly
21073 * tying these addresses together and to this node. If you wish to preserve user privacy,
21074 * addresses should likely contain only Tor Onion addresses.
21076 * Panics if `addresses` is absurdly large (more than 100).
21078 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
21080 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
21083 * Atomically updates the [`ChannelConfig`] for the given channels.
21085 * Once the updates are applied, each eligible channel (advertised with a known short channel
21086 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
21087 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
21088 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
21090 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
21091 * `counterparty_node_id` is provided.
21093 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
21094 * below [`MIN_CLTV_EXPIRY_DELTA`].
21096 * If an error is returned, none of the updates should be considered applied.
21098 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
21099 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
21100 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
21101 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
21102 * [`ChannelUpdate`]: msgs::ChannelUpdate
21103 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
21104 * [`APIMisuseError`]: APIError::APIMisuseError
21106 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);
21109 * Processes HTLCs which are pending waiting on random forward delay.
21111 * Should only really ever be called in response to a PendingHTLCsForwardable event.
21112 * Will likely generate further events.
21114 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
21117 * Performs actions which should happen on startup and roughly once per minute thereafter.
21119 * This currently includes:
21120 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
21121 * * Broadcasting `ChannelUpdate` messages if we've been disconnected from our peer for more
21122 * than a minute, informing the network that they should no longer attempt to route over
21124 * * Expiring a channel's previous `ChannelConfig` if necessary to only allow forwarding HTLCs
21125 * with the current `ChannelConfig`.
21127 * Note that this may cause reentrancy through `chain::Watch::update_channel` calls or feerate
21128 * estimate fetches.
21130 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
21133 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
21134 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
21135 * along the path (including in our own channel on which we received it).
21137 * Note that in some cases around unclean shutdown, it is possible the payment may have
21138 * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
21139 * second copy of) the [`events::Event::PaymentReceived`] event. Alternatively, the payment
21140 * may have already been failed automatically by LDK if it was nearing its expiration time.
21142 * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
21143 * [`ChannelManager::claim_funds`]), you should still monitor for
21144 * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
21145 * startup during which time claims that were in-progress at shutdown may be replayed.
21147 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
21150 * Provides a payment preimage in response to [`Event::PaymentReceived`], generating any
21151 * [`MessageSendEvent`]s needed to claim the payment.
21153 * Note that calling this method does *not* guarantee that the payment has been claimed. You
21154 * *must* wait for an [`Event::PaymentClaimed`] event which upon a successful claim will be
21155 * provided to your [`EventHandler`] when [`process_pending_events`] is next called.
21157 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
21158 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
21159 * event matches your expectation. If you fail to do so and call this method, you may provide
21160 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
21162 * [`Event::PaymentReceived`]: crate::util::events::Event::PaymentReceived
21163 * [`Event::PaymentClaimed`]: crate::util::events::Event::PaymentClaimed
21164 * [`process_pending_events`]: EventsProvider::process_pending_events
21165 * [`create_inbound_payment`]: Self::create_inbound_payment
21166 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
21167 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
21169 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
21172 * Gets the node_id held by this ChannelManager
21174 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
21177 * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
21179 * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
21180 * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
21183 * The `user_channel_id` parameter will be provided back in
21184 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
21185 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
21187 * Note that this method will return an error and reject the channel, if it requires support
21188 * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
21189 * used to accept such channels.
21191 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
21192 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
21194 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);
21197 * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
21198 * it as confirmed immediately.
21200 * The `user_channel_id` parameter will be provided back in
21201 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
21202 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
21204 * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
21205 * and (if the counterparty agrees), enables forwarding of payments immediately.
21207 * This fully trusts that the counterparty has honestly and correctly constructed the funding
21208 * transaction and blindly assumes that it will eventually confirm.
21210 * If it does not confirm before we decide to close the channel, or if the funding transaction
21211 * does not pay to the correct script the correct amount, *you will lose funds*.
21213 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
21214 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
21216 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);
21219 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
21222 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
21223 * [`PaymentHash`] and [`PaymentPreimage`] for you.
21225 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
21226 * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
21227 * passed directly to [`claim_funds`].
21229 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
21231 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
21232 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
21236 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
21237 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
21239 * Errors if `min_value_msat` is greater than total bitcoin supply.
21241 * [`claim_funds`]: Self::claim_funds
21242 * [`PaymentReceived`]: events::Event::PaymentReceived
21243 * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
21244 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
21246 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);
21249 * Legacy version of [`create_inbound_payment`]. Use this method if you wish to share
21250 * serialized state with LDK node(s) running 0.0.103 and earlier.
21252 * May panic if `invoice_expiry_delta_secs` is greater than one year.
21255 * This method is deprecated and will be removed soon.
21257 * [`create_inbound_payment`]: Self::create_inbound_payment
21259 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);
21262 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
21263 * stored external to LDK.
21265 * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a
21266 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
21267 * the `min_value_msat` provided here, if one is provided.
21269 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
21270 * note that LDK will not stop you from registering duplicate payment hashes for inbound
21273 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
21274 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
21275 * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the
21276 * sender \"proof-of-payment\" unless they have paid the required amount.
21278 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
21279 * in excess of the current time. This should roughly match the expiry time set in the invoice.
21280 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
21281 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
21282 * invoices when no timeout is set.
21284 * Note that we use block header time to time-out pending inbound payments (with some margin
21285 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
21286 * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry.
21287 * If you need exact expiry semantics, you should enforce them upon receipt of
21288 * [`PaymentReceived`].
21290 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
21291 * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
21293 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
21294 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
21298 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
21299 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
21301 * Errors if `min_value_msat` is greater than total bitcoin supply.
21303 * [`create_inbound_payment`]: Self::create_inbound_payment
21304 * [`PaymentReceived`]: events::Event::PaymentReceived
21306 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);
21309 * Legacy version of [`create_inbound_payment_for_hash`]. Use this method if you wish to share
21310 * serialized state with LDK node(s) running 0.0.103 and earlier.
21312 * May panic if `invoice_expiry_delta_secs` is greater than one year.
21315 * This method is deprecated and will be removed soon.
21317 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
21319 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);
21322 * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
21323 * previously returned from [`create_inbound_payment`].
21325 * [`create_inbound_payment`]: Self::create_inbound_payment
21327 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);
21330 * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
21331 * are used when constructing the phantom invoice's route hints.
21333 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
21335 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
21338 * Gets route hints for use in receiving [phantom node payments].
21340 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
21342 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
21345 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
21346 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
21348 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
21351 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
21352 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
21354 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
21357 * Constructs a new Listen which calls the relevant methods on this_arg.
21358 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
21360 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
21363 * Constructs a new Confirm which calls the relevant methods on this_arg.
21364 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
21366 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
21369 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
21370 * indicating whether persistence is necessary. Only one listener on
21371 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
21374 * Note that this method is not available with the `no-std` feature.
21376 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
21379 * Blocks until ChannelManager needs to be persisted. Only one listener on
21380 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
21383 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
21386 * Gets the latest best block which was connected either via the [`chain::Listen`] or
21387 * [`chain::Confirm`] interfaces.
21389 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
21392 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
21393 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
21395 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
21398 * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
21400 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
21403 * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
21405 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
21408 * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
21410 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
21413 * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
21415 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
21418 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
21420 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
21423 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
21425 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
21428 * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
21430 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
21433 * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
21435 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
21438 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
21440 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
21443 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
21445 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
21448 * The keys provider which will give us relevant keys. Some keys will be loaded during
21449 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
21452 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
21455 * The keys provider which will give us relevant keys. Some keys will be loaded during
21456 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
21459 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
21462 * The fee_estimator for use in the ChannelManager in the future.
21464 * No calls to the FeeEstimator will be made during deserialization.
21466 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
21469 * The fee_estimator for use in the ChannelManager in the future.
21471 * No calls to the FeeEstimator will be made during deserialization.
21473 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
21476 * The chain::Watch for use in the ChannelManager in the future.
21478 * No calls to the chain::Watch will be made during deserialization. It is assumed that
21479 * you have deserialized ChannelMonitors separately and will add them to your
21480 * chain::Watch after deserializing this ChannelManager.
21482 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
21485 * The chain::Watch for use in the ChannelManager in the future.
21487 * No calls to the chain::Watch will be made during deserialization. It is assumed that
21488 * you have deserialized ChannelMonitors separately and will add them to your
21489 * chain::Watch after deserializing this ChannelManager.
21491 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
21494 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
21495 * used to broadcast the latest local commitment transactions of channels which must be
21496 * force-closed during deserialization.
21498 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
21501 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
21502 * used to broadcast the latest local commitment transactions of channels which must be
21503 * force-closed during deserialization.
21505 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
21508 * The Logger for use in the ChannelManager and which may be used to log information during
21511 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
21514 * The Logger for use in the ChannelManager and which may be used to log information during
21517 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
21520 * Default settings used for new channels. Any existing channels will continue to use the
21521 * runtime settings which were stored when the ChannelManager was serialized.
21523 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
21526 * Default settings used for new channels. Any existing channels will continue to use the
21527 * runtime settings which were stored when the ChannelManager was serialized.
21529 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
21532 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
21533 * HashMap for you. This is primarily useful for C bindings where it is not practical to
21534 * populate a HashMap directly from C.
21536 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);
21539 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
21541 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
21544 * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
21546 void ExpandedKey_free(struct LDKExpandedKey this_obj);
21549 * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret.
21551 * It is recommended to cache this value and not regenerate it for each new inbound payment.
21553 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
21556 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
21557 * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
21558 * a `ChannelManager`.
21560 * `keys` is generated by calling [`KeysInterface::get_inbound_payment_key_material`] and then
21561 * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
21562 * regenerate it for each new inbound payment.
21564 * `current_time` is a Unix timestamp representing the current time.
21566 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
21568 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);
21571 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
21572 * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
21573 * without a `ChannelManager`.
21575 * See [`create`] for information on the `keys` and `current_time` parameters.
21577 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
21579 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);
21582 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
21584 void DecodeError_free(struct LDKDecodeError this_obj);
21587 * Creates a copy of the DecodeError
21589 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
21592 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
21594 void Init_free(struct LDKInit this_obj);
21597 * The relevant features which the sender supports
21599 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
21602 * The relevant features which the sender supports
21604 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
21607 * The receipient's network address. This adds the option to report a remote IP address
21608 * back to a connecting peer using the init message. A node can decide to use that information
21609 * to discover a potential update to its public IPv4 address (NAT) and use
21610 * that for a node_announcement update message containing the new address.
21612 struct LDKCOption_NetAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
21615 * The receipient's network address. This adds the option to report a remote IP address
21616 * back to a connecting peer using the init message. A node can decide to use that information
21617 * to discover a potential update to its public IPv4 address (NAT) and use
21618 * that for a node_announcement update message containing the new address.
21620 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_NetAddressZ val);
21623 * Constructs a new Init given each field
21625 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_NetAddressZ remote_network_address_arg);
21628 * Creates a copy of the Init
21630 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
21633 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
21635 void ErrorMessage_free(struct LDKErrorMessage this_obj);
21638 * The channel ID involved in the error.
21640 * All-0s indicates a general error unrelated to a specific channel, after which all channels
21641 * with the sending peer should be closed.
21643 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
21646 * The channel ID involved in the error.
21648 * All-0s indicates a general error unrelated to a specific channel, after which all channels
21649 * with the sending peer should be closed.
21651 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21654 * A possibly human-readable error description.
21655 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
21656 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
21657 * the terminal emulator or the logging subsystem.
21659 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
21662 * A possibly human-readable error description.
21663 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
21664 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
21665 * the terminal emulator or the logging subsystem.
21667 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
21670 * Constructs a new ErrorMessage given each field
21672 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
21675 * Creates a copy of the ErrorMessage
21677 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
21680 * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
21682 void WarningMessage_free(struct LDKWarningMessage this_obj);
21685 * The channel ID involved in the warning.
21687 * All-0s indicates a warning unrelated to a specific channel.
21689 const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32];
21692 * The channel ID involved in the warning.
21694 * All-0s indicates a warning unrelated to a specific channel.
21696 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21699 * A possibly human-readable warning description.
21700 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
21701 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
21702 * the terminal emulator or the logging subsystem.
21704 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
21707 * A possibly human-readable warning description.
21708 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
21709 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
21710 * the terminal emulator or the logging subsystem.
21712 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
21715 * Constructs a new WarningMessage given each field
21717 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
21720 * Creates a copy of the WarningMessage
21722 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
21725 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
21727 void Ping_free(struct LDKPing this_obj);
21730 * The desired response length
21732 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
21735 * The desired response length
21737 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
21740 * The ping packet size.
21741 * This field is not sent on the wire. byteslen zeros are sent.
21743 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
21746 * The ping packet size.
21747 * This field is not sent on the wire. byteslen zeros are sent.
21749 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
21752 * Constructs a new Ping given each field
21754 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
21757 * Creates a copy of the Ping
21759 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
21762 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
21764 void Pong_free(struct LDKPong this_obj);
21767 * The pong packet size.
21768 * This field is not sent on the wire. byteslen zeros are sent.
21770 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
21773 * The pong packet size.
21774 * This field is not sent on the wire. byteslen zeros are sent.
21776 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
21779 * Constructs a new Pong given each field
21781 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
21784 * Creates a copy of the Pong
21786 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
21789 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
21791 void OpenChannel_free(struct LDKOpenChannel this_obj);
21794 * The genesis hash of the blockchain where the channel is to be opened
21796 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
21799 * The genesis hash of the blockchain where the channel is to be opened
21801 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21804 * A temporary channel ID, until the funding outpoint is announced
21806 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
21809 * A temporary channel ID, until the funding outpoint is announced
21811 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21814 * The channel value
21816 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21819 * The channel value
21821 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21824 * The amount to push to the counterparty as part of the open, in milli-satoshi
21826 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21829 * The amount to push to the counterparty as part of the open, in milli-satoshi
21831 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21834 * The threshold below which outputs on transactions broadcast by sender will be omitted
21836 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21839 * The threshold below which outputs on transactions broadcast by sender will be omitted
21841 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21844 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
21846 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21849 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
21851 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21854 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
21856 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21859 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
21861 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21864 * The minimum HTLC size incoming to sender, in milli-satoshi
21866 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21869 * The minimum HTLC size incoming to sender, in milli-satoshi
21871 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21874 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
21876 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21879 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
21881 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
21884 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
21886 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21889 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
21891 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
21894 * The maximum number of inbound HTLCs towards sender
21896 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21899 * The maximum number of inbound HTLCs towards sender
21901 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
21904 * The sender's key controlling the funding transaction
21906 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21909 * The sender's key controlling the funding transaction
21911 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21914 * Used to derive a revocation key for transactions broadcast by counterparty
21916 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21919 * Used to derive a revocation key for transactions broadcast by counterparty
21921 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21924 * A payment key to sender for transactions broadcast by counterparty
21926 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21929 * A payment key to sender for transactions broadcast by counterparty
21931 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21934 * Used to derive a payment key to sender for transactions broadcast by sender
21936 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21939 * Used to derive a payment key to sender for transactions broadcast by sender
21941 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21944 * Used to derive an HTLC payment key to sender
21946 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21949 * Used to derive an HTLC payment key to sender
21951 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21954 * The first to-be-broadcast-by-sender transaction's per commitment point
21956 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21959 * The first to-be-broadcast-by-sender transaction's per commitment point
21961 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21966 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21971 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
21974 * The channel type that this channel will represent. If none is set, we derive the channel
21975 * type from the intersection of our feature bits with our counterparty's feature bits from
21976 * the Init message.
21978 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21980 struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21983 * The channel type that this channel will represent. If none is set, we derive the channel
21984 * type from the intersection of our feature bits with our counterparty's feature bits from
21985 * the Init message.
21987 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21989 void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
21992 * Creates a copy of the OpenChannel
21994 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
21997 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
21999 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
22002 * A temporary channel ID, until the funding outpoint is announced
22004 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
22007 * A temporary channel ID, until the funding outpoint is announced
22009 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22012 * The threshold below which outputs on transactions broadcast by sender will be omitted
22014 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22017 * The threshold below which outputs on transactions broadcast by sender will be omitted
22019 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
22022 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
22024 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22027 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
22029 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
22032 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
22034 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22037 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
22039 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
22042 * The minimum HTLC size incoming to sender, in milli-satoshi
22044 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22047 * The minimum HTLC size incoming to sender, in milli-satoshi
22049 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
22052 * Minimum depth of the funding transaction before the channel is considered open
22054 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22057 * Minimum depth of the funding transaction before the channel is considered open
22059 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
22062 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
22064 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22067 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
22069 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
22072 * The maximum number of inbound HTLCs towards sender
22074 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22077 * The maximum number of inbound HTLCs towards sender
22079 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
22082 * The sender's key controlling the funding transaction
22084 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22087 * The sender's key controlling the funding transaction
22089 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22092 * Used to derive a revocation key for transactions broadcast by counterparty
22094 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22097 * Used to derive a revocation key for transactions broadcast by counterparty
22099 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22102 * A payment key to sender for transactions broadcast by counterparty
22104 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22107 * A payment key to sender for transactions broadcast by counterparty
22109 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22112 * Used to derive a payment key to sender for transactions broadcast by sender
22114 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22117 * Used to derive a payment key to sender for transactions broadcast by sender
22119 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22122 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
22124 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22127 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
22129 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22132 * The first to-be-broadcast-by-sender transaction's per commitment point
22134 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22137 * The first to-be-broadcast-by-sender transaction's per commitment point
22139 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22142 * The channel type that this channel will represent. If none is set, we derive the channel
22143 * type from the intersection of our feature bits with our counterparty's feature bits from
22144 * the Init message.
22146 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
22148 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22150 struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22153 * The channel type that this channel will represent. If none is set, we derive the channel
22154 * type from the intersection of our feature bits with our counterparty's feature bits from
22155 * the Init message.
22157 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
22159 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22161 void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
22164 * Creates a copy of the AcceptChannel
22166 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
22169 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
22171 void FundingCreated_free(struct LDKFundingCreated this_obj);
22174 * A temporary channel ID, until the funding is established
22176 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
22179 * A temporary channel ID, until the funding is established
22181 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22184 * The funding transaction ID
22186 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
22189 * The funding transaction ID
22191 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22194 * The specific output index funding this channel
22196 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
22199 * The specific output index funding this channel
22201 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
22204 * The signature of the channel initiator (funder) on the initial commitment transaction
22206 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
22209 * The signature of the channel initiator (funder) on the initial commitment transaction
22211 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
22214 * Constructs a new FundingCreated given each field
22216 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);
22219 * Creates a copy of the FundingCreated
22221 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
22224 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
22226 void FundingSigned_free(struct LDKFundingSigned this_obj);
22231 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
22236 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22239 * The signature of the channel acceptor (fundee) on the initial commitment transaction
22241 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
22244 * The signature of the channel acceptor (fundee) on the initial commitment transaction
22246 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
22249 * Constructs a new FundingSigned given each field
22251 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
22254 * Creates a copy of the FundingSigned
22256 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
22259 * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
22261 void ChannelReady_free(struct LDKChannelReady this_obj);
22266 const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32];
22271 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22274 * The per-commitment point of the second commitment transaction
22276 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
22279 * The per-commitment point of the second commitment transaction
22281 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22284 * If set, provides a short_channel_id alias for this channel. The sender will accept payments
22285 * to be forwarded over this SCID and forward them to this messages' recipient.
22287 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
22290 * If set, provides a short_channel_id alias for this channel. The sender will accept payments
22291 * to be forwarded over this SCID and forward them to this messages' recipient.
22293 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
22296 * Constructs a new ChannelReady given each field
22298 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);
22301 * Creates a copy of the ChannelReady
22303 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
22306 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
22308 void Shutdown_free(struct LDKShutdown this_obj);
22313 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
22318 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22321 * The destination of this peer's funds on closing.
22322 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
22324 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
22327 * The destination of this peer's funds on closing.
22328 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
22330 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
22333 * Constructs a new Shutdown given each field
22335 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
22338 * Creates a copy of the Shutdown
22340 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
22343 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
22345 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
22348 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
22351 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
22354 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
22357 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
22360 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
22363 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
22366 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
22369 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
22372 * Constructs a new ClosingSignedFeeRange given each field
22374 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
22377 * Creates a copy of the ClosingSignedFeeRange
22379 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
22382 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
22384 void ClosingSigned_free(struct LDKClosingSigned this_obj);
22389 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
22394 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22397 * The proposed total fee for the closing transaction
22399 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
22402 * The proposed total fee for the closing transaction
22404 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
22407 * A signature on the closing transaction
22409 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
22412 * A signature on the closing transaction
22414 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
22417 * The minimum and maximum fees which the sender is willing to accept, provided only by new
22420 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22422 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
22425 * The minimum and maximum fees which the sender is willing to accept, provided only by new
22428 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22430 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
22433 * Constructs a new ClosingSigned given each field
22435 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);
22438 * Creates a copy of the ClosingSigned
22440 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
22443 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
22445 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
22450 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
22455 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22460 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
22465 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
22468 * The HTLC value in milli-satoshi
22470 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
22473 * The HTLC value in milli-satoshi
22475 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
22478 * The payment hash, the pre-image of which controls HTLC redemption
22480 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
22483 * The payment hash, the pre-image of which controls HTLC redemption
22485 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22488 * The expiry height of the HTLC
22490 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
22493 * The expiry height of the HTLC
22495 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
22498 * Creates a copy of the UpdateAddHTLC
22500 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
22503 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
22505 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
22510 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
22515 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22520 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
22525 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
22528 * The pre-image of the payment hash, allowing HTLC redemption
22530 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
22533 * The pre-image of the payment hash, allowing HTLC redemption
22535 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22538 * Constructs a new UpdateFulfillHTLC given each field
22540 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
22543 * Creates a copy of the UpdateFulfillHTLC
22545 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
22548 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
22550 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
22555 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
22560 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22565 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
22570 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
22573 * Creates a copy of the UpdateFailHTLC
22575 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
22578 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
22580 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
22585 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
22590 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22595 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
22600 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
22605 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
22610 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
22613 * Creates a copy of the UpdateFailMalformedHTLC
22615 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
22618 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
22620 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
22625 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
22630 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22633 * A signature on the commitment transaction
22635 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
22638 * A signature on the commitment transaction
22640 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
22643 * Signatures on the HTLC transactions
22645 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
22648 * Constructs a new CommitmentSigned given each field
22650 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
22653 * Creates a copy of the CommitmentSigned
22655 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
22658 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
22660 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
22665 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
22670 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22673 * The secret corresponding to the per-commitment point
22675 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
22678 * The secret corresponding to the per-commitment point
22680 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22683 * The next sender-broadcast commitment transaction's per-commitment point
22685 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
22688 * The next sender-broadcast commitment transaction's per-commitment point
22690 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22693 * Constructs a new RevokeAndACK given each field
22695 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);
22698 * Creates a copy of the RevokeAndACK
22700 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
22703 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
22705 void UpdateFee_free(struct LDKUpdateFee this_obj);
22710 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
22715 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22718 * Fee rate per 1000-weight of the transaction
22720 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
22723 * Fee rate per 1000-weight of the transaction
22725 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
22728 * Constructs a new UpdateFee given each field
22730 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
22733 * Creates a copy of the UpdateFee
22735 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
22738 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
22740 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
22743 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
22744 * belonging to the recipient
22746 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
22749 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
22750 * belonging to the recipient
22752 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22755 * The sender's per-commitment point for their current commitment transaction
22757 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
22760 * The sender's per-commitment point for their current commitment transaction
22762 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22765 * Constructs a new DataLossProtect given each field
22767 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
22770 * Creates a copy of the DataLossProtect
22772 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
22775 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
22777 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
22782 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
22787 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22790 * The next commitment number for the sender
22792 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
22795 * The next commitment number for the sender
22797 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
22800 * The next commitment number for the recipient
22802 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
22805 * The next commitment number for the recipient
22807 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
22810 * Creates a copy of the ChannelReestablish
22812 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
22815 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
22817 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
22822 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
22827 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22830 * The short channel ID
22832 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
22835 * The short channel ID
22837 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
22840 * A signature by the node key
22842 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
22845 * A signature by the node key
22847 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
22850 * A signature by the funding key
22852 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
22855 * A signature by the funding key
22857 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
22860 * Constructs a new AnnouncementSignatures given each field
22862 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);
22865 * Creates a copy of the AnnouncementSignatures
22867 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
22870 * Frees any resources used by the NetAddress
22872 void NetAddress_free(struct LDKNetAddress this_ptr);
22875 * Creates a copy of the NetAddress
22877 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
22880 * Utility method to constructs a new IPv4-variant NetAddress
22882 struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port);
22885 * Utility method to constructs a new IPv6-variant NetAddress
22887 struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port);
22890 * Utility method to constructs a new OnionV2-variant NetAddress
22892 struct LDKNetAddress NetAddress_onion_v2(struct LDKTwelveBytes a);
22895 * Utility method to constructs a new OnionV3-variant NetAddress
22897 struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
22900 * Utility method to constructs a new Hostname-variant NetAddress
22902 struct LDKNetAddress NetAddress_hostname(struct LDKHostname hostname, uint16_t port);
22905 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
22907 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
22910 * Read a NetAddress from a byte array, created by NetAddress_write
22912 struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
22915 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
22917 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
22920 * The advertised features
22922 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
22925 * The advertised features
22927 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
22930 * A strictly monotonic announcement counter, with gaps allowed
22932 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
22935 * A strictly monotonic announcement counter, with gaps allowed
22937 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
22940 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
22943 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
22946 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
22949 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22952 * An RGB color for UI purposes
22954 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
22957 * An RGB color for UI purposes
22959 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
22962 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
22965 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
22968 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
22971 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22974 * List of addresses on which this node is reachable
22976 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
22979 * Creates a copy of the UnsignedNodeAnnouncement
22981 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
22984 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
22986 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
22989 * The signature by the node key
22991 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
22994 * The signature by the node key
22996 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
22999 * The actual content of the announcement
23001 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
23004 * The actual content of the announcement
23006 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
23009 * Constructs a new NodeAnnouncement given each field
23011 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
23014 * Creates a copy of the NodeAnnouncement
23016 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
23019 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
23021 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
23024 * The advertised channel features
23026 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
23029 * The advertised channel features
23031 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
23034 * The genesis hash of the blockchain where the channel is to be opened
23036 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
23039 * The genesis hash of the blockchain where the channel is to be opened
23041 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23044 * The short channel ID
23046 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
23049 * The short channel ID
23051 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
23054 * One of the two node_ids which are endpoints of this channel
23056 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
23059 * One of the two node_ids which are endpoints of this channel
23061 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23064 * The other of the two node_ids which are endpoints of this channel
23066 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
23069 * The other of the two node_ids which are endpoints of this channel
23071 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23074 * The funding key for the first node
23076 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
23079 * The funding key for the first node
23081 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23084 * The funding key for the second node
23086 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
23089 * The funding key for the second node
23091 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23094 * Creates a copy of the UnsignedChannelAnnouncement
23096 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
23099 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
23101 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
23104 * Authentication of the announcement by the first public node
23106 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
23109 * Authentication of the announcement by the first public node
23111 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
23114 * Authentication of the announcement by the second public node
23116 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
23119 * Authentication of the announcement by the second public node
23121 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
23124 * Proof of funding UTXO ownership by the first public node
23126 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
23129 * Proof of funding UTXO ownership by the first public node
23131 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
23134 * Proof of funding UTXO ownership by the second public node
23136 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
23139 * Proof of funding UTXO ownership by the second public node
23141 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
23144 * The actual announcement
23146 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
23149 * The actual announcement
23151 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
23154 * Constructs a new ChannelAnnouncement given each field
23156 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);
23159 * Creates a copy of the ChannelAnnouncement
23161 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
23164 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
23166 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
23169 * The genesis hash of the blockchain where the channel is to be opened
23171 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
23174 * The genesis hash of the blockchain where the channel is to be opened
23176 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23179 * The short channel ID
23181 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
23184 * The short channel ID
23186 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
23189 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
23191 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
23194 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
23196 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
23201 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
23206 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
23209 * The number of blocks such that if:
23210 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
23211 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
23212 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
23213 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
23214 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
23215 * forwarding. Note that the HTLC sender is the one who originally sets this value when
23216 * constructing the route.
23218 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
23221 * The number of blocks such that if:
23222 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
23223 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
23224 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
23225 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
23226 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
23227 * forwarding. Note that the HTLC sender is the one who originally sets this value when
23228 * constructing the route.
23230 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
23233 * The minimum HTLC size incoming to sender, in milli-satoshi
23235 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
23238 * The minimum HTLC size incoming to sender, in milli-satoshi
23240 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
23243 * The maximum HTLC value incoming to sender, in milli-satoshi. Used to be optional.
23245 uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
23248 * The maximum HTLC value incoming to sender, in milli-satoshi. Used to be optional.
23250 void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
23253 * The base HTLC fee charged by sender, in milli-satoshi
23255 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
23258 * The base HTLC fee charged by sender, in milli-satoshi
23260 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
23263 * The amount to fee multiplier, in micro-satoshi
23265 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
23268 * The amount to fee multiplier, in micro-satoshi
23270 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
23273 * Excess data which was signed as a part of the message which we do not (yet) understand how
23274 * to decode. This is stored to ensure forward-compatibility as new fields are added to the
23277 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
23280 * Constructs a new UnsignedChannelUpdate given each field
23282 MUST_USE_RES struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_new(struct LDKThirtyTwoBytes chain_hash_arg, uint64_t short_channel_id_arg, uint32_t timestamp_arg, uint8_t flags_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, struct LDKCVec_u8Z excess_data_arg);
23285 * Creates a copy of the UnsignedChannelUpdate
23287 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
23290 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
23292 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
23295 * A signature of the channel update
23297 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
23300 * A signature of the channel update
23302 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
23305 * The actual channel update
23307 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
23310 * The actual channel update
23312 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
23315 * Constructs a new ChannelUpdate given each field
23317 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
23320 * Creates a copy of the ChannelUpdate
23322 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
23325 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
23327 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
23330 * The genesis hash of the blockchain being queried
23332 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
23335 * The genesis hash of the blockchain being queried
23337 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23340 * The height of the first block for the channel UTXOs being queried
23342 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
23345 * The height of the first block for the channel UTXOs being queried
23347 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
23350 * The number of blocks to include in the query results
23352 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
23355 * The number of blocks to include in the query results
23357 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
23360 * Constructs a new QueryChannelRange given each field
23362 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
23365 * Creates a copy of the QueryChannelRange
23367 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
23370 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
23372 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
23375 * The genesis hash of the blockchain being queried
23377 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
23380 * The genesis hash of the blockchain being queried
23382 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23385 * The height of the first block in the range of the reply
23387 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
23390 * The height of the first block in the range of the reply
23392 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
23395 * The number of blocks included in the range of the reply
23397 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
23400 * The number of blocks included in the range of the reply
23402 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
23405 * True when this is the final reply for a query
23407 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
23410 * True when this is the final reply for a query
23412 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
23415 * The short_channel_ids in the channel range
23417 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
23420 * Constructs a new ReplyChannelRange given each field
23422 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);
23425 * Creates a copy of the ReplyChannelRange
23427 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
23430 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
23432 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
23435 * The genesis hash of the blockchain being queried
23437 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
23440 * The genesis hash of the blockchain being queried
23442 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23445 * The short_channel_ids that are being queried
23447 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
23450 * Constructs a new QueryShortChannelIds given each field
23452 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
23455 * Creates a copy of the QueryShortChannelIds
23457 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
23460 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
23462 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
23465 * The genesis hash of the blockchain that was queried
23467 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
23470 * The genesis hash of the blockchain that was queried
23472 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23475 * Indicates if the query recipient maintains up-to-date channel
23476 * information for the chain_hash
23478 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
23481 * Indicates if the query recipient maintains up-to-date channel
23482 * information for the chain_hash
23484 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
23487 * Constructs a new ReplyShortChannelIdsEnd given each field
23489 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
23492 * Creates a copy of the ReplyShortChannelIdsEnd
23494 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
23497 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
23499 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
23502 * The genesis hash of the blockchain for channel and node information
23504 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
23507 * The genesis hash of the blockchain for channel and node information
23509 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23512 * The starting unix timestamp
23514 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
23517 * The starting unix timestamp
23519 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
23522 * The range of information in seconds
23524 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
23527 * The range of information in seconds
23529 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
23532 * Constructs a new GossipTimestampFilter given each field
23534 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
23537 * Creates a copy of the GossipTimestampFilter
23539 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
23542 * Frees any resources used by the ErrorAction
23544 void ErrorAction_free(struct LDKErrorAction this_ptr);
23547 * Creates a copy of the ErrorAction
23549 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
23552 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
23554 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
23557 * Utility method to constructs a new IgnoreError-variant ErrorAction
23559 struct LDKErrorAction ErrorAction_ignore_error(void);
23562 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
23564 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
23567 * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
23569 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
23572 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
23574 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
23577 * Utility method to constructs a new SendWarningMessage-variant ErrorAction
23579 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
23582 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
23584 void LightningError_free(struct LDKLightningError this_obj);
23587 * A human-readable message describing the error
23589 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
23592 * A human-readable message describing the error
23594 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
23597 * The action which should be taken against the offending peer.
23599 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
23602 * The action which should be taken against the offending peer.
23604 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
23607 * Constructs a new LightningError given each field
23609 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
23612 * Creates a copy of the LightningError
23614 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
23617 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
23619 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
23622 * update_add_htlc messages which should be sent
23624 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23627 * update_add_htlc messages which should be sent
23629 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
23632 * update_fulfill_htlc messages which should be sent
23634 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23637 * update_fulfill_htlc messages which should be sent
23639 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
23642 * update_fail_htlc messages which should be sent
23644 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23647 * update_fail_htlc messages which should be sent
23649 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
23652 * update_fail_malformed_htlc messages which should be sent
23654 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23657 * update_fail_malformed_htlc messages which should be sent
23659 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
23662 * An update_fee message which should be sent
23664 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23666 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23669 * An update_fee message which should be sent
23671 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23673 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
23676 * Finally, the commitment_signed message which should be sent
23678 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23681 * Finally, the commitment_signed message which should be sent
23683 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
23686 * Constructs a new CommitmentUpdate given each field
23688 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);
23691 * Creates a copy of the CommitmentUpdate
23693 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
23696 * Calls the free function if one is set
23698 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
23701 * Calls the free function if one is set
23703 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
23706 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
23708 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
23711 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
23713 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
23716 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
23718 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
23721 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
23723 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
23726 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
23728 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
23731 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
23733 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
23736 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
23738 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
23741 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
23743 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
23746 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
23748 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
23751 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
23753 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
23756 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
23758 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
23761 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
23763 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
23766 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
23768 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
23771 * Read a FundingCreated from a byte array, created by FundingCreated_write
23773 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
23776 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
23778 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
23781 * Read a FundingSigned from a byte array, created by FundingSigned_write
23783 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
23786 * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
23788 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
23791 * Read a ChannelReady from a byte array, created by ChannelReady_write
23793 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
23796 * Serialize the Init object into a byte array which can be read by Init_read
23798 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
23801 * Read a Init from a byte array, created by Init_write
23803 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
23806 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
23808 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
23811 * Read a OpenChannel from a byte array, created by OpenChannel_write
23813 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
23816 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
23818 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
23821 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
23823 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
23826 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
23828 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
23831 * Read a Shutdown from a byte array, created by Shutdown_write
23833 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
23836 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
23838 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
23841 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
23843 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
23846 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
23848 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
23851 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
23853 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
23856 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
23858 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
23861 * Read a UpdateFee from a byte array, created by UpdateFee_write
23863 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
23866 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
23868 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
23871 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
23873 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
23876 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
23878 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
23881 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
23883 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
23886 * Serialize the Ping object into a byte array which can be read by Ping_read
23888 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
23891 * Read a Ping from a byte array, created by Ping_write
23893 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
23896 * Serialize the Pong object into a byte array which can be read by Pong_read
23898 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
23901 * Read a Pong from a byte array, created by Pong_write
23903 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
23906 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
23908 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
23911 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
23913 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
23916 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
23918 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
23921 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
23923 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
23926 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
23928 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
23931 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
23933 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
23936 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
23938 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
23941 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
23943 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
23946 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
23948 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
23951 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
23953 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
23956 * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
23958 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
23961 * Read a WarningMessage from a byte array, created by WarningMessage_write
23963 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
23966 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
23968 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
23971 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
23973 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
23976 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
23978 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
23981 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
23983 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
23986 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
23988 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
23991 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
23993 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
23996 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
23998 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
24001 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
24003 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
24006 *\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
24008 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
24011 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
24013 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
24016 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
24018 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
24021 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
24023 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
24026 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
24028 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
24031 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
24033 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
24036 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
24038 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
24041 * Calls the free function if one is set
24043 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
24046 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
24048 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
24051 * Constructs a new IgnoringMessageHandler given each field
24053 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
24056 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
24057 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
24059 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
24062 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
24063 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
24065 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
24068 * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
24069 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
24071 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
24074 * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
24075 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
24077 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
24080 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
24082 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
24085 * Constructs a new ErroringMessageHandler
24087 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
24090 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
24091 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
24093 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
24096 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
24097 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
24099 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
24102 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
24104 void MessageHandler_free(struct LDKMessageHandler this_obj);
24107 * A message handler which handles messages specific to channels. Usually this is just a
24108 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
24110 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
24112 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
24115 * A message handler which handles messages specific to channels. Usually this is just a
24116 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
24118 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
24120 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
24123 * A message handler which handles messages updating our knowledge of the network channel
24124 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
24126 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
24128 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
24131 * A message handler which handles messages updating our knowledge of the network channel
24132 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
24134 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
24136 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
24139 * Constructs a new MessageHandler given each field
24141 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
24144 * Creates a copy of a SocketDescriptor
24146 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
24149 * Calls the free function if one is set
24151 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
24154 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
24156 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
24159 * Used to indicate that we probably can't make any future connections to this peer (e.g.
24160 * because we required features that our peer was missing, or vice versa).
24162 * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close
24163 * any channels with this peer or check for new versions of LDK.
24165 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
24167 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
24170 * Used to indicate that we probably can't make any future connections to this peer (e.g.
24171 * because we required features that our peer was missing, or vice versa).
24173 * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close
24174 * any channels with this peer or check for new versions of LDK.
24176 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
24178 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
24181 * Constructs a new PeerHandleError given each field
24183 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
24186 * Creates a copy of the PeerHandleError
24188 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
24191 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
24193 void PeerManager_free(struct LDKPeerManager this_obj);
24196 * Constructs a new PeerManager with the given message handlers and node_id secret key
24197 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
24198 * cryptographically secure random bytes.
24200 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);
24203 * Get the list of node ids for peers which have completed the initial handshake.
24205 * For outbound connections, this will be the same as the their_node_id parameter passed in to
24206 * new_outbound_connection, however entries will only appear once the initial handshake has
24207 * completed and we are sure the remote peer has the private key for the given node_id.
24209 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
24212 * Indicates a new outbound connection has been established to a node with the given node_id
24213 * and an optional remote network address.
24215 * The remote network address adds the option to report a remote IP address back to a connecting
24216 * peer using the init message.
24217 * The user should pass the remote network address of the host they are connected to.
24219 * If an `Err` is returned here you must disconnect the connection immediately.
24221 * Returns a small number of bytes to send to the remote node (currently always 50).
24223 * Panics if descriptor is duplicative with some other descriptor which has not yet been
24224 * [`socket_disconnected()`].
24226 * [`socket_disconnected()`]: PeerManager::socket_disconnected
24228 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);
24231 * Indicates a new inbound connection has been established to a node with an optional remote
24234 * The remote network address adds the option to report a remote IP address back to a connecting
24235 * peer using the init message.
24236 * The user should pass the remote network address of the host they are connected to.
24238 * May refuse the connection by returning an Err, but will never write bytes to the remote end
24239 * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
24240 * the connection immediately.
24242 * Panics if descriptor is duplicative with some other descriptor which has not yet been
24243 * [`socket_disconnected()`].
24245 * [`socket_disconnected()`]: PeerManager::socket_disconnected
24247 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);
24250 * Indicates that there is room to write data to the given socket descriptor.
24252 * May return an Err to indicate that the connection should be closed.
24254 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
24255 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
24256 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
24257 * ready to call `[write_buffer_space_avail`] again if a write call generated here isn't
24260 * [`send_data`]: SocketDescriptor::send_data
24261 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
24263 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
24266 * Indicates that data was read from the given socket descriptor.
24268 * May return an Err to indicate that the connection should be closed.
24270 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
24271 * Thus, however, you should call [`process_events`] after any `read_event` to generate
24272 * [`send_data`] calls to handle responses.
24274 * If `Ok(true)` is returned, further read_events should not be triggered until a
24275 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
24278 * [`send_data`]: SocketDescriptor::send_data
24279 * [`process_events`]: PeerManager::process_events
24281 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);
24284 * Checks for any events generated by our handlers and processes them. Includes sending most
24285 * response messages as well as messages generated by calls to handler functions directly (eg
24286 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
24288 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
24291 * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
24292 * or one of the other clients provided in our language bindings.
24294 * Note that if there are any other calls to this function waiting on lock(s) this may return
24295 * without doing any work. All available events that need handling will be handled before the
24296 * other calls return.
24298 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
24299 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
24300 * [`send_data`]: SocketDescriptor::send_data
24302 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
24305 * Indicates that the given socket descriptor's connection is now closed.
24307 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
24310 * Disconnect a peer given its node id.
24312 * Set `no_connection_possible` to true to prevent any further connection with this peer,
24313 * force-closing any channels we have with it.
24315 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
24316 * peer. Thus, be very careful about reentrancy issues.
24318 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
24320 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
24323 * Disconnects all currently-connected peers. This is useful on platforms where there may be
24324 * an indication that TCP sockets have stalled even if we weren't around to time them out
24325 * using regular ping/pongs.
24327 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
24330 * Send pings to each peer and disconnect those which did not respond to the last round of
24333 * This may be called on any timescale you want, however, roughly once every ten seconds is
24334 * preferred. The call rate determines both how often we send a ping to our peers and how much
24335 * time they have to respond before we disconnect them.
24337 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
24340 * [`send_data`]: SocketDescriptor::send_data
24342 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
24345 * Gets the weight for an HTLC-Success transaction.
24347 uint64_t htlc_success_tx_weight(bool opt_anchors);
24350 * Gets the weight for an HTLC-Timeout transaction.
24352 uint64_t htlc_timeout_tx_weight(bool opt_anchors);
24355 * Build the commitment secret from the seed and the commitment number
24357 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
24360 * Build a closing transaction
24362 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);
24365 * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
24367 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
24370 * Creates a copy of the CounterpartyCommitmentSecrets
24372 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
24375 * Creates a new empty `CounterpartyCommitmentSecrets` structure.
24377 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
24380 * Returns the minimum index of all stored secrets. Note that indexes start
24381 * at 1 << 48 and get decremented by one for each new secret.
24383 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
24386 * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
24387 * was generated in accordance with BOLT 3 and is consistent with previous secrets.
24389 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
24392 * Returns the secret at `idx`.
24393 * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
24395 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24397 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
24400 * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
24402 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
24405 * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
24407 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
24410 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
24411 * from the base secret and the per_commitment_point.
24413 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
24414 * generated (ie our own).
24416 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
24419 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
24420 * from the base point and the per_commitment_key. This is the public equivalent of
24421 * derive_private_key - using only public keys to derive a public key instead of private keys.
24423 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
24424 * generated (ie our own).
24426 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
24429 * Derives a per-commitment-transaction revocation key from its constituent parts.
24431 * Only the cheating participant owns a valid witness to propagate a revoked
24432 * commitment transaction, thus per_commitment_secret always come from cheater
24433 * and revocation_base_secret always come from punisher, which is the broadcaster
24434 * of the transaction spending with this key knowledge.
24436 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
24437 * generated (ie our own).
24439 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
24442 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
24443 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
24444 * public key instead of private keys.
24446 * Only the cheating participant owns a valid witness to propagate a revoked
24447 * commitment transaction, thus per_commitment_point always come from cheater
24448 * and revocation_base_point always come from punisher, which is the broadcaster
24449 * of the transaction spending with this key knowledge.
24451 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
24452 * generated (ie our own).
24454 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
24457 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
24459 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
24462 * The broadcaster's per-commitment public key which was used to derive the other keys.
24464 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
24467 * The broadcaster's per-commitment public key which was used to derive the other keys.
24469 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24472 * The revocation key which is used to allow the broadcaster of the commitment
24473 * transaction to provide their counterparty the ability to punish them if they broadcast
24476 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
24479 * The revocation key which is used to allow the broadcaster of the commitment
24480 * transaction to provide their counterparty the ability to punish them if they broadcast
24483 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24486 * Broadcaster's HTLC Key
24488 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
24491 * Broadcaster's HTLC Key
24493 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24496 * Countersignatory's HTLC Key
24498 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
24501 * Countersignatory's HTLC Key
24503 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24506 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
24508 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
24511 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
24513 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24516 * Constructs a new TxCreationKeys given each field
24518 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);
24521 * Creates a copy of the TxCreationKeys
24523 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
24526 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
24528 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
24531 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
24533 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
24536 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
24538 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
24541 * The public key which is used to sign all commitment transactions, as it appears in the
24542 * on-chain channel lock-in 2-of-2 multisig output.
24544 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
24547 * The public key which is used to sign all commitment transactions, as it appears in the
24548 * on-chain channel lock-in 2-of-2 multisig output.
24550 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24553 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
24554 * revocation keys. This is combined with the per-commitment-secret generated by the
24555 * counterparty to create a secret which the counterparty can reveal to revoke previous
24558 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
24561 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
24562 * revocation keys. This is combined with the per-commitment-secret generated by the
24563 * counterparty to create a secret which the counterparty can reveal to revoke previous
24566 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24569 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
24570 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
24571 * static across every commitment transaction.
24573 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
24576 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
24577 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
24578 * static across every commitment transaction.
24580 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24583 * The base point which is used (with derive_public_key) to derive a per-commitment payment
24584 * public key which receives non-HTLC-encumbered funds which are only available for spending
24585 * after some delay (or can be claimed via the revocation path).
24587 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
24590 * The base point which is used (with derive_public_key) to derive a per-commitment payment
24591 * public key which receives non-HTLC-encumbered funds which are only available for spending
24592 * after some delay (or can be claimed via the revocation path).
24594 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24597 * The base point which is used (with derive_public_key) to derive a per-commitment public key
24598 * which is used to encumber HTLC-in-flight outputs.
24600 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
24603 * The base point which is used (with derive_public_key) to derive a per-commitment public key
24604 * which is used to encumber HTLC-in-flight outputs.
24606 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24609 * Constructs a new ChannelPublicKeys given each field
24611 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);
24614 * Creates a copy of the ChannelPublicKeys
24616 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
24619 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
24621 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
24624 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
24626 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
24629 * Create per-state keys from channel base points and the per-commitment point.
24630 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
24632 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);
24635 * Generate per-state keys from channel static keys.
24636 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
24638 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);
24641 * A script either spendable by the revocation
24642 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
24643 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
24645 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
24648 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
24650 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
24653 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
24654 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
24655 * need to compare this value to whether the commitment transaction in question is that of
24656 * the counterparty or our own.
24658 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
24661 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
24662 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
24663 * need to compare this value to whether the commitment transaction in question is that of
24664 * the counterparty or our own.
24666 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
24669 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
24670 * this divided by 1000.
24672 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
24675 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
24676 * this divided by 1000.
24678 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
24681 * The CLTV lock-time at which this HTLC expires.
24683 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
24686 * The CLTV lock-time at which this HTLC expires.
24688 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
24691 * The hash of the preimage which unlocks this HTLC.
24693 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
24696 * The hash of the preimage which unlocks this HTLC.
24698 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24701 * The position within the commitment transactions' outputs. This may be None if the value is
24702 * below the dust limit (in which case no output appears in the commitment transaction and the
24703 * value is spent to additional transaction fees).
24705 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
24708 * The position within the commitment transactions' outputs. This may be None if the value is
24709 * below the dust limit (in which case no output appears in the commitment transaction and the
24710 * value is spent to additional transaction fees).
24712 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
24715 * Constructs a new HTLCOutputInCommitment given each field
24717 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);
24720 * Creates a copy of the HTLCOutputInCommitment
24722 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
24725 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
24727 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
24730 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
24732 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
24735 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
24736 * does not need to have its previous_output_index filled.
24738 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, const struct LDKTxCreationKeys *NONNULL_PTR keys);
24741 * Gets the redeemscript for a funding output from the two funding public keys.
24742 * Note that the order of funding public keys does not matter.
24744 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
24747 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
24748 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
24749 * transaction which needs signing, and can be used to construct an HTLC transaction which is
24750 * broadcastable given a counterparty HTLC signature.
24752 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
24753 * commitment transaction).
24755 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);
24758 * Gets the witnessScript for an anchor output from the funding public key.
24759 * The witness in the spending input must be:
24760 * <BIP 143 funding_signature>
24761 * After 16 blocks of confirmation, an alternative satisfying witness could be:
24763 * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
24765 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
24768 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
24770 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
24773 * Holder public keys
24775 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24778 * Holder public keys
24780 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
24783 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
24785 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24788 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
24790 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
24793 * Whether the holder is the initiator of this channel.
24794 * This is an input to the commitment number obscure factor computation.
24796 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24799 * Whether the holder is the initiator of this channel.
24800 * This is an input to the commitment number obscure factor computation.
24802 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
24805 * The late-bound counterparty channel transaction parameters.
24806 * These parameters are populated at the point in the protocol where the counterparty provides them.
24808 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24810 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24813 * The late-bound counterparty channel transaction parameters.
24814 * These parameters are populated at the point in the protocol where the counterparty provides them.
24816 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24818 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
24821 * The late-bound funding outpoint
24823 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24825 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24828 * The late-bound funding outpoint
24830 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24832 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
24835 * Are anchors used for this channel. Boolean is serialization backwards-compatible
24837 enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24840 * Are anchors used for this channel. Boolean is serialization backwards-compatible
24842 void ChannelTransactionParameters_set_opt_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
24845 * Constructs a new ChannelTransactionParameters given each field
24847 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);
24850 * Creates a copy of the ChannelTransactionParameters
24852 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
24855 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
24857 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
24860 * Counter-party public keys
24862 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
24865 * Counter-party public keys
24867 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
24870 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
24872 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
24875 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
24877 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
24880 * Constructs a new CounterpartyChannelTransactionParameters given each field
24882 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
24885 * Creates a copy of the CounterpartyChannelTransactionParameters
24887 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
24890 * Whether the late bound parameters are populated.
24892 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
24895 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
24896 * given that the holder is the broadcaster.
24898 * self.is_populated() must be true before calling this function.
24900 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
24903 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
24904 * given that the counterparty is the broadcaster.
24906 * self.is_populated() must be true before calling this function.
24908 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
24911 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
24913 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
24916 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
24918 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
24921 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
24923 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
24926 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
24928 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
24931 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
24933 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
24936 * Get the channel pubkeys for the broadcaster
24938 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24941 * Get the channel pubkeys for the countersignatory
24943 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24946 * Get the contest delay applicable to the transactions.
24947 * Note that the contest delay was selected by the countersignatory.
24949 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24952 * Whether the channel is outbound from the broadcaster.
24954 * The boolean representing the side that initiated the channel is
24955 * an input to the commitment number obscure factor computation.
24957 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24960 * The funding outpoint
24962 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24965 * Whether to use anchors for this channel
24967 MUST_USE_RES bool DirectedChannelTransactionParameters_opt_anchors(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24970 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
24972 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
24975 * Our counterparty's signature for the transaction
24977 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
24980 * Our counterparty's signature for the transaction
24982 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
24985 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
24987 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
24990 * Creates a copy of the HolderCommitmentTransaction
24992 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
24995 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
24997 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
25000 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
25002 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
25005 * Create a new holder transaction with the given counterparty signatures.
25006 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
25008 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);
25011 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
25013 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
25016 * The commitment transaction
25018 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
25021 * The commitment transaction
25023 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
25026 * The txid for the commitment transaction.
25028 * This is provided as a performance optimization, instead of calling transaction.txid()
25031 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
25034 * The txid for the commitment transaction.
25036 * This is provided as a performance optimization, instead of calling transaction.txid()
25039 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25042 * Constructs a new BuiltCommitmentTransaction given each field
25044 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
25047 * Creates a copy of the BuiltCommitmentTransaction
25049 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
25052 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
25054 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
25057 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
25059 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
25062 * Get the SIGHASH_ALL sighash value of the transaction.
25064 * This can be used to verify a signature.
25066 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);
25069 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
25070 * because we are about to broadcast a holder transaction.
25072 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);
25075 * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
25077 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
25080 * Creates a copy of the ClosingTransaction
25082 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
25085 * Checks if two ClosingTransactions contain equal inner contents.
25087 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
25090 * Construct an object of the class
25092 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);
25095 * Trust our pre-built transaction.
25097 * Applies a wrapper which allows access to the transaction.
25099 * This should only be used if you fully trust the builder of this object. It should not
25100 * be used by an external signer - instead use the verify function.
25102 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
25105 * Verify our pre-built transaction.
25107 * Applies a wrapper which allows access to the transaction.
25109 * An external validating signer must call this method before signing
25110 * or using the built transaction.
25112 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
25115 * The value to be sent to the holder, or zero if the output will be omitted
25117 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
25120 * The value to be sent to the counterparty, or zero if the output will be omitted
25122 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
25125 * The destination of the holder's output
25127 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
25130 * The destination of the counterparty's output
25132 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
25135 * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
25137 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
25140 * The pre-built Bitcoin commitment transaction
25142 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
25145 * Get the SIGHASH_ALL sighash value of the transaction.
25147 * This can be used to verify a signature.
25149 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);
25152 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
25153 * because we are about to broadcast a holder transaction.
25155 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);
25158 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
25160 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
25163 * Creates a copy of the CommitmentTransaction
25165 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
25168 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
25170 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
25173 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
25175 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
25178 * The backwards-counting commitment number
25180 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
25183 * The value to be sent to the broadcaster
25185 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
25188 * The value to be sent to the counterparty
25190 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
25193 * The feerate paid per 1000-weight-unit in this commitment transaction.
25195 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
25198 * Trust our pre-built transaction and derived transaction creation public keys.
25200 * Applies a wrapper which allows access to these fields.
25202 * This should only be used if you fully trust the builder of this object. It should not
25203 * be used by an external signer - instead use the verify function.
25205 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
25208 * Verify our pre-built transaction and derived transaction creation public keys.
25210 * Applies a wrapper which allows access to these fields.
25212 * An external validating signer must call this method before signing
25213 * or using the built transaction.
25215 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);
25218 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
25220 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
25223 * The transaction ID of the built Bitcoin transaction
25225 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
25228 * The pre-built Bitcoin commitment transaction
25230 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
25233 * The pre-calculated transaction creation public keys.
25235 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
25238 * Should anchors be used.
25240 MUST_USE_RES bool TrustedCommitmentTransaction_opt_anchors(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
25243 * Get a signature for each HTLC which was included in the commitment transaction (ie for
25244 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
25246 * The returned Vec has one entry for each HTLC, and in the same order.
25248 * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
25250 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);
25253 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
25254 * shared secret first. This prevents on-chain observers from discovering how many commitment
25255 * transactions occurred in a channel before it was closed.
25257 * This function gets the shared secret from relevant channel public keys and can be used to
25258 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
25260 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
25263 * Checks if two InitFeaturess contain equal inner contents.
25264 * This ignores pointers and is_owned flags and looks at the values in fields.
25265 * Two objects with NULL inner values will be considered "equal" here.
25267 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
25270 * Checks if two NodeFeaturess contain equal inner contents.
25271 * This ignores pointers and is_owned flags and looks at the values in fields.
25272 * Two objects with NULL inner values will be considered "equal" here.
25274 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
25277 * Checks if two ChannelFeaturess contain equal inner contents.
25278 * This ignores pointers and is_owned flags and looks at the values in fields.
25279 * Two objects with NULL inner values will be considered "equal" here.
25281 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
25284 * Checks if two InvoiceFeaturess contain equal inner contents.
25285 * This ignores pointers and is_owned flags and looks at the values in fields.
25286 * Two objects with NULL inner values will be considered "equal" here.
25288 bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
25291 * Checks if two ChannelTypeFeaturess contain equal inner contents.
25292 * This ignores pointers and is_owned flags and looks at the values in fields.
25293 * Two objects with NULL inner values will be considered "equal" here.
25295 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
25298 * Creates a copy of the InitFeatures
25300 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
25303 * Creates a copy of the NodeFeatures
25305 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
25308 * Creates a copy of the ChannelFeatures
25310 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
25313 * Creates a copy of the InvoiceFeatures
25315 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
25318 * Creates a copy of the ChannelTypeFeatures
25320 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
25323 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
25325 void InitFeatures_free(struct LDKInitFeatures this_obj);
25328 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
25330 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
25333 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
25335 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
25338 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
25340 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
25343 * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
25345 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
25348 * Create a blank Features with no features set
25350 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
25353 * Creates a Features with the bits set which are known by the implementation
25355 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
25358 * Returns true if this `Features` object contains unknown feature flags which are set as
25361 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25364 * Create a blank Features with no features set
25366 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
25369 * Creates a Features with the bits set which are known by the implementation
25371 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
25374 * Returns true if this `Features` object contains unknown feature flags which are set as
25377 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25380 * Create a blank Features with no features set
25382 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
25385 * Creates a Features with the bits set which are known by the implementation
25387 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
25390 * Returns true if this `Features` object contains unknown feature flags which are set as
25393 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
25396 * Create a blank Features with no features set
25398 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
25401 * Creates a Features with the bits set which are known by the implementation
25403 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
25406 * Returns true if this `Features` object contains unknown feature flags which are set as
25409 MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25412 * Create a blank Features with no features set
25414 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
25417 * Creates a Features with the bits set which are known by the implementation
25419 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_known(void);
25422 * Returns true if this `Features` object contains unknown feature flags which are set as
25425 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25428 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
25430 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
25433 * Read a InitFeatures from a byte array, created by InitFeatures_write
25435 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
25438 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
25440 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
25443 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
25445 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
25448 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
25450 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
25453 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
25455 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
25458 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
25460 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
25463 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
25465 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
25468 * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
25470 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
25473 * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
25475 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
25478 * Set this feature as optional.
25480 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25483 * Set this feature as required.
25485 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25488 * Checks if this feature is supported.
25490 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25493 * Set this feature as optional.
25495 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25498 * Set this feature as required.
25500 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25503 * Checks if this feature is supported.
25505 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25508 * Checks if this feature is required.
25510 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25513 * Checks if this feature is required.
25515 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25518 * Set this feature as optional.
25520 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25523 * Set this feature as required.
25525 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25528 * Checks if this feature is supported.
25530 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25533 * Set this feature as optional.
25535 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25538 * Set this feature as required.
25540 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25543 * Checks if this feature is supported.
25545 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25548 * Set this feature as optional.
25550 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25553 * Set this feature as required.
25555 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25558 * Checks if this feature is supported.
25560 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25563 * Checks if this feature is required.
25565 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25568 * Checks if this feature is required.
25570 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25573 * Set this feature as optional.
25575 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25578 * Set this feature as required.
25580 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25583 * Checks if this feature is supported.
25585 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25588 * Set this feature as optional.
25590 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25593 * Set this feature as required.
25595 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25598 * Checks if this feature is supported.
25600 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25603 * Checks if this feature is required.
25605 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25608 * Checks if this feature is required.
25610 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25613 * Set this feature as optional.
25615 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25618 * Set this feature as required.
25620 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25623 * Checks if this feature is supported.
25625 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25628 * Set this feature as optional.
25630 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25633 * Set this feature as required.
25635 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25638 * Checks if this feature is supported.
25640 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25643 * Set this feature as optional.
25645 void InvoiceFeatures_set_variable_length_onion_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25648 * Set this feature as required.
25650 void InvoiceFeatures_set_variable_length_onion_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25653 * Checks if this feature is supported.
25655 MUST_USE_RES bool InvoiceFeatures_supports_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25658 * Checks if this feature is required.
25660 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25663 * Checks if this feature is required.
25665 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25668 * Checks if this feature is required.
25670 MUST_USE_RES bool InvoiceFeatures_requires_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25673 * Set this feature as optional.
25675 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25678 * Set this feature as required.
25680 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25683 * Checks if this feature is supported.
25685 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25688 * Set this feature as optional.
25690 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25693 * Set this feature as required.
25695 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25698 * Checks if this feature is supported.
25700 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25703 * Set this feature as optional.
25705 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25708 * Set this feature as required.
25710 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25713 * Checks if this feature is supported.
25715 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25718 * Checks if this feature is required.
25720 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25723 * Checks if this feature is required.
25725 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25728 * Checks if this feature is required.
25730 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25733 * Set this feature as optional.
25735 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25738 * Set this feature as required.
25740 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25743 * Checks if this feature is supported.
25745 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25748 * Set this feature as optional.
25750 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25753 * Set this feature as required.
25755 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25758 * Checks if this feature is supported.
25760 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25763 * Set this feature as optional.
25765 void InvoiceFeatures_set_payment_secret_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25768 * Set this feature as required.
25770 void InvoiceFeatures_set_payment_secret_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25773 * Checks if this feature is supported.
25775 MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25778 * Checks if this feature is required.
25780 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25783 * Checks if this feature is required.
25785 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25788 * Checks if this feature is required.
25790 MUST_USE_RES bool InvoiceFeatures_requires_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25793 * Set this feature as optional.
25795 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25798 * Set this feature as required.
25800 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25803 * Checks if this feature is supported.
25805 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25808 * Set this feature as optional.
25810 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25813 * Set this feature as required.
25815 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25818 * Checks if this feature is supported.
25820 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25823 * Set this feature as optional.
25825 void InvoiceFeatures_set_basic_mpp_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25828 * Set this feature as required.
25830 void InvoiceFeatures_set_basic_mpp_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25833 * Checks if this feature is supported.
25835 MUST_USE_RES bool InvoiceFeatures_supports_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25838 * Checks if this feature is required.
25840 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25843 * Checks if this feature is required.
25845 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25848 * Checks if this feature is required.
25850 MUST_USE_RES bool InvoiceFeatures_requires_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25853 * Set this feature as optional.
25855 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25858 * Set this feature as required.
25860 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25863 * Checks if this feature is supported.
25865 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25868 * Set this feature as optional.
25870 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25873 * Set this feature as required.
25875 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25878 * Checks if this feature is supported.
25880 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25883 * Checks if this feature is required.
25885 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25888 * Checks if this feature is required.
25890 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25893 * Set this feature as optional.
25895 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25898 * Set this feature as required.
25900 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25903 * Checks if this feature is supported.
25905 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25908 * Set this feature as optional.
25910 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25913 * Set this feature as required.
25915 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25918 * Checks if this feature is supported.
25920 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25923 * Checks if this feature is required.
25925 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25928 * Checks if this feature is required.
25930 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25933 * Set this feature as optional.
25935 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25938 * Set this feature as required.
25940 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25943 * Checks if this feature is supported.
25945 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25948 * Set this feature as optional.
25950 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25953 * Set this feature as required.
25955 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25958 * Checks if this feature is supported.
25960 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25963 * Checks if this feature is required.
25965 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25968 * Checks if this feature is required.
25970 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25973 * Set this feature as optional.
25975 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25978 * Set this feature as required.
25980 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25983 * Checks if this feature is supported.
25985 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25988 * Set this feature as optional.
25990 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25993 * Set this feature as required.
25995 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25998 * Checks if this feature is supported.
26000 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26003 * Set this feature as optional.
26005 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26008 * Set this feature as required.
26010 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26013 * Checks if this feature is supported.
26015 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26018 * Checks if this feature is required.
26020 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26023 * Checks if this feature is required.
26025 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26028 * Checks if this feature is required.
26030 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26033 * Set this feature as optional.
26035 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
26038 * Set this feature as required.
26040 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
26043 * Checks if this feature is supported.
26045 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26048 * Set this feature as optional.
26050 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26053 * Set this feature as required.
26055 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26058 * Checks if this feature is supported.
26060 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26063 * Set this feature as optional.
26065 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26068 * Set this feature as required.
26070 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26073 * Checks if this feature is supported.
26075 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26078 * Checks if this feature is required.
26080 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26083 * Checks if this feature is required.
26085 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26088 * Checks if this feature is required.
26090 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26093 * Set this feature as optional.
26095 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26098 * Set this feature as required.
26100 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26103 * Checks if this feature is supported.
26105 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26108 * Checks if this feature is required.
26110 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26113 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
26115 void ShutdownScript_free(struct LDKShutdownScript this_obj);
26118 * Creates a copy of the ShutdownScript
26120 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
26123 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
26125 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
26128 * The script that did not meet the requirements from [BOLT #2].
26130 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
26132 struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
26135 * The script that did not meet the requirements from [BOLT #2].
26137 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
26139 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
26142 * Constructs a new InvalidShutdownScript given each field
26144 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
26147 * Creates a copy of the InvalidShutdownScript
26149 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
26152 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
26154 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
26157 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
26159 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
26162 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
26164 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
26167 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
26169 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
26172 * Generates a witness script pubkey from the given segwit version and program.
26174 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
26175 * [`ShutdownScript::new_p2wsh`] instead.
26179 * This function may return an error if `program` is invalid for the segwit `version`.
26181 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessVersion version, struct LDKu8slice program);
26184 * Converts the shutdown script into the underlying [`Script`].
26186 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
26189 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
26191 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26193 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
26196 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
26198 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
26200 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
26203 * Calls the free function if one is set
26205 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
26208 * Calls the free function if one is set
26210 void Type_free(struct LDKType this_ptr);
26213 * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
26215 void NodeId_free(struct LDKNodeId this_obj);
26218 * Creates a copy of the NodeId
26220 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
26223 * Create a new NodeId from a public key
26225 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
26228 * Get the public key slice from this NodeId
26230 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
26233 * Checks if two NodeIds contain equal inner contents.
26235 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
26238 * Serialize the NodeId object into a byte array which can be read by NodeId_read
26240 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
26243 * Read a NodeId from a byte array, created by NodeId_write
26245 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
26248 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
26250 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
26253 * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
26255 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
26258 * Frees any resources used by the NetworkUpdate
26260 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
26263 * Creates a copy of the NetworkUpdate
26265 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
26268 * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
26270 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
26273 * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
26275 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
26278 * Utility method to constructs a new NodeFailure-variant NetworkUpdate
26280 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
26283 * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
26285 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
26288 * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
26290 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
26293 * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
26295 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
26298 * Creates a new tracker of the actual state of the network of channels and nodes,
26299 * assuming an existing Network Graph.
26300 * Chain monitor is used to make sure announced channels exist on-chain,
26301 * channel data is correct, and that the announcement is signed with
26302 * channel owners' keys.
26304 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger);
26307 * Adds a provider used to check new announcements. Does not affect
26308 * existing announcements unless they are updated.
26309 * Add, update or remove the provider would replace the current one.
26311 void P2PGossipSync_add_chain_access(struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_AccessZ chain_access);
26314 * Constructs a new EventHandler which calls the relevant methods on this_arg.
26315 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
26317 struct LDKEventHandler NetworkGraph_as_EventHandler(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
26320 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
26321 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
26323 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
26326 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
26327 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
26329 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
26332 * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
26334 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
26337 * When the last update to the channel direction was issued.
26338 * Value is opaque, as set in the announcement.
26340 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
26343 * When the last update to the channel direction was issued.
26344 * Value is opaque, as set in the announcement.
26346 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
26349 * Whether the channel can be currently used for payments (in this one direction).
26351 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
26354 * Whether the channel can be currently used for payments (in this one direction).
26356 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
26359 * The difference in CLTV values that you must have when routing through this channel.
26361 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
26364 * The difference in CLTV values that you must have when routing through this channel.
26366 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
26369 * The minimum value, which must be relayed to the next hop via the channel
26371 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
26374 * The minimum value, which must be relayed to the next hop via the channel
26376 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
26379 * The maximum value which may be relayed to the next hop via the channel.
26381 uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
26384 * The maximum value which may be relayed to the next hop via the channel.
26386 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
26389 * Fees charged when the channel is used for routing
26391 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
26394 * Fees charged when the channel is used for routing
26396 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
26399 * Most recent update for the channel received from the network
26400 * Mostly redundant with the data we store in fields explicitly.
26401 * Everything else is useful only for sending out for initial routing sync.
26402 * Not stored if contains excess data to prevent DoS.
26404 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26406 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
26409 * Most recent update for the channel received from the network
26410 * Mostly redundant with the data we store in fields explicitly.
26411 * Everything else is useful only for sending out for initial routing sync.
26412 * Not stored if contains excess data to prevent DoS.
26414 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26416 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
26419 * Constructs a new ChannelUpdateInfo given each field
26421 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, uint64_t htlc_maximum_msat_arg, struct LDKRoutingFees fees_arg, struct LDKChannelUpdate last_update_message_arg);
26424 * Creates a copy of the ChannelUpdateInfo
26426 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
26429 * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
26431 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
26434 * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
26436 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
26439 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
26441 void ChannelInfo_free(struct LDKChannelInfo this_obj);
26444 * Protocol features of a channel communicated during its announcement
26446 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26449 * Protocol features of a channel communicated during its announcement
26451 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
26454 * Source node of the first direction of a channel
26456 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26459 * Source node of the first direction of a channel
26461 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
26464 * Details about the first direction of a channel
26466 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26468 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26471 * Details about the first direction of a channel
26473 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26475 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
26478 * Source node of the second direction of a channel
26480 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26483 * Source node of the second direction of a channel
26485 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
26488 * Details about the second direction of a channel
26490 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26492 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26495 * Details about the second direction of a channel
26497 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26499 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
26502 * The channel capacity as seen on-chain, if chain lookup is available.
26504 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26507 * The channel capacity as seen on-chain, if chain lookup is available.
26509 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
26512 * An initial announcement of the channel
26513 * Mostly redundant with the data we store in fields explicitly.
26514 * Everything else is useful only for sending out for initial routing sync.
26515 * Not stored if contains excess data to prevent DoS.
26517 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26519 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26522 * An initial announcement of the channel
26523 * Mostly redundant with the data we store in fields explicitly.
26524 * Everything else is useful only for sending out for initial routing sync.
26525 * Not stored if contains excess data to prevent DoS.
26527 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26529 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
26532 * Creates a copy of the ChannelInfo
26534 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
26537 * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
26539 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26541 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
26544 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
26546 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
26549 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
26551 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
26554 * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
26556 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
26559 * Creates a copy of the DirectedChannelInfo
26561 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
26564 * Returns information for the channel.
26566 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
26569 * Returns information for the direction.
26571 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26573 MUST_USE_RES struct LDKChannelUpdateInfo DirectedChannelInfo_direction(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
26576 * Returns the maximum HTLC amount allowed over the channel in the direction.
26578 MUST_USE_RES uint64_t DirectedChannelInfo_htlc_maximum_msat(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
26581 * Returns the [`EffectiveCapacity`] of the channel in the direction.
26583 * This is either the total capacity from the funding transaction, if known, or the
26584 * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
26587 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
26590 * Frees any resources used by the EffectiveCapacity
26592 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
26595 * Creates a copy of the EffectiveCapacity
26597 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
26600 * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
26602 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
26605 * Utility method to constructs a new MaximumHTLC-variant EffectiveCapacity
26607 struct LDKEffectiveCapacity EffectiveCapacity_maximum_htlc(uint64_t amount_msat);
26610 * Utility method to constructs a new Total-variant EffectiveCapacity
26612 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, struct LDKCOption_u64Z htlc_maximum_msat);
26615 * Utility method to constructs a new Infinite-variant EffectiveCapacity
26617 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
26620 * Utility method to constructs a new Unknown-variant EffectiveCapacity
26622 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
26625 * Returns the effective capacity denominated in millisatoshi.
26627 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
26630 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
26632 void RoutingFees_free(struct LDKRoutingFees this_obj);
26635 * Flat routing fee in satoshis
26637 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
26640 * Flat routing fee in satoshis
26642 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
26645 * Liquidity-based routing fee in millionths of a routed amount.
26646 * In other words, 10000 is 1%.
26648 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
26651 * Liquidity-based routing fee in millionths of a routed amount.
26652 * In other words, 10000 is 1%.
26654 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
26657 * Constructs a new RoutingFees given each field
26659 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
26662 * Checks if two RoutingFeess contain equal inner contents.
26663 * This ignores pointers and is_owned flags and looks at the values in fields.
26664 * Two objects with NULL inner values will be considered "equal" here.
26666 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
26669 * Creates a copy of the RoutingFees
26671 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
26674 * Checks if two RoutingFeess contain equal inner contents.
26676 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
26679 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
26681 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
26684 * Read a RoutingFees from a byte array, created by RoutingFees_write
26686 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
26689 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
26691 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
26694 * Protocol features the node announced support for
26696 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
26699 * Protocol features the node announced support for
26701 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
26704 * When the last known update to the node state was issued.
26705 * Value is opaque, as set in the announcement.
26707 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
26710 * When the last known update to the node state was issued.
26711 * Value is opaque, as set in the announcement.
26713 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
26716 * Color assigned to the node
26718 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
26721 * Color assigned to the node
26723 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
26726 * Moniker assigned to the node.
26727 * May be invalid or malicious (eg control chars),
26728 * should not be exposed to the user.
26730 struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
26733 * Moniker assigned to the node.
26734 * May be invalid or malicious (eg control chars),
26735 * should not be exposed to the user.
26737 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
26740 * Internet-level addresses via which one can connect to the node
26742 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
26745 * An initial announcement of the node
26746 * Mostly redundant with the data we store in fields explicitly.
26747 * Everything else is useful only for sending out for initial routing sync.
26748 * Not stored if contains excess data to prevent DoS.
26750 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26752 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
26755 * An initial announcement of the node
26756 * Mostly redundant with the data we store in fields explicitly.
26757 * Everything else is useful only for sending out for initial routing sync.
26758 * Not stored if contains excess data to prevent DoS.
26760 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26762 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
26765 * Constructs a new NodeAnnouncementInfo given each field
26767 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);
26770 * Creates a copy of the NodeAnnouncementInfo
26772 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
26775 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
26777 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
26780 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
26782 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
26785 * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
26787 void NodeAlias_free(struct LDKNodeAlias this_obj);
26789 const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
26791 void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26794 * Constructs a new NodeAlias given each field
26796 MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
26799 * Creates a copy of the NodeAlias
26801 struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
26804 * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
26806 struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
26809 * Read a NodeAlias from a byte array, created by NodeAlias_write
26811 struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
26814 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
26816 void NodeInfo_free(struct LDKNodeInfo this_obj);
26819 * All valid channels a node has announced
26821 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
26824 * Lowest fees enabling routing via any of the enabled, known channels to a node.
26825 * The two fields (flat and proportional fee) are independent,
26826 * meaning they don't have to refer to the same channel.
26828 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26830 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
26833 * Lowest fees enabling routing via any of the enabled, known channels to a node.
26834 * The two fields (flat and proportional fee) are independent,
26835 * meaning they don't have to refer to the same channel.
26837 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26839 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
26842 * More information about a node from node_announcement.
26843 * Optional because we store a Node entry after learning about it from
26844 * a channel announcement, but before receiving a node announcement.
26846 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26848 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
26851 * More information about a node from node_announcement.
26852 * Optional because we store a Node entry after learning about it from
26853 * a channel announcement, but before receiving a node announcement.
26855 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26857 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
26860 * Constructs a new NodeInfo given each field
26862 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
26865 * Creates a copy of the NodeInfo
26867 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
26870 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
26872 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
26875 * Read a NodeInfo from a byte array, created by NodeInfo_write
26877 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
26880 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
26882 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
26885 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
26887 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
26890 * Creates a new, empty, network graph.
26892 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKLogger logger);
26895 * Returns a read-only view of the network graph.
26897 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
26900 * The unix timestamp provided by the most recent rapid gossip sync.
26901 * It will be set by the rapid sync process after every sync completion.
26903 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
26906 * Update the unix timestamp provided by the most recent rapid gossip sync.
26907 * This should be done automatically by the rapid sync process after every sync completion.
26909 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
26912 * For an already known node (from channel announcements), update its stored properties from a
26913 * given node announcement.
26915 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
26916 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
26917 * routing messages from a source using a protocol other than the lightning P2P protocol.
26919 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
26922 * For an already known node (from channel announcements), update its stored properties from a
26923 * given node announcement without verifying the associated signatures. Because we aren't
26924 * given the associated signatures here we cannot relay the node announcement to any of our
26927 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);
26930 * Store or update channel info from a channel announcement.
26932 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
26933 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
26934 * routing messages from a source using a protocol other than the lightning P2P protocol.
26936 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
26937 * the corresponding UTXO exists on chain and is correctly-formatted.
26939 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);
26942 * Store or update channel info from a channel announcement without verifying the associated
26943 * signatures. Because we aren't given the associated signatures here we cannot relay the
26944 * channel announcement to any of our peers.
26946 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
26947 * the corresponding UTXO exists on chain and is correctly-formatted.
26949 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);
26952 * Update channel from partial announcement data received via rapid gossip sync
26954 * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
26955 * rapid gossip sync server)
26957 * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
26959 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);
26962 * Marks a channel in the graph as failed if a corresponding HTLC fail was sent.
26963 * If permanent, removes a channel from the local storage.
26964 * May cause the removal of nodes too, if this was their last channel.
26965 * If not permanent, makes channels unavailable for routing.
26967 void NetworkGraph_channel_failed(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
26970 * Marks a node in the graph as failed.
26972 void NetworkGraph_node_failed(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey _node_id, bool is_permanent);
26975 * Removes information about channels that we haven't heard any updates about in some time.
26976 * This can be used regularly to prune the network graph of channels that likely no longer
26979 * While there is no formal requirement that nodes regularly re-broadcast their channel
26980 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
26981 * pruning occur for updates which are at least two weeks old, which we implement here.
26983 * Note that for users of the `lightning-background-processor` crate this method may be
26984 * automatically called regularly for you.
26986 * This method is only available with the `std` feature. See
26987 * [`NetworkGraph::remove_stale_channels_with_time`] for `no-std` use.
26989 void NetworkGraph_remove_stale_channels(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
26992 * Removes information about channels that we haven't heard any updates about in some time.
26993 * This can be used regularly to prune the network graph of channels that likely no longer
26996 * While there is no formal requirement that nodes regularly re-broadcast their channel
26997 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
26998 * pruning occur for updates which are at least two weeks old, which we implement here.
27000 * This function takes the current unix time as an argument. For users with the `std` feature
27001 * enabled, [`NetworkGraph::remove_stale_channels`] may be preferable.
27003 void NetworkGraph_remove_stale_channels_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
27006 * For an already known (from announcement) channel, update info about one of the directions
27009 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
27010 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
27011 * routing messages from a source using a protocol other than the lightning P2P protocol.
27013 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
27014 * materially in the future will be rejected.
27016 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
27019 * For an already known (from announcement) channel, update info about one of the directions
27020 * of the channel without verifying the associated signatures. Because we aren't given the
27021 * associated signatures here we cannot relay the channel update to any of our peers.
27023 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
27024 * materially in the future will be rejected.
27026 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
27029 * Returns information on a channel with the given id.
27031 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27033 MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
27036 * Returns information on a node with the given id.
27038 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27040 MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
27043 * Get network addresses by node id.
27044 * Returns None if the requested node is completely unknown,
27045 * or if node announcement for the node was never received.
27047 MUST_USE_RES struct LDKCOption_CVec_NetAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
27050 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
27052 void RouteHop_free(struct LDKRouteHop this_obj);
27055 * The node_id of the node at this hop.
27057 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
27060 * The node_id of the node at this hop.
27062 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27065 * The node_announcement features of the node at this hop. For the last hop, these may be
27066 * amended to match the features present in the invoice this node generated.
27068 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
27071 * The node_announcement features of the node at this hop. For the last hop, these may be
27072 * amended to match the features present in the invoice this node generated.
27074 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
27077 * The channel that should be used from the previous hop to reach this node.
27079 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
27082 * The channel that should be used from the previous hop to reach this node.
27084 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
27087 * The channel_announcement features of the channel that should be used from the previous hop
27088 * to reach this node.
27090 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
27093 * The channel_announcement features of the channel that should be used from the previous hop
27094 * to reach this node.
27096 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
27099 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
27100 * For the last hop, this should be the full value of the payment (might be more than
27101 * requested if we had to match htlc_minimum_msat).
27103 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
27106 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
27107 * For the last hop, this should be the full value of the payment (might be more than
27108 * requested if we had to match htlc_minimum_msat).
27110 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
27113 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
27114 * expected at the destination, in excess of the current block height.
27116 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
27119 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
27120 * expected at the destination, in excess of the current block height.
27122 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
27125 * Constructs a new RouteHop given each field
27127 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);
27130 * Creates a copy of the RouteHop
27132 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
27135 * Checks if two RouteHops contain equal inner contents.
27137 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
27140 * Checks if two RouteHops contain equal inner contents.
27141 * This ignores pointers and is_owned flags and looks at the values in fields.
27142 * Two objects with NULL inner values will be considered "equal" here.
27144 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
27147 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
27149 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
27152 * Read a RouteHop from a byte array, created by RouteHop_write
27154 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
27157 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
27159 void Route_free(struct LDKRoute this_obj);
27162 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
27163 * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT
27164 * INCLUDING our own, where the last hop is the destination. Thus, this must always be at
27165 * least length one. While the maximum length of any given path is variable, keeping the length
27166 * of any path less or equal to 19 should currently ensure it is viable.
27168 struct LDKCVec_CVec_RouteHopZZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
27171 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
27172 * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT
27173 * INCLUDING our own, where the last hop is the destination. Thus, this must always be at
27174 * least length one. While the maximum length of any given path is variable, keeping the length
27175 * of any path less or equal to 19 should currently ensure it is viable.
27177 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
27180 * The `payment_params` parameter passed to [`find_route`].
27181 * This is used by `ChannelManager` to track information which may be required for retries,
27182 * provided back to you via [`Event::PaymentPathFailed`].
27184 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
27186 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27188 struct LDKPaymentParameters Route_get_payment_params(const struct LDKRoute *NONNULL_PTR this_ptr);
27191 * The `payment_params` parameter passed to [`find_route`].
27192 * This is used by `ChannelManager` to track information which may be required for retries,
27193 * provided back to you via [`Event::PaymentPathFailed`].
27195 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
27197 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
27199 void Route_set_payment_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
27202 * Constructs a new Route given each field
27204 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg, struct LDKPaymentParameters payment_params_arg);
27207 * Creates a copy of the Route
27209 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
27212 * Checks if two Routes contain equal inner contents.
27214 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
27217 * Checks if two Routes contain equal inner contents.
27218 * This ignores pointers and is_owned flags and looks at the values in fields.
27219 * Two objects with NULL inner values will be considered "equal" here.
27221 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
27224 * Returns the total amount of fees paid on this [`Route`].
27226 * This doesn't include any extra payment made to the recipient, which can happen in excess of
27227 * the amount passed to [`find_route`]'s `params.final_value_msat`.
27229 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
27232 * Returns the total amount paid on this [`Route`], excluding the fees.
27234 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
27237 * Serialize the Route object into a byte array which can be read by Route_read
27239 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
27242 * Read a Route from a byte array, created by Route_write
27244 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
27247 * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
27249 void RouteParameters_free(struct LDKRouteParameters this_obj);
27252 * The parameters of the failed payment path.
27254 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
27257 * The parameters of the failed payment path.
27259 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
27262 * The amount in msats sent on the failed payment path.
27264 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
27267 * The amount in msats sent on the failed payment path.
27269 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
27272 * The CLTV on the final hop of the failed payment path.
27274 uint32_t RouteParameters_get_final_cltv_expiry_delta(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
27277 * The CLTV on the final hop of the failed payment path.
27279 void RouteParameters_set_final_cltv_expiry_delta(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint32_t val);
27282 * Constructs a new RouteParameters given each field
27284 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);
27287 * Creates a copy of the RouteParameters
27289 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
27292 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
27294 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
27297 * Read a RouteParameters from a byte array, created by RouteParameters_write
27299 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
27302 * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
27304 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
27307 * The node id of the payee.
27309 struct LDKPublicKey PaymentParameters_get_payee_pubkey(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
27312 * The node id of the payee.
27314 void PaymentParameters_set_payee_pubkey(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27317 * Features supported by the payee.
27319 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
27320 * does not contain any features.
27322 * [`for_keysend`]: Self::for_keysend
27324 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27326 struct LDKInvoiceFeatures PaymentParameters_get_features(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
27329 * Features supported by the payee.
27331 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
27332 * does not contain any features.
27334 * [`for_keysend`]: Self::for_keysend
27336 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
27338 void PaymentParameters_set_features(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKInvoiceFeatures val);
27341 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
27343 struct LDKCVec_RouteHintZ PaymentParameters_get_route_hints(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
27346 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
27348 void PaymentParameters_set_route_hints(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintZ val);
27351 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
27353 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
27356 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
27358 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
27361 * The maximum total CLTV delta we accept for the route.
27362 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
27364 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
27367 * The maximum total CLTV delta we accept for the route.
27368 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
27370 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
27373 * The maximum number of paths that may be used by (MPP) payments.
27374 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
27376 uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
27379 * The maximum number of paths that may be used by (MPP) payments.
27380 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
27382 void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
27385 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
27386 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
27387 * a lower value prefers to send larger MPP parts, potentially saturating channels and
27388 * increasing failure probability for those paths.
27390 * Note that this restriction will be relaxed during pathfinding after paths which meet this
27391 * restriction have been found. While paths which meet this criteria will be searched for, it
27392 * is ultimately up to the scorer to select them over other paths.
27394 * A value of 0 will allow payments up to and including a channel's total announced usable
27395 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
27399 uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
27402 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
27403 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
27404 * a lower value prefers to send larger MPP parts, potentially saturating channels and
27405 * increasing failure probability for those paths.
27407 * Note that this restriction will be relaxed during pathfinding after paths which meet this
27408 * restriction have been found. While paths which meet this criteria will be searched for, it
27409 * is ultimately up to the scorer to select them over other paths.
27411 * A value of 0 will allow payments up to and including a channel's total announced usable
27412 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
27416 void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
27419 * A list of SCIDs which this payment was previously attempted over and which caused the
27420 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
27423 void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
27426 * Constructs a new PaymentParameters given each field
27428 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_path_count_arg, uint8_t max_channel_saturation_power_of_half_arg, struct LDKCVec_u64Z previously_failed_channels_arg);
27431 * Creates a copy of the PaymentParameters
27433 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
27436 * Checks if two PaymentParameterss contain equal inner contents.
27438 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
27441 * Checks if two PaymentParameterss contain equal inner contents.
27442 * This ignores pointers and is_owned flags and looks at the values in fields.
27443 * Two objects with NULL inner values will be considered "equal" here.
27445 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
27448 * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
27450 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
27453 * Read a PaymentParameters from a byte array, created by PaymentParameters_write
27455 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser);
27458 * Creates a payee with the node id of the given `pubkey`.
27460 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey);
27463 * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
27465 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey);
27468 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
27470 void RouteHint_free(struct LDKRouteHint this_obj);
27472 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
27474 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
27477 * Constructs a new RouteHint given each field
27479 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
27482 * Creates a copy of the RouteHint
27484 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
27487 * Checks if two RouteHints contain equal inner contents.
27489 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
27492 * Checks if two RouteHints contain equal inner contents.
27493 * This ignores pointers and is_owned flags and looks at the values in fields.
27494 * Two objects with NULL inner values will be considered "equal" here.
27496 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
27499 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
27501 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
27504 * Read a RouteHint from a byte array, created by RouteHint_write
27506 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
27509 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
27511 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
27514 * The node_id of the non-target end of the route
27516 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
27519 * The node_id of the non-target end of the route
27521 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27524 * The short_channel_id of this channel
27526 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
27529 * The short_channel_id of this channel
27531 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
27534 * The fees which must be paid to use this channel
27536 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
27539 * The fees which must be paid to use this channel
27541 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
27544 * The difference in CLTV values between this node and the next node.
27546 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
27549 * The difference in CLTV values between this node and the next node.
27551 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
27554 * The minimum value, in msat, which must be relayed to the next hop.
27556 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
27559 * The minimum value, in msat, which must be relayed to the next hop.
27561 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
27564 * The maximum value in msat available for routing with a single HTLC.
27566 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
27569 * The maximum value in msat available for routing with a single HTLC.
27571 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
27574 * Constructs a new RouteHintHop given each field
27576 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);
27579 * Creates a copy of the RouteHintHop
27581 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
27584 * Checks if two RouteHintHops contain equal inner contents.
27586 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
27589 * Checks if two RouteHintHops contain equal inner contents.
27590 * This ignores pointers and is_owned flags and looks at the values in fields.
27591 * Two objects with NULL inner values will be considered "equal" here.
27593 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
27596 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
27598 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
27601 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
27603 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
27606 * Finds a route from us (payer) to the given target node (payee).
27608 * If the payee provided features in their invoice, they should be provided via `params.payee`.
27609 * Without this, MPP will only be used if the payee's features are available in the network graph.
27611 * Private routing paths between a public node and the target may be included in `params.payee`.
27613 * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
27614 * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
27615 * from `network_graph` will be ignored, and only those in `first_hops` will be used.
27617 * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
27618 * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
27619 * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
27623 * May be used to re-compute a [`Route`] when handling a [`Event::PaymentPathFailed`]. Any
27624 * adjustments to the [`NetworkGraph`] and channel scores should be made prior to calling this
27629 * Panics if first_hops contains channels without short_channel_ids;
27630 * [`ChannelManager::list_usable_channels`] will never include such channels.
27632 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
27633 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
27634 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
27636 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
27638 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]);
27641 * Construct a route from us (payer) to the target node (payee) via the given hops (which should
27642 * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
27644 * Re-uses logic from `find_route`, so the restrictions described there also apply here.
27646 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]);
27649 * Calls the free function if one is set
27651 void Score_free(struct LDKScore this_ptr);
27654 * Calls the free function if one is set
27656 void LockableScore_free(struct LDKLockableScore this_ptr);
27659 * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
27661 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
27664 * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
27666 struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
27669 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
27671 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
27674 * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
27676 void ChannelUsage_free(struct LDKChannelUsage this_obj);
27679 * The amount to send through the channel, denominated in millisatoshis.
27681 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
27684 * The amount to send through the channel, denominated in millisatoshis.
27686 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
27689 * Total amount, denominated in millisatoshis, already allocated to send through the channel
27690 * as part of a multi-path payment.
27692 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
27695 * Total amount, denominated in millisatoshis, already allocated to send through the channel
27696 * as part of a multi-path payment.
27698 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
27701 * The effective capacity of the channel.
27703 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
27706 * The effective capacity of the channel.
27708 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
27711 * Constructs a new ChannelUsage given each field
27713 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
27716 * Creates a copy of the ChannelUsage
27718 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
27721 * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
27723 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
27726 * Creates a copy of the FixedPenaltyScorer
27728 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
27731 * Creates a new scorer using `penalty_msat`.
27733 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
27736 * Constructs a new Score which calls the relevant methods on this_arg.
27737 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
27739 struct LDKScore FixedPenaltyScorer_as_Score(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
27742 * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
27744 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
27747 * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
27749 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
27752 * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
27754 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
27757 * Frees any resources used by the ProbabilisticScoringParameters, if is_owned is set and inner is non-NULL.
27759 void ProbabilisticScoringParameters_free(struct LDKProbabilisticScoringParameters this_obj);
27762 * A fixed penalty in msats to apply to each channel.
27764 * Default value: 500 msat
27766 uint64_t ProbabilisticScoringParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27769 * A fixed penalty in msats to apply to each channel.
27771 * Default value: 500 msat
27773 void ProbabilisticScoringParameters_set_base_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27776 * A multiplier used with the payment amount to calculate a fixed penalty applied to each
27777 * channel, in excess of the [`base_penalty_msat`].
27779 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
27780 * fees plus penalty) for large payments. The penalty is computed as the product of this
27781 * multiplier and `2^30`ths of the payment amount.
27783 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
27785 * Default value: 8,192 msat
27787 * [`base_penalty_msat`]: Self::base_penalty_msat
27789 uint64_t ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27792 * A multiplier used with the payment amount to calculate a fixed penalty applied to each
27793 * channel, in excess of the [`base_penalty_msat`].
27795 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
27796 * fees plus penalty) for large payments. The penalty is computed as the product of this
27797 * multiplier and `2^30`ths of the payment amount.
27799 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
27801 * Default value: 8,192 msat
27803 * [`base_penalty_msat`]: Self::base_penalty_msat
27805 void ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27808 * A multiplier used in conjunction with the negative `log10` of the channel's success
27809 * probability for a payment to determine the liquidity penalty.
27811 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
27812 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
27813 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
27814 * lower bounding the success probability to `0.01`) when the amount falls within the
27815 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
27816 * result in a `u64::max_value` penalty, however.
27818 * Default value: 40,000 msat
27820 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
27822 uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27825 * A multiplier used in conjunction with the negative `log10` of the channel's success
27826 * probability for a payment to determine the liquidity penalty.
27828 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
27829 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
27830 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
27831 * lower bounding the success probability to `0.01`) when the amount falls within the
27832 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
27833 * result in a `u64::max_value` penalty, however.
27835 * Default value: 40,000 msat
27837 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
27839 void ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27842 * The time required to elapse before any knowledge learned about channel liquidity balances is
27845 * The bounds are defined in terms of offsets and are initially zero. Increasing the offsets
27846 * gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases
27847 * the certainty of the channel liquidity balance.
27849 * Default value: 1 hour
27853 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
27854 * liquidity knowledge will never decay except when the bounds cross.
27856 uint64_t ProbabilisticScoringParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27859 * The time required to elapse before any knowledge learned about channel liquidity balances is
27862 * The bounds are defined in terms of offsets and are initially zero. Increasing the offsets
27863 * gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases
27864 * the certainty of the channel liquidity balance.
27866 * Default value: 1 hour
27870 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
27871 * liquidity knowledge will never decay except when the bounds cross.
27873 void ProbabilisticScoringParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27876 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
27877 * channel's success probability for the payment to determine the amount penalty.
27879 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
27880 * fees plus penalty) for large payments. The penalty is computed as the product of this
27881 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
27882 * success probability.
27884 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
27886 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
27887 * the amount will result in a penalty of the multiplier. And, as the success probability
27888 * decreases, the negative `log10` weighting will increase dramatically. For higher success
27889 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
27892 * Default value: 256 msat
27894 uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27897 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
27898 * channel's success probability for the payment to determine the amount penalty.
27900 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
27901 * fees plus penalty) for large payments. The penalty is computed as the product of this
27902 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
27903 * success probability.
27905 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
27907 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
27908 * the amount will result in a penalty of the multiplier. And, as the success probability
27909 * decreases, the negative `log10` weighting will increase dramatically. For higher success
27910 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
27913 * Default value: 256 msat
27915 void ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27918 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
27919 * channel's capacity, which makes us prefer nodes with a smaller `htlc_maximum_msat`. We
27920 * treat such nodes preferentially as this makes balance discovery attacks harder to execute,
27921 * thereby creating an incentive to restrict `htlc_maximum_msat` and improve privacy.
27923 * Default value: 250 msat
27925 uint64_t ProbabilisticScoringParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27928 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
27929 * channel's capacity, which makes us prefer nodes with a smaller `htlc_maximum_msat`. We
27930 * treat such nodes preferentially as this makes balance discovery attacks harder to execute,
27931 * thereby creating an incentive to restrict `htlc_maximum_msat` and improve privacy.
27933 * Default value: 250 msat
27935 void ProbabilisticScoringParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27938 * This penalty is applied when the amount we're attempting to send over a channel exceeds our
27939 * current estimate of the channel's available liquidity.
27941 * Note that in this case all other penalties, including the
27942 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
27943 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
27944 * applicable, are still included in the overall penalty.
27946 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
27947 * `u64::max_value()` will guarantee that.
27949 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
27951 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
27952 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
27953 * [`base_penalty_msat`]: Self::base_penalty_msat
27954 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
27956 uint64_t ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27959 * This penalty is applied when the amount we're attempting to send over a channel exceeds our
27960 * current estimate of the channel's available liquidity.
27962 * Note that in this case all other penalties, including the
27963 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
27964 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
27965 * applicable, are still included in the overall penalty.
27967 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
27968 * `u64::max_value()` will guarantee that.
27970 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
27972 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
27973 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
27974 * [`base_penalty_msat`]: Self::base_penalty_msat
27975 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
27977 void ProbabilisticScoringParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27980 * Creates a copy of the ProbabilisticScoringParameters
27982 struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_clone(const struct LDKProbabilisticScoringParameters *NONNULL_PTR orig);
27985 * Creates a new scorer using the given scoring parameters for sending payments from a node
27986 * through a network graph.
27988 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringParameters params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
27991 * Dump the contents of this scorer into the configured logger.
27993 * Note that this writes roughly one line per channel for which we have a liquidity estimate,
27994 * which may be a substantial amount of log output.
27996 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
27999 * Query the estimated minimum and maximum liquidity available for sending a payment over the
28000 * channel with `scid` towards the given `target` node.
28002 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);
28005 * Marks the node with the given `node_id` as banned, i.e.,
28006 * it will be avoided during path finding.
28008 void ProbabilisticScorer_add_banned(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
28011 * Removes the node with the given `node_id` from the list of nodes to avoid.
28013 void ProbabilisticScorer_remove_banned(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
28016 * Sets a manual penalty for the given node.
28018 void ProbabilisticScorer_set_manual_penalty(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
28021 * Removes the node with the given `node_id` from the list of manual penalties.
28023 void ProbabilisticScorer_remove_manual_penalty(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
28026 * Clears the list of manual penalties that are applied during path finding.
28028 void ProbabilisticScorer_clear_manual_penalties(struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
28031 * Marks all nodes in the given list as banned, i.e.,
28032 * they will be avoided during path finding.
28034 void ProbabilisticScoringParameters_add_banned_from_list(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
28037 * Creates a "default" ProbabilisticScoringParameters. See struct and individual field documentaiton for details on which values are used.
28039 MUST_USE_RES struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_default(void);
28042 * Constructs a new Score which calls the relevant methods on this_arg.
28043 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
28045 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
28048 * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
28050 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
28053 * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
28055 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
28058 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
28060 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
28063 * Initialize a new FilesystemPersister and set the path to the individual channels'
28066 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
28069 * Get the directory which was provided when this persister was initialized.
28071 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
28074 * Read `ChannelMonitor`s from disk.
28076 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
28079 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
28081 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
28084 * Frees any resources used by the GossipSync
28086 void GossipSync_free(struct LDKGossipSync this_ptr);
28089 * Utility method to constructs a new P2P-variant GossipSync
28091 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
28094 * Utility method to constructs a new Rapid-variant GossipSync
28096 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
28099 * Utility method to constructs a new None-variant GossipSync
28101 struct LDKGossipSync GossipSync_none(void);
28104 * Start a background thread that takes care of responsibilities enumerated in the [top-level
28107 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
28108 * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
28109 * either [`join`] or [`stop`].
28111 * # Data Persistence
28113 * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
28114 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
28115 * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
28116 * provided implementation.
28118 * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
28119 * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
28120 * See the `lightning-persister` crate for LDK's provided implementation.
28122 * Typically, users should either implement [`Persister::persist_manager`] to never return an
28123 * error or call [`join`] and handle any error that may arise. For the latter case,
28124 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
28128 * `event_handler` is responsible for handling events that users should be notified of (e.g.,
28129 * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
28130 * functionality implemented by other handlers.
28131 * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
28133 * # Rapid Gossip Sync
28135 * If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
28136 * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
28137 * until the [`RapidGossipSync`] instance completes its first sync.
28139 * [top-level documentation]: BackgroundProcessor
28140 * [`join`]: Self::join
28141 * [`stop`]: Self::stop
28142 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
28143 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
28144 * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
28145 * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
28146 * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
28147 * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
28149 * Note that scorer (or a relevant inner pointer) may be NULL or all-0s to represent None
28151 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);
28154 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
28155 * [`ChannelManager`].
28159 * This function panics if the background thread has panicked such as while persisting or
28162 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
28164 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
28167 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
28168 * [`ChannelManager`].
28172 * This function panics if the background thread has panicked such as while persisting or
28175 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
28177 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
28180 * Frees any resources used by the ParseError
28182 void ParseError_free(struct LDKParseError this_ptr);
28185 * Creates a copy of the ParseError
28187 struct LDKParseError ParseError_clone(const struct LDKParseError *NONNULL_PTR orig);
28190 * Utility method to constructs a new Bech32Error-variant ParseError
28192 struct LDKParseError ParseError_bech32_error(struct LDKBech32Error a);
28195 * Utility method to constructs a new ParseAmountError-variant ParseError
28197 struct LDKParseError ParseError_parse_amount_error(struct LDKError a);
28200 * Utility method to constructs a new MalformedSignature-variant ParseError
28202 struct LDKParseError ParseError_malformed_signature(enum LDKSecp256k1Error a);
28205 * Utility method to constructs a new BadPrefix-variant ParseError
28207 struct LDKParseError ParseError_bad_prefix(void);
28210 * Utility method to constructs a new UnknownCurrency-variant ParseError
28212 struct LDKParseError ParseError_unknown_currency(void);
28215 * Utility method to constructs a new UnknownSiPrefix-variant ParseError
28217 struct LDKParseError ParseError_unknown_si_prefix(void);
28220 * Utility method to constructs a new MalformedHRP-variant ParseError
28222 struct LDKParseError ParseError_malformed_hrp(void);
28225 * Utility method to constructs a new TooShortDataPart-variant ParseError
28227 struct LDKParseError ParseError_too_short_data_part(void);
28230 * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant ParseError
28232 struct LDKParseError ParseError_unexpected_end_of_tagged_fields(void);
28235 * Utility method to constructs a new DescriptionDecodeError-variant ParseError
28237 struct LDKParseError ParseError_description_decode_error(struct LDKError a);
28240 * Utility method to constructs a new PaddingError-variant ParseError
28242 struct LDKParseError ParseError_padding_error(void);
28245 * Utility method to constructs a new IntegerOverflowError-variant ParseError
28247 struct LDKParseError ParseError_integer_overflow_error(void);
28250 * Utility method to constructs a new InvalidSegWitProgramLength-variant ParseError
28252 struct LDKParseError ParseError_invalid_seg_wit_program_length(void);
28255 * Utility method to constructs a new InvalidPubKeyHashLength-variant ParseError
28257 struct LDKParseError ParseError_invalid_pub_key_hash_length(void);
28260 * Utility method to constructs a new InvalidScriptHashLength-variant ParseError
28262 struct LDKParseError ParseError_invalid_script_hash_length(void);
28265 * Utility method to constructs a new InvalidRecoveryId-variant ParseError
28267 struct LDKParseError ParseError_invalid_recovery_id(void);
28270 * Utility method to constructs a new InvalidSliceLength-variant ParseError
28272 struct LDKParseError ParseError_invalid_slice_length(struct LDKStr a);
28275 * Utility method to constructs a new Skip-variant ParseError
28277 struct LDKParseError ParseError_skip(void);
28280 * Frees any resources used by the ParseOrSemanticError
28282 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
28285 * Creates a copy of the ParseOrSemanticError
28287 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
28290 * Utility method to constructs a new ParseError-variant ParseOrSemanticError
28292 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKParseError a);
28295 * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
28297 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKSemanticError a);
28300 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
28302 void Invoice_free(struct LDKInvoice this_obj);
28305 * Checks if two Invoices contain equal inner contents.
28306 * This ignores pointers and is_owned flags and looks at the values in fields.
28307 * Two objects with NULL inner values will be considered "equal" here.
28309 bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
28312 * Creates a copy of the Invoice
28314 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
28317 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
28319 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
28322 * Checks if two SignedRawInvoices contain equal inner contents.
28323 * This ignores pointers and is_owned flags and looks at the values in fields.
28324 * Two objects with NULL inner values will be considered "equal" here.
28326 bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
28329 * Creates a copy of the SignedRawInvoice
28331 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
28334 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
28336 void RawInvoice_free(struct LDKRawInvoice this_obj);
28341 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
28346 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
28349 * Checks if two RawInvoices contain equal inner contents.
28350 * This ignores pointers and is_owned flags and looks at the values in fields.
28351 * Two objects with NULL inner values will be considered "equal" here.
28353 bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
28356 * Creates a copy of the RawInvoice
28358 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
28361 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
28363 void RawDataPart_free(struct LDKRawDataPart this_obj);
28366 * generation time of the invoice
28368 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
28371 * generation time of the invoice
28373 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
28376 * Checks if two RawDataParts contain equal inner contents.
28377 * This ignores pointers and is_owned flags and looks at the values in fields.
28378 * Two objects with NULL inner values will be considered "equal" here.
28380 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
28383 * Creates a copy of the RawDataPart
28385 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
28388 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
28390 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
28393 * Checks if two PositiveTimestamps contain equal inner contents.
28394 * This ignores pointers and is_owned flags and looks at the values in fields.
28395 * Two objects with NULL inner values will be considered "equal" here.
28397 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
28400 * Creates a copy of the PositiveTimestamp
28402 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
28405 * Creates a copy of the SiPrefix
28407 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
28410 * Utility method to constructs a new Milli-variant SiPrefix
28412 enum LDKSiPrefix SiPrefix_milli(void);
28415 * Utility method to constructs a new Micro-variant SiPrefix
28417 enum LDKSiPrefix SiPrefix_micro(void);
28420 * Utility method to constructs a new Nano-variant SiPrefix
28422 enum LDKSiPrefix SiPrefix_nano(void);
28425 * Utility method to constructs a new Pico-variant SiPrefix
28427 enum LDKSiPrefix SiPrefix_pico(void);
28430 * Checks if two SiPrefixs contain equal inner contents.
28431 * This ignores pointers and is_owned flags and looks at the values in fields.
28433 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
28436 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
28437 * This is effectively 10^12 * the prefix multiplier
28439 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
28442 * Creates a copy of the Currency
28444 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
28447 * Utility method to constructs a new Bitcoin-variant Currency
28449 enum LDKCurrency Currency_bitcoin(void);
28452 * Utility method to constructs a new BitcoinTestnet-variant Currency
28454 enum LDKCurrency Currency_bitcoin_testnet(void);
28457 * Utility method to constructs a new Regtest-variant Currency
28459 enum LDKCurrency Currency_regtest(void);
28462 * Utility method to constructs a new Simnet-variant Currency
28464 enum LDKCurrency Currency_simnet(void);
28467 * Utility method to constructs a new Signet-variant Currency
28469 enum LDKCurrency Currency_signet(void);
28472 * Checks if two Currencys contain equal inner contents.
28474 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
28477 * Checks if two Currencys contain equal inner contents.
28478 * This ignores pointers and is_owned flags and looks at the values in fields.
28480 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
28483 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
28485 void Sha256_free(struct LDKSha256 this_obj);
28488 * Creates a copy of the Sha256
28490 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
28493 * Checks if two Sha256s contain equal inner contents.
28495 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
28498 * Checks if two Sha256s contain equal inner contents.
28499 * This ignores pointers and is_owned flags and looks at the values in fields.
28500 * Two objects with NULL inner values will be considered "equal" here.
28502 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
28505 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
28507 void Description_free(struct LDKDescription this_obj);
28510 * Creates a copy of the Description
28512 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
28515 * Checks if two Descriptions contain equal inner contents.
28517 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
28520 * Checks if two Descriptions contain equal inner contents.
28521 * This ignores pointers and is_owned flags and looks at the values in fields.
28522 * Two objects with NULL inner values will be considered "equal" here.
28524 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
28527 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
28529 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
28531 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
28533 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28536 * Constructs a new PayeePubKey given each field
28538 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
28541 * Creates a copy of the PayeePubKey
28543 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
28546 * Checks if two PayeePubKeys contain equal inner contents.
28548 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
28551 * Checks if two PayeePubKeys contain equal inner contents.
28552 * This ignores pointers and is_owned flags and looks at the values in fields.
28553 * Two objects with NULL inner values will be considered "equal" here.
28555 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
28558 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
28560 void ExpiryTime_free(struct LDKExpiryTime this_obj);
28563 * Creates a copy of the ExpiryTime
28565 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
28568 * Checks if two ExpiryTimes contain equal inner contents.
28570 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
28573 * Checks if two ExpiryTimes contain equal inner contents.
28574 * This ignores pointers and is_owned flags and looks at the values in fields.
28575 * Two objects with NULL inner values will be considered "equal" here.
28577 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
28580 * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
28582 void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
28584 uint64_t MinFinalCltvExpiry_get_a(const struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr);
28586 void MinFinalCltvExpiry_set_a(struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr, uint64_t val);
28589 * Constructs a new MinFinalCltvExpiry given each field
28591 MUST_USE_RES struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_new(uint64_t a_arg);
28594 * Creates a copy of the MinFinalCltvExpiry
28596 struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
28599 * Checks if two MinFinalCltvExpirys contain equal inner contents.
28601 uint64_t MinFinalCltvExpiry_hash(const struct LDKMinFinalCltvExpiry *NONNULL_PTR o);
28604 * Checks if two MinFinalCltvExpirys contain equal inner contents.
28605 * This ignores pointers and is_owned flags and looks at the values in fields.
28606 * Two objects with NULL inner values will be considered "equal" here.
28608 bool MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b);
28611 * Frees any resources used by the Fallback
28613 void Fallback_free(struct LDKFallback this_ptr);
28616 * Creates a copy of the Fallback
28618 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
28621 * Utility method to constructs a new SegWitProgram-variant Fallback
28623 struct LDKFallback Fallback_seg_wit_program(struct LDKu5 version, struct LDKCVec_u8Z program);
28626 * Utility method to constructs a new PubKeyHash-variant Fallback
28628 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
28631 * Utility method to constructs a new ScriptHash-variant Fallback
28633 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
28636 * Checks if two Fallbacks contain equal inner contents.
28638 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
28641 * Checks if two Fallbacks contain equal inner contents.
28642 * This ignores pointers and is_owned flags and looks at the values in fields.
28644 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
28647 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
28649 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
28652 * Creates a copy of the InvoiceSignature
28654 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
28657 * Checks if two InvoiceSignatures contain equal inner contents.
28658 * This ignores pointers and is_owned flags and looks at the values in fields.
28659 * Two objects with NULL inner values will be considered "equal" here.
28661 bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b);
28664 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
28666 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
28669 * Creates a copy of the PrivateRoute
28671 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
28674 * Checks if two PrivateRoutes contain equal inner contents.
28676 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
28679 * Checks if two PrivateRoutes contain equal inner contents.
28680 * This ignores pointers and is_owned flags and looks at the values in fields.
28681 * Two objects with NULL inner values will be considered "equal" here.
28683 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
28686 * Disassembles the `SignedRawInvoice` into its three parts:
28688 * 2. hash of the raw invoice
28691 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
28694 * The `RawInvoice` which was signed.
28696 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
28699 * The hash of the `RawInvoice` that was signed.
28701 MUST_USE_RES const uint8_t (*SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
28704 * InvoiceSignature for the invoice.
28706 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
28709 * Recovers the public key used for signing the invoice from the recoverable signature.
28711 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
28714 * Checks if the signature is valid for the included payee public key or if none exists if it's
28715 * valid for the recovered signature (which should always be true?).
28717 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
28720 * Calculate the hash of the encoded `RawInvoice`
28722 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28726 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28728 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28732 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28734 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28738 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28740 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28744 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28746 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28750 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28752 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28756 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28758 MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28762 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28764 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28768 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28770 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28772 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawInvoice_private_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28774 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28776 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28779 * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
28781 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
28783 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
28786 * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
28787 * the range `0..=MAX_TIMESTAMP`.
28789 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
28791 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
28794 * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
28795 * `0..=MAX_TIMESTAMP`.
28797 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
28799 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
28802 * Returns the Unix timestamp representing the stored time
28804 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
28807 * Returns the duration of the stored time since the Unix epoch
28809 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
28812 * Returns the [`SystemTime`] representing the stored time
28814 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
28817 * Transform the `Invoice` into it's unchecked version
28819 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
28822 * Check that the invoice is signed correctly and that key recovery works
28824 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
28827 * Constructs an `Invoice` from a `SignedRawInvoice` by checking all its invariants.
28829 * use lightning_invoice::*;
28831 * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
28832 * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
28833 * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
28834 * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
28835 * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
28836 * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
28837 * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
28838 * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
28839 * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
28840 * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
28841 * j5r6drg6k6zcqj0fcwg\";
28843 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
28845 * assert!(Invoice::from_signed(signed).is_ok());
28848 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
28851 * Returns the `Invoice`'s timestamp (should equal its creation time)
28853 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
28856 * Returns the `Invoice`'s timestamp as a duration since the Unix epoch
28858 MUST_USE_RES uint64_t Invoice_duration_since_epoch(const struct LDKInvoice *NONNULL_PTR this_arg);
28861 * Returns the hash to which we will receive the preimage on completion of the payment
28863 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
28866 * Get the payee's public key if one was included in the invoice
28868 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28870 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
28873 * Get the payment secret if one was included in the invoice
28875 MUST_USE_RES const uint8_t (*Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
28878 * Get the invoice features if they were included in the invoice
28880 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28882 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
28885 * Recover the payee's public key (only to be used if none was included in the invoice)
28887 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
28890 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
28892 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
28895 * Returns whether the invoice has expired.
28897 MUST_USE_RES bool Invoice_is_expired(const struct LDKInvoice *NONNULL_PTR this_arg);
28900 * Returns whether the expiry time would pass at the given point in time.
28901 * `at_time` is the timestamp as a duration since the Unix epoch.
28903 MUST_USE_RES bool Invoice_would_expire(const struct LDKInvoice *NONNULL_PTR this_arg, uint64_t at_time);
28906 * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
28907 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
28909 MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
28912 * Returns a list of all routes included in the invoice
28914 MUST_USE_RES struct LDKCVec_PrivateRouteZ Invoice_private_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
28917 * Returns a list of all routes included in the invoice as the underlying hints
28919 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_route_hints(const struct LDKInvoice *NONNULL_PTR this_arg);
28922 * Returns the currency for which the invoice was issued
28924 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
28927 * Returns the amount if specified in the invoice as millisatoshis.
28929 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_milli_satoshis(const struct LDKInvoice *NONNULL_PTR this_arg);
28932 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
28933 * returns `CreationError::DescriptionTooLong` otherwise
28935 * Please note that single characters may use more than one byte due to UTF8 encoding.
28937 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
28940 * Returns the underlying description `String`
28942 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
28945 * Construct an `ExpiryTime` from seconds.
28947 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
28950 * Construct an `ExpiryTime` from a `Duration`.
28952 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
28955 * Returns the expiry time in seconds
28957 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
28960 * Returns a reference to the underlying `Duration` (=expiry time)
28962 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
28965 * Creates a new (partial) route from a list of hops
28967 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
28970 * Returns the underlying list of hops
28972 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
28975 * Creates a copy of the CreationError
28977 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
28980 * Utility method to constructs a new DescriptionTooLong-variant CreationError
28982 enum LDKCreationError CreationError_description_too_long(void);
28985 * Utility method to constructs a new RouteTooLong-variant CreationError
28987 enum LDKCreationError CreationError_route_too_long(void);
28990 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
28992 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
28995 * Utility method to constructs a new InvalidAmount-variant CreationError
28997 enum LDKCreationError CreationError_invalid_amount(void);
29000 * Utility method to constructs a new MissingRouteHints-variant CreationError
29002 enum LDKCreationError CreationError_missing_route_hints(void);
29005 * Checks if two CreationErrors contain equal inner contents.
29006 * This ignores pointers and is_owned flags and looks at the values in fields.
29008 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
29011 * Get the string representation of a CreationError object
29013 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
29016 * Creates a copy of the SemanticError
29018 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
29021 * Utility method to constructs a new NoPaymentHash-variant SemanticError
29023 enum LDKSemanticError SemanticError_no_payment_hash(void);
29026 * Utility method to constructs a new MultiplePaymentHashes-variant SemanticError
29028 enum LDKSemanticError SemanticError_multiple_payment_hashes(void);
29031 * Utility method to constructs a new NoDescription-variant SemanticError
29033 enum LDKSemanticError SemanticError_no_description(void);
29036 * Utility method to constructs a new MultipleDescriptions-variant SemanticError
29038 enum LDKSemanticError SemanticError_multiple_descriptions(void);
29041 * Utility method to constructs a new NoPaymentSecret-variant SemanticError
29043 enum LDKSemanticError SemanticError_no_payment_secret(void);
29046 * Utility method to constructs a new MultiplePaymentSecrets-variant SemanticError
29048 enum LDKSemanticError SemanticError_multiple_payment_secrets(void);
29051 * Utility method to constructs a new InvalidFeatures-variant SemanticError
29053 enum LDKSemanticError SemanticError_invalid_features(void);
29056 * Utility method to constructs a new InvalidRecoveryId-variant SemanticError
29058 enum LDKSemanticError SemanticError_invalid_recovery_id(void);
29061 * Utility method to constructs a new InvalidSignature-variant SemanticError
29063 enum LDKSemanticError SemanticError_invalid_signature(void);
29066 * Utility method to constructs a new ImpreciseAmount-variant SemanticError
29068 enum LDKSemanticError SemanticError_imprecise_amount(void);
29071 * Checks if two SemanticErrors contain equal inner contents.
29072 * This ignores pointers and is_owned flags and looks at the values in fields.
29074 bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
29077 * Get the string representation of a SemanticError object
29079 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
29082 * Frees any resources used by the SignOrCreationError
29084 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
29087 * Creates a copy of the SignOrCreationError
29089 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
29092 * Utility method to constructs a new SignError-variant SignOrCreationError
29094 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
29097 * Utility method to constructs a new CreationError-variant SignOrCreationError
29099 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
29102 * Checks if two SignOrCreationErrors contain equal inner contents.
29103 * This ignores pointers and is_owned flags and looks at the values in fields.
29105 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
29108 * Get the string representation of a SignOrCreationError object
29110 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
29113 * Frees any resources used by the InvoicePayer, if is_owned is set and inner is non-NULL.
29115 void InvoicePayer_free(struct LDKInvoicePayer this_obj);
29118 * Calls the free function if one is set
29120 void Payer_free(struct LDKPayer this_ptr);
29123 * Calls the free function if one is set
29125 void Router_free(struct LDKRouter this_ptr);
29128 * Frees any resources used by the Retry
29130 void Retry_free(struct LDKRetry this_ptr);
29133 * Creates a copy of the Retry
29135 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
29138 * Utility method to constructs a new Attempts-variant Retry
29140 struct LDKRetry Retry_attempts(uintptr_t a);
29143 * Utility method to constructs a new Timeout-variant Retry
29145 struct LDKRetry Retry_timeout(uint64_t a);
29148 * Checks if two Retrys contain equal inner contents.
29149 * This ignores pointers and is_owned flags and looks at the values in fields.
29151 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
29154 * Checks if two Retrys contain equal inner contents.
29156 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
29159 * Frees any resources used by the PaymentError
29161 void PaymentError_free(struct LDKPaymentError this_ptr);
29164 * Creates a copy of the PaymentError
29166 struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
29169 * Utility method to constructs a new Invoice-variant PaymentError
29171 struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
29174 * Utility method to constructs a new Routing-variant PaymentError
29176 struct LDKPaymentError PaymentError_routing(struct LDKLightningError a);
29179 * Utility method to constructs a new Sending-variant PaymentError
29181 struct LDKPaymentError PaymentError_sending(struct LDKPaymentSendFailure a);
29184 * Creates an invoice payer that retries failed payment paths.
29186 * Will forward any [`Event::PaymentPathFailed`] events to the decorated `event_handler` once
29187 * `retry` has been exceeded for a given [`Invoice`].
29189 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);
29192 * Pays the given [`Invoice`], caching it for later use in case a retry is needed.
29194 * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
29195 * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
29198 MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice);
29201 * Pays the given zero-value [`Invoice`] using the given amount, caching it for later use in
29202 * case a retry is needed.
29204 * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
29205 * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
29208 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);
29211 * Pays `pubkey` an amount using the hash of the given preimage, caching it for later use in
29212 * case a retry is needed.
29214 * You should ensure that `payment_preimage` is unique and that its `payment_hash` has never
29215 * been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so for you.
29217 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);
29220 * Removes the payment cached by the given payment hash.
29222 * Should be called once a payment has failed or succeeded if not using [`InvoicePayer`] as an
29223 * [`EventHandler`]. Otherwise, calling this method is unnecessary.
29225 void InvoicePayer_remove_cached_payment(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
29228 * Constructs a new EventHandler which calls the relevant methods on this_arg.
29229 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
29231 struct LDKEventHandler InvoicePayer_as_EventHandler(const struct LDKInvoicePayer *NONNULL_PTR this_arg);
29234 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
29235 * See [`PhantomKeysManager`] for more information on phantom node payments.
29237 * `phantom_route_hints` parameter:
29238 * * Contains channel info for all nodes participating in the phantom invoice
29239 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
29240 * participating node
29241 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
29242 * updated when a channel becomes disabled or closes
29243 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
29244 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
29247 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
29248 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
29249 * If `None` is provided for `payment_hash`, then one will be created.
29251 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
29252 * in excess of the current time.
29254 * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom
29255 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
29258 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
29259 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
29260 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
29261 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
29262 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
29264 * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
29266 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);
29269 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
29270 * See [`PhantomKeysManager`] for more information on phantom node payments.
29272 * `phantom_route_hints` parameter:
29273 * * Contains channel info for all nodes participating in the phantom invoice
29274 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
29275 * participating node
29276 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
29277 * updated when a channel becomes disabled or closes
29278 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
29279 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
29282 * `description_hash` is a SHA-256 hash of the description text
29284 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
29285 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
29286 * If `None` is provided for `payment_hash`, then one will be created.
29288 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
29289 * in excess of the current time.
29291 * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom
29292 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
29295 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
29296 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
29297 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
29298 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
29299 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
29301 * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
29303 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);
29306 * Utility to construct an invoice. Generally, unless you want to do something like a custom
29307 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
29308 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
29309 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
29310 * that the payment secret is valid when the invoice is paid.
29312 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
29313 * in excess of the current time.
29315 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);
29318 * Utility to construct an invoice. Generally, unless you want to do something like a custom
29319 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
29320 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
29321 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
29322 * that the payment secret is valid when the invoice is paid.
29323 * Use this variant if you want to pass the `description_hash` to the invoice.
29325 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
29326 * in excess of the current time.
29328 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);
29331 * See [`create_invoice_from_channelmanager_with_description_hash`]
29332 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
29333 * available and the current time is supplied by the caller.
29335 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);
29338 * See [`create_invoice_from_channelmanager`]
29339 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
29340 * available and the current time is supplied by the caller.
29342 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);
29345 * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
29347 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
29350 * Creates a new router using the given [`NetworkGraph`], a [`Logger`], and a randomness source
29351 * `random_seed_bytes`.
29353 MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKThirtyTwoBytes random_seed_bytes);
29356 * Constructs a new Router which calls the relevant methods on this_arg.
29357 * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
29359 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
29362 * Constructs a new Payer which calls the relevant methods on this_arg.
29363 * This copies the `inner` pointer in this_arg and thus the returned Payer must be freed before this_arg is
29365 struct LDKPayer ChannelManager_as_Payer(const struct LDKChannelManager *NONNULL_PTR this_arg);
29368 * Read a SiPrefix object from a string
29370 struct LDKCResult_SiPrefixParseErrorZ SiPrefix_from_str(struct LDKStr s);
29373 * Read a Invoice object from a string
29375 struct LDKCResult_InvoiceParseOrSemanticErrorZ Invoice_from_str(struct LDKStr s);
29378 * Read a SignedRawInvoice object from a string
29380 struct LDKCResult_SignedRawInvoiceParseErrorZ SignedRawInvoice_from_str(struct LDKStr s);
29383 * Get the string representation of a ParseError object
29385 struct LDKStr ParseError_to_str(const struct LDKParseError *NONNULL_PTR o);
29388 * Get the string representation of a ParseOrSemanticError object
29390 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
29393 * Get the string representation of a Invoice object
29395 struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o);
29398 * Get the string representation of a SignedRawInvoice object
29400 struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o);
29403 * Get the string representation of a Currency object
29405 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
29408 * Get the string representation of a SiPrefix object
29410 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
29413 * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
29415 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
29418 * Instantiate a new [`RapidGossipSync`] instance
29420 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph);
29423 * Sync gossip data from a file
29424 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
29426 * `network_graph`: The network graph to apply the updates to
29428 * `sync_path`: Path to the file where the gossip update data is located
29431 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path);
29434 * Returns whether a rapid gossip sync has completed at least once
29436 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
29439 * Frees any resources used by the GraphSyncError
29441 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
29444 * Creates a copy of the GraphSyncError
29446 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
29449 * Utility method to constructs a new DecodeError-variant GraphSyncError
29451 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
29454 * Utility method to constructs a new LightningError-variant GraphSyncError
29456 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
29459 * Update network graph from binary data.
29460 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
29462 * `network_graph`: network graph to be updated
29464 * `update_data`: `&[u8]` binary stream that comprises the update data
29466 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
29468 #endif /* LDK_C_BINDINGS_H */
29470 #include "ldk_ver.h"