1 #ifndef LDK_C_BINDINGS_H
2 #define LDK_C_BINDINGS_H
4 /* Generated with cbindgen:0.20.0 */
6 /* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */
11 #include "ldk_rust_types.h"
14 * An error when accessing the chain via [`Access`].
16 typedef enum LDKAccessError {
18 * The requested chain is unknown.
20 LDKAccessError_UnknownChain,
22 * The requested transaction doesn't exist or hasn't confirmed.
24 LDKAccessError_UnknownTx,
26 * Must be last for serialization purposes
28 LDKAccessError_Sentinel,
32 * An enum which can either contain a or not
34 typedef enum LDKCOption_NoneZ {
36 * When we're in this state, this COption_NoneZ contains a
38 LDKCOption_NoneZ_Some,
40 * When we're in this state, this COption_NoneZ contains nothing
42 LDKCOption_NoneZ_None,
44 * Must be last for serialization purposes
46 LDKCOption_NoneZ_Sentinel,
50 * An error enum representing a failure to persist a channel monitor update.
52 typedef enum LDKChannelMonitorUpdateErr {
54 * Used to indicate a temporary failure (eg connection to a watchtower or remote backup of
55 * our state failed, but is expected to succeed at some point in the future).
57 * Such a failure will \"freeze\" a channel, preventing us from revoking old states or
58 * submitting new commitment transactions to the counterparty. Once the update(s) that failed
59 * have been successfully applied, a [`MonitorEvent::UpdateCompleted`] event should be returned
60 * via [`Watch::release_pending_monitor_events`] which will then restore the channel to an
63 * Note that a given ChannelManager will *never* re-generate a given ChannelMonitorUpdate. If
64 * you return a TemporaryFailure you must ensure that it is written to disk safely before
65 * writing out the latest ChannelManager state.
67 * Even when a channel has been \"frozen\" updates to the ChannelMonitor can continue to occur
68 * (eg if an inbound HTLC which we forwarded was claimed upstream resulting in us attempting
69 * to claim it on this channel) and those updates must be applied wherever they can be. At
70 * least one such updated ChannelMonitor must be persisted otherwise PermanentFailure should
71 * be returned to get things on-chain ASAP using only the in-memory copy. Obviously updates to
72 * the channel which would invalidate previous ChannelMonitors are not made when a channel has
75 * Note that even if updates made after TemporaryFailure succeed you must still provide a
76 * [`MonitorEvent::UpdateCompleted`] to ensure you have the latest monitor and re-enable
77 * normal channel operation. Note that this is normally generated through a call to
78 * [`ChainMonitor::channel_monitor_updated`].
80 * Note that the update being processed here will not be replayed for you when you return a
81 * [`MonitorEvent::UpdateCompleted`] event via [`Watch::release_pending_monitor_events`], so
82 * you must store the update itself on your own local disk prior to returning a
83 * TemporaryFailure. You may, of course, employ a journaling approach, storing only the
84 * ChannelMonitorUpdate on disk without updating the monitor itself, replaying the journal at
87 * For deployments where a copy of ChannelMonitors and other local state are backed up in a
88 * remote location (with local copies persisted immediately), it is anticipated that all
89 * updates will return TemporaryFailure until the remote copies could be updated.
91 * [`ChainMonitor::channel_monitor_updated`]: chainmonitor::ChainMonitor::channel_monitor_updated
93 LDKChannelMonitorUpdateErr_TemporaryFailure,
95 * Used to indicate no further channel monitor updates will be allowed (eg we've moved on to a
96 * different watchtower and cannot update with all watchtowers that were previously informed
99 * At reception of this error, ChannelManager will force-close the channel and return at
100 * least a final ChannelMonitorUpdate::ChannelForceClosed which must be delivered to at
101 * least one ChannelMonitor copy. Revocation secret MUST NOT be released and offchain channel
102 * update must be rejected.
104 * This failure may also signal a failure to update the local persisted copy of one of
105 * the channel monitor instance.
107 * Note that even when you fail a holder commitment transaction update, you must store the
108 * update to ensure you can claim from it in case of a duplicate copy of this ChannelMonitor
109 * broadcasts it (e.g distributed channel-monitor deployment)
111 * In case of distributed watchtowers deployment, the new version must be written to disk, as
112 * state may have been stored but rejected due to a block forcing a commitment broadcast. This
113 * storage is used to claim outputs of rejected state confirmed onchain by another watchtower,
114 * lagging behind on block processing.
116 LDKChannelMonitorUpdateErr_PermanentFailure,
118 * Must be last for serialization purposes
120 LDKChannelMonitorUpdateErr_Sentinel,
121 } LDKChannelMonitorUpdateErr;
124 * An enum that represents the speed at which we want a transaction to confirm used for feerate
127 typedef enum LDKConfirmationTarget {
129 * We are happy with this transaction confirming slowly when feerate drops some.
131 LDKConfirmationTarget_Background,
133 * We'd like this transaction to confirm without major delay, but 12-18 blocks is fine.
135 LDKConfirmationTarget_Normal,
137 * We'd like this transaction to confirm in the next few blocks.
139 LDKConfirmationTarget_HighPriority,
141 * Must be last for serialization purposes
143 LDKConfirmationTarget_Sentinel,
144 } LDKConfirmationTarget;
147 * Errors that may occur when constructing a new `RawInvoice` or `Invoice`
149 typedef enum LDKCreationError {
151 * The supplied description string was longer than 639 __bytes__ (see [`Description::new(…)`](./struct.Description.html#method.new))
153 LDKCreationError_DescriptionTooLong,
155 * The specified route has too many hops and can't be encoded
157 LDKCreationError_RouteTooLong,
159 * The Unix timestamp of the supplied date is less than zero or greater than 35-bits
161 LDKCreationError_TimestampOutOfBounds,
163 * The supplied millisatoshi amount was greater than the total bitcoin supply.
165 LDKCreationError_InvalidAmount,
167 * Route hints were required for this invoice and were missing. Applies to
168 * [phantom invoices].
170 * [phantom invoices]: crate::utils::create_phantom_invoice
172 LDKCreationError_MissingRouteHints,
174 * Must be last for serialization purposes
176 LDKCreationError_Sentinel,
180 * Enum representing the crypto currencies (or networks) supported by this library
182 typedef enum LDKCurrency {
190 LDKCurrency_BitcoinTestnet,
204 * Must be last for serialization purposes
206 LDKCurrency_Sentinel,
210 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
212 typedef enum LDKIOError {
214 LDKIOError_PermissionDenied,
215 LDKIOError_ConnectionRefused,
216 LDKIOError_ConnectionReset,
217 LDKIOError_ConnectionAborted,
218 LDKIOError_NotConnected,
219 LDKIOError_AddrInUse,
220 LDKIOError_AddrNotAvailable,
221 LDKIOError_BrokenPipe,
222 LDKIOError_AlreadyExists,
223 LDKIOError_WouldBlock,
224 LDKIOError_InvalidInput,
225 LDKIOError_InvalidData,
227 LDKIOError_WriteZero,
228 LDKIOError_Interrupted,
230 LDKIOError_UnexpectedEof,
232 * Must be last for serialization purposes
238 * An enum representing the available verbosity levels of the logger.
240 typedef enum LDKLevel {
242 * Designates extremely verbose information, including gossip-induced messages
246 * Designates very low priority, often extremely verbose, information
250 * Designates lower priority information
254 * Designates useful information
258 * Designates hazardous situations
262 * Designates very serious errors
266 * Must be last for serialization purposes
272 * An enum representing the possible Bitcoin or test networks which we can run on
274 typedef enum LDKNetwork {
276 * The main Bitcoin blockchain.
280 * The testnet3 blockchain.
284 * A local test blockchain.
288 * A blockchain on which blocks are signed instead of mined.
292 * Must be last for serialization purposes
298 * Specifies the recipient of an invoice, to indicate to [`KeysInterface::sign_invoice`] what node
299 * secret key should be used to sign the invoice.
301 typedef enum LDKRecipient {
303 * The invoice should be signed with the local node secret key.
307 * The invoice should be signed with the phantom node secret key. This secret key must be the
308 * same for all nodes participating in the [phantom node payment].
310 * [phantom node payment]: PhantomKeysManager
312 LDKRecipient_PhantomNode,
314 * Must be last for serialization purposes
316 LDKRecipient_Sentinel,
320 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
322 typedef enum LDKSecp256k1Error {
324 * Signature failed verification
326 LDKSecp256k1Error_IncorrectSignature,
328 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
330 LDKSecp256k1Error_InvalidMessage,
334 LDKSecp256k1Error_InvalidPublicKey,
338 LDKSecp256k1Error_InvalidSignature,
342 LDKSecp256k1Error_InvalidSecretKey,
346 LDKSecp256k1Error_InvalidSharedSecret,
350 LDKSecp256k1Error_InvalidRecoveryId,
352 * Invalid tweak for add_assign or mul_assign
354 LDKSecp256k1Error_InvalidTweak,
356 * Didn't pass enough memory to context creation with preallocated memory
358 LDKSecp256k1Error_NotEnoughMemory,
360 * Bad set of public keys.
362 LDKSecp256k1Error_InvalidPublicKeySum,
364 * The only valid parity values are 0 or 1.
366 LDKSecp256k1Error_InvalidParityValue,
368 * Must be last for serialization purposes
370 LDKSecp256k1Error_Sentinel,
374 * Errors that may occur when converting a `RawInvoice` to an `Invoice`. They relate to the
375 * requirements sections in BOLT #11
377 typedef enum LDKSemanticError {
379 * The invoice is missing the mandatory payment hash
381 LDKSemanticError_NoPaymentHash,
383 * The invoice has multiple payment hashes which isn't allowed
385 LDKSemanticError_MultiplePaymentHashes,
387 * No description or description hash are part of the invoice
389 LDKSemanticError_NoDescription,
391 * The invoice contains multiple descriptions and/or description hashes which isn't allowed
393 LDKSemanticError_MultipleDescriptions,
395 * The invoice is missing the mandatory payment secret, which all modern lightning nodes
398 LDKSemanticError_NoPaymentSecret,
400 * The invoice contains multiple payment secrets
402 LDKSemanticError_MultiplePaymentSecrets,
404 * The invoice's features are invalid
406 LDKSemanticError_InvalidFeatures,
408 * The recovery id doesn't fit the signature/pub key
410 LDKSemanticError_InvalidRecoveryId,
412 * The invoice's signature is invalid
414 LDKSemanticError_InvalidSignature,
416 * The invoice's amount was not a whole number of millisatoshis
418 LDKSemanticError_ImpreciseAmount,
420 * Must be last for serialization purposes
422 LDKSemanticError_Sentinel,
426 * SI prefixes for the human readable part
428 typedef enum LDKSiPrefix {
446 * Must be last for serialization purposes
448 LDKSiPrefix_Sentinel,
452 * A Rust str object, ie a reference to a UTF8-valid string.
453 * This is *not* null-terminated so cannot be used directly as a C string!
455 typedef struct LDKStr {
457 * A pointer to the string's bytes, in UTF8 encoding
459 const uint8_t *chars;
461 * The number of bytes (not characters!) pointed to by `chars`
465 * Whether the data pointed to by `chars` should be freed or not.
471 * Represents an error returned from the bech32 library during validation of some bech32 data
473 typedef enum LDKBech32Error_Tag {
475 * String does not contain the separator character
477 LDKBech32Error_MissingSeparator,
479 * The checksum does not match the rest of the data
481 LDKBech32Error_InvalidChecksum,
483 * The data or human-readable part is too long or too short
485 LDKBech32Error_InvalidLength,
487 * Some part of the string contains an invalid character
489 LDKBech32Error_InvalidChar,
491 * Some part of the data has an invalid value
493 LDKBech32Error_InvalidData,
495 * The bit conversion failed due to a padding issue
497 LDKBech32Error_InvalidPadding,
499 * The whole string must be of one case
501 LDKBech32Error_MixedCase,
503 * Must be last for serialization purposes
505 LDKBech32Error_Sentinel,
506 } LDKBech32Error_Tag;
508 typedef struct LDKBech32Error {
509 LDKBech32Error_Tag tag;
512 uint32_t invalid_char;
515 uint8_t invalid_data;
521 * A serialized transaction, in (pointer, length) form.
523 * This type optionally owns its own memory, and thus the semantics around access change based on
524 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
525 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
526 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
527 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
528 * you would be invalid.
530 * Note that, while it may change in the future, because transactions on the Rust side are stored
531 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
532 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
533 * `data_is_owned` either set or unset at your discretion.
535 typedef struct LDKTransaction {
537 * The serialized transaction data.
539 * This is non-const for your convenience, an object passed to Rust is never written to.
543 * The length of the serialized transaction
547 * Whether the data pointed to by `data` should be freed or not.
553 * A dynamically-allocated array of u8s of arbitrary size.
554 * This corresponds to std::vector in C++
556 typedef struct LDKCVec_u8Z {
558 * The elements in the array.
559 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
563 * The number of elements pointed to by `data`.
569 * A transaction output including a scriptPubKey and value.
570 * This type *does* own its own memory, so must be free'd appropriately.
572 typedef struct LDKTxOut {
574 * The script_pubkey in this output
576 struct LDKCVec_u8Z script_pubkey;
578 * The value, in satoshis, of this output
584 * The contents of CResult_NoneNoneZ
586 typedef union LDKCResult_NoneNoneZPtr {
588 * Note that this value is always NULL, as there are no contents in the OK variant
592 * Note that this value is always NULL, as there are no contents in the Err variant
595 } LDKCResult_NoneNoneZPtr;
598 * A CResult_NoneNoneZ represents the result of a fallible operation,
599 * containing a () on success and a () on failure.
600 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
602 typedef struct LDKCResult_NoneNoneZ {
604 * The contents of this CResult_NoneNoneZ, accessible via either
605 * `err` or `result` depending on the state of `result_ok`.
607 union LDKCResult_NoneNoneZPtr contents;
609 * Whether this CResult_NoneNoneZ represents a success state.
612 } LDKCResult_NoneNoneZ;
617 * Implements the per-commitment secret storage scheme from
618 * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
620 * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
623 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
625 * A pointer to the opaque Rust object.
626 * Nearly everywhere, inner must be non-null, however in places where
627 * the Rust equivalent takes an Option, it may be set to null to indicate None.
629 LDKnativeCounterpartyCommitmentSecrets *inner;
631 * Indicates that this is the only struct which contains the same pointer.
632 * Rust functions which take ownership of an object provided via an argument require
633 * this to be true and invalidate the object pointed to by inner.
636 } LDKCounterpartyCommitmentSecrets;
641 * An error in decoding a message or struct.
643 typedef struct MUST_USE_STRUCT LDKDecodeError {
645 * A pointer to the opaque Rust object.
646 * Nearly everywhere, inner must be non-null, however in places where
647 * the Rust equivalent takes an Option, it may be set to null to indicate None.
649 LDKnativeDecodeError *inner;
651 * Indicates that this is the only struct which contains the same pointer.
652 * Rust functions which take ownership of an object provided via an argument require
653 * this to be true and invalidate the object pointed to by inner.
659 * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
661 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
663 * A pointer to the contents in the success state.
664 * Reading from this pointer when `result_ok` is not set is undefined.
666 struct LDKCounterpartyCommitmentSecrets *result;
668 * A pointer to the contents in the error state.
669 * Reading from this pointer when `result_ok` is set is undefined.
671 struct LDKDecodeError *err;
672 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
675 * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
676 * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
677 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
679 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
681 * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
682 * `err` or `result` depending on the state of `result_ok`.
684 union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
686 * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
689 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
692 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
694 typedef struct LDKSecretKey {
696 * The bytes of the secret key
702 * The contents of CResult_SecretKeyErrorZ
704 typedef union LDKCResult_SecretKeyErrorZPtr {
706 * A pointer to the contents in the success state.
707 * Reading from this pointer when `result_ok` is not set is undefined.
709 struct LDKSecretKey *result;
711 * A pointer to the contents in the error state.
712 * Reading from this pointer when `result_ok` is set is undefined.
714 enum LDKSecp256k1Error *err;
715 } LDKCResult_SecretKeyErrorZPtr;
718 * A CResult_SecretKeyErrorZ represents the result of a fallible operation,
719 * containing a crate::c_types::SecretKey on success and a crate::c_types::Secp256k1Error on failure.
720 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
722 typedef struct LDKCResult_SecretKeyErrorZ {
724 * The contents of this CResult_SecretKeyErrorZ, accessible via either
725 * `err` or `result` depending on the state of `result_ok`.
727 union LDKCResult_SecretKeyErrorZPtr contents;
729 * Whether this CResult_SecretKeyErrorZ represents a success state.
732 } LDKCResult_SecretKeyErrorZ;
735 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
737 typedef struct LDKPublicKey {
739 * The bytes of the public key
741 uint8_t compressed_form[33];
745 * The contents of CResult_PublicKeyErrorZ
747 typedef union LDKCResult_PublicKeyErrorZPtr {
749 * A pointer to the contents in the success state.
750 * Reading from this pointer when `result_ok` is not set is undefined.
752 struct LDKPublicKey *result;
754 * A pointer to the contents in the error state.
755 * Reading from this pointer when `result_ok` is set is undefined.
757 enum LDKSecp256k1Error *err;
758 } LDKCResult_PublicKeyErrorZPtr;
761 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
762 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
763 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
765 typedef struct LDKCResult_PublicKeyErrorZ {
767 * The contents of this CResult_PublicKeyErrorZ, accessible via either
768 * `err` or `result` depending on the state of `result_ok`.
770 union LDKCResult_PublicKeyErrorZPtr contents;
772 * Whether this CResult_PublicKeyErrorZ represents a success state.
775 } LDKCResult_PublicKeyErrorZ;
780 * The set of public keys which are used in the creation of one commitment transaction.
781 * These are derived from the channel base keys and per-commitment data.
783 * A broadcaster key is provided from potential broadcaster of the computed transaction.
784 * A countersignatory key is coming from a protocol participant unable to broadcast the
787 * These keys are assumed to be good, either because the code derived them from
788 * channel basepoints via the new function, or they were obtained via
789 * CommitmentTransaction.trust().keys() because we trusted the source of the
790 * pre-calculated keys.
792 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
794 * A pointer to the opaque Rust object.
795 * Nearly everywhere, inner must be non-null, however in places where
796 * the Rust equivalent takes an Option, it may be set to null to indicate None.
798 LDKnativeTxCreationKeys *inner;
800 * Indicates that this is the only struct which contains the same pointer.
801 * Rust functions which take ownership of an object provided via an argument require
802 * this to be true and invalidate the object pointed to by inner.
808 * The contents of CResult_TxCreationKeysDecodeErrorZ
810 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
812 * A pointer to the contents in the success state.
813 * Reading from this pointer when `result_ok` is not set is undefined.
815 struct LDKTxCreationKeys *result;
817 * A pointer to the contents in the error state.
818 * Reading from this pointer when `result_ok` is set is undefined.
820 struct LDKDecodeError *err;
821 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
824 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
825 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
826 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
828 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
830 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
831 * `err` or `result` depending on the state of `result_ok`.
833 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
835 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
838 } LDKCResult_TxCreationKeysDecodeErrorZ;
843 * One counterparty's public keys which do not change over the life of a channel.
845 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
847 * A pointer to the opaque Rust object.
848 * Nearly everywhere, inner must be non-null, however in places where
849 * the Rust equivalent takes an Option, it may be set to null to indicate None.
851 LDKnativeChannelPublicKeys *inner;
853 * Indicates that this is the only struct which contains the same pointer.
854 * Rust functions which take ownership of an object provided via an argument require
855 * this to be true and invalidate the object pointed to by inner.
858 } LDKChannelPublicKeys;
861 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
863 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
865 * A pointer to the contents in the success state.
866 * Reading from this pointer when `result_ok` is not set is undefined.
868 struct LDKChannelPublicKeys *result;
870 * A pointer to the contents in the error state.
871 * Reading from this pointer when `result_ok` is set is undefined.
873 struct LDKDecodeError *err;
874 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
877 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
878 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
879 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
881 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
883 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
884 * `err` or `result` depending on the state of `result_ok`.
886 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
888 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
891 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
894 * The contents of CResult_TxCreationKeysErrorZ
896 typedef union LDKCResult_TxCreationKeysErrorZPtr {
898 * A pointer to the contents in the success state.
899 * Reading from this pointer when `result_ok` is not set is undefined.
901 struct LDKTxCreationKeys *result;
903 * A pointer to the contents in the error state.
904 * Reading from this pointer when `result_ok` is set is undefined.
906 enum LDKSecp256k1Error *err;
907 } LDKCResult_TxCreationKeysErrorZPtr;
910 * A CResult_TxCreationKeysErrorZ represents the result of a fallible operation,
911 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::c_types::Secp256k1Error on failure.
912 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
914 typedef struct LDKCResult_TxCreationKeysErrorZ {
916 * The contents of this CResult_TxCreationKeysErrorZ, accessible via either
917 * `err` or `result` depending on the state of `result_ok`.
919 union LDKCResult_TxCreationKeysErrorZPtr contents;
921 * Whether this CResult_TxCreationKeysErrorZ represents a success state.
924 } LDKCResult_TxCreationKeysErrorZ;
927 * An enum which can either contain a u32 or not
929 typedef enum LDKCOption_u32Z_Tag {
931 * When we're in this state, this COption_u32Z contains a u32
933 LDKCOption_u32Z_Some,
935 * When we're in this state, this COption_u32Z contains nothing
937 LDKCOption_u32Z_None,
939 * Must be last for serialization purposes
941 LDKCOption_u32Z_Sentinel,
942 } LDKCOption_u32Z_Tag;
944 typedef struct LDKCOption_u32Z {
945 LDKCOption_u32Z_Tag tag;
956 * Information about an HTLC as it appears in a commitment transaction
958 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
960 * A pointer to the opaque Rust object.
961 * Nearly everywhere, inner must be non-null, however in places where
962 * the Rust equivalent takes an Option, it may be set to null to indicate None.
964 LDKnativeHTLCOutputInCommitment *inner;
966 * Indicates that this is the only struct which contains the same pointer.
967 * Rust functions which take ownership of an object provided via an argument require
968 * this to be true and invalidate the object pointed to by inner.
971 } LDKHTLCOutputInCommitment;
974 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
976 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
978 * A pointer to the contents in the success state.
979 * Reading from this pointer when `result_ok` is not set is undefined.
981 struct LDKHTLCOutputInCommitment *result;
983 * A pointer to the contents in the error state.
984 * Reading from this pointer when `result_ok` is set is undefined.
986 struct LDKDecodeError *err;
987 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
990 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
991 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
992 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
994 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
996 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
997 * `err` or `result` depending on the state of `result_ok`.
999 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
1001 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
1004 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
1009 * Late-bound per-channel counterparty data used to build transactions.
1011 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
1013 * A pointer to the opaque Rust object.
1014 * Nearly everywhere, inner must be non-null, however in places where
1015 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1017 LDKnativeCounterpartyChannelTransactionParameters *inner;
1019 * Indicates that this is the only struct which contains the same pointer.
1020 * Rust functions which take ownership of an object provided via an argument require
1021 * this to be true and invalidate the object pointed to by inner.
1024 } LDKCounterpartyChannelTransactionParameters;
1027 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
1029 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
1031 * A pointer to the contents in the success state.
1032 * Reading from this pointer when `result_ok` is not set is undefined.
1034 struct LDKCounterpartyChannelTransactionParameters *result;
1036 * A pointer to the contents in the error state.
1037 * Reading from this pointer when `result_ok` is set is undefined.
1039 struct LDKDecodeError *err;
1040 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
1043 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
1044 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1045 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1047 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
1049 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
1050 * `err` or `result` depending on the state of `result_ok`.
1052 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
1054 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
1057 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
1062 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
1063 * The fields are organized by holder/counterparty.
1065 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
1066 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
1068 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
1070 * A pointer to the opaque Rust object.
1071 * Nearly everywhere, inner must be non-null, however in places where
1072 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1074 LDKnativeChannelTransactionParameters *inner;
1076 * Indicates that this is the only struct which contains the same pointer.
1077 * Rust functions which take ownership of an object provided via an argument require
1078 * this to be true and invalidate the object pointed to by inner.
1081 } LDKChannelTransactionParameters;
1084 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
1086 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
1088 * A pointer to the contents in the success state.
1089 * Reading from this pointer when `result_ok` is not set is undefined.
1091 struct LDKChannelTransactionParameters *result;
1093 * A pointer to the contents in the error state.
1094 * Reading from this pointer when `result_ok` is set is undefined.
1096 struct LDKDecodeError *err;
1097 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
1100 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
1101 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1102 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1104 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
1106 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
1107 * `err` or `result` depending on the state of `result_ok`.
1109 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
1111 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
1114 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
1117 * Represents a secp256k1 signature serialized as two 32-byte numbers
1119 typedef struct LDKSignature {
1121 * The bytes of the signature in "compact" form
1123 uint8_t compact_form[64];
1127 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
1128 * This corresponds to std::vector in C++
1130 typedef struct LDKCVec_SignatureZ {
1132 * The elements in the array.
1133 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1135 struct LDKSignature *data;
1137 * The number of elements pointed to by `data`.
1140 } LDKCVec_SignatureZ;
1145 * Information needed to build and sign a holder's commitment transaction.
1147 * The transaction is only signed once we are ready to broadcast.
1149 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
1151 * A pointer to the opaque Rust object.
1152 * Nearly everywhere, inner must be non-null, however in places where
1153 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1155 LDKnativeHolderCommitmentTransaction *inner;
1157 * Indicates that this is the only struct which contains the same pointer.
1158 * Rust functions which take ownership of an object provided via an argument require
1159 * this to be true and invalidate the object pointed to by inner.
1162 } LDKHolderCommitmentTransaction;
1165 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
1167 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
1169 * A pointer to the contents in the success state.
1170 * Reading from this pointer when `result_ok` is not set is undefined.
1172 struct LDKHolderCommitmentTransaction *result;
1174 * A pointer to the contents in the error state.
1175 * Reading from this pointer when `result_ok` is set is undefined.
1177 struct LDKDecodeError *err;
1178 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
1181 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1182 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1183 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1185 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
1187 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
1188 * `err` or `result` depending on the state of `result_ok`.
1190 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
1192 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
1195 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
1200 * A pre-built Bitcoin commitment transaction and its txid.
1202 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
1204 * A pointer to the opaque Rust object.
1205 * Nearly everywhere, inner must be non-null, however in places where
1206 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1208 LDKnativeBuiltCommitmentTransaction *inner;
1210 * Indicates that this is the only struct which contains the same pointer.
1211 * Rust functions which take ownership of an object provided via an argument require
1212 * this to be true and invalidate the object pointed to by inner.
1215 } LDKBuiltCommitmentTransaction;
1218 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
1220 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
1222 * A pointer to the contents in the success state.
1223 * Reading from this pointer when `result_ok` is not set is undefined.
1225 struct LDKBuiltCommitmentTransaction *result;
1227 * A pointer to the contents in the error state.
1228 * Reading from this pointer when `result_ok` is set is undefined.
1230 struct LDKDecodeError *err;
1231 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
1234 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1235 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1236 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1238 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
1240 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
1241 * `err` or `result` depending on the state of `result_ok`.
1243 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
1245 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
1248 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
1253 * A wrapper on ClosingTransaction indicating that the built bitcoin
1254 * transaction is trusted.
1256 * See trust() and verify() functions on CommitmentTransaction.
1258 * This structure implements Deref.
1260 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
1262 * A pointer to the opaque Rust object.
1263 * Nearly everywhere, inner must be non-null, however in places where
1264 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1266 LDKnativeTrustedClosingTransaction *inner;
1268 * Indicates that this is the only struct which contains the same pointer.
1269 * Rust functions which take ownership of an object provided via an argument require
1270 * this to be true and invalidate the object pointed to by inner.
1273 } LDKTrustedClosingTransaction;
1276 * The contents of CResult_TrustedClosingTransactionNoneZ
1278 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
1280 * A pointer to the contents in the success state.
1281 * Reading from this pointer when `result_ok` is not set is undefined.
1283 struct LDKTrustedClosingTransaction *result;
1285 * Note that this value is always NULL, as there are no contents in the Err variant
1288 } LDKCResult_TrustedClosingTransactionNoneZPtr;
1291 * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
1292 * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
1293 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1295 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
1297 * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
1298 * `err` or `result` depending on the state of `result_ok`.
1300 union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
1302 * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
1305 } LDKCResult_TrustedClosingTransactionNoneZ;
1310 * This class tracks the per-transaction information needed to build a commitment transaction and will
1311 * actually build it and sign. It is used for holder transactions that we sign only when needed
1312 * and for transactions we sign for the counterparty.
1314 * This class can be used inside a signer implementation to generate a signature given the relevant
1317 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
1319 * A pointer to the opaque Rust object.
1320 * Nearly everywhere, inner must be non-null, however in places where
1321 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1323 LDKnativeCommitmentTransaction *inner;
1325 * Indicates that this is the only struct which contains the same pointer.
1326 * Rust functions which take ownership of an object provided via an argument require
1327 * this to be true and invalidate the object pointed to by inner.
1330 } LDKCommitmentTransaction;
1333 * The contents of CResult_CommitmentTransactionDecodeErrorZ
1335 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
1337 * A pointer to the contents in the success state.
1338 * Reading from this pointer when `result_ok` is not set is undefined.
1340 struct LDKCommitmentTransaction *result;
1342 * A pointer to the contents in the error state.
1343 * Reading from this pointer when `result_ok` is set is undefined.
1345 struct LDKDecodeError *err;
1346 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
1349 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1350 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1351 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1353 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
1355 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
1356 * `err` or `result` depending on the state of `result_ok`.
1358 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
1360 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
1363 } LDKCResult_CommitmentTransactionDecodeErrorZ;
1368 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
1369 * transaction and the transaction creation keys) are trusted.
1371 * See trust() and verify() functions on CommitmentTransaction.
1373 * This structure implements Deref.
1375 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
1377 * A pointer to the opaque Rust object.
1378 * Nearly everywhere, inner must be non-null, however in places where
1379 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1381 LDKnativeTrustedCommitmentTransaction *inner;
1383 * Indicates that this is the only struct which contains the same pointer.
1384 * Rust functions which take ownership of an object provided via an argument require
1385 * this to be true and invalidate the object pointed to by inner.
1388 } LDKTrustedCommitmentTransaction;
1391 * The contents of CResult_TrustedCommitmentTransactionNoneZ
1393 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
1395 * A pointer to the contents in the success state.
1396 * Reading from this pointer when `result_ok` is not set is undefined.
1398 struct LDKTrustedCommitmentTransaction *result;
1400 * Note that this value is always NULL, as there are no contents in the Err variant
1403 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
1406 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
1407 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
1408 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1410 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
1412 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
1413 * `err` or `result` depending on the state of `result_ok`.
1415 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
1417 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
1420 } LDKCResult_TrustedCommitmentTransactionNoneZ;
1423 * The contents of CResult_CVec_SignatureZNoneZ
1425 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
1427 * A pointer to the contents in the success state.
1428 * Reading from this pointer when `result_ok` is not set is undefined.
1430 struct LDKCVec_SignatureZ *result;
1432 * Note that this value is always NULL, as there are no contents in the Err variant
1435 } LDKCResult_CVec_SignatureZNoneZPtr;
1438 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1439 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1440 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1442 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1444 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1445 * `err` or `result` depending on the state of `result_ok`.
1447 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1449 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1452 } LDKCResult_CVec_SignatureZNoneZ;
1457 * A script pubkey for shutting down a channel as defined by [BOLT #2].
1459 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
1461 typedef struct MUST_USE_STRUCT LDKShutdownScript {
1463 * A pointer to the opaque Rust object.
1464 * Nearly everywhere, inner must be non-null, however in places where
1465 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1467 LDKnativeShutdownScript *inner;
1469 * Indicates that this is the only struct which contains the same pointer.
1470 * Rust functions which take ownership of an object provided via an argument require
1471 * this to be true and invalidate the object pointed to by inner.
1474 } LDKShutdownScript;
1477 * The contents of CResult_ShutdownScriptDecodeErrorZ
1479 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
1481 * A pointer to the contents in the success state.
1482 * Reading from this pointer when `result_ok` is not set is undefined.
1484 struct LDKShutdownScript *result;
1486 * A pointer to the contents in the error state.
1487 * Reading from this pointer when `result_ok` is set is undefined.
1489 struct LDKDecodeError *err;
1490 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
1493 * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
1494 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
1495 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1497 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
1499 * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
1500 * `err` or `result` depending on the state of `result_ok`.
1502 union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
1504 * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
1507 } LDKCResult_ShutdownScriptDecodeErrorZ;
1512 * An error occurring when converting from [`Script`] to [`ShutdownScript`].
1514 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
1516 * A pointer to the opaque Rust object.
1517 * Nearly everywhere, inner must be non-null, however in places where
1518 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1520 LDKnativeInvalidShutdownScript *inner;
1522 * Indicates that this is the only struct which contains the same pointer.
1523 * Rust functions which take ownership of an object provided via an argument require
1524 * this to be true and invalidate the object pointed to by inner.
1527 } LDKInvalidShutdownScript;
1530 * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
1532 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
1534 * A pointer to the contents in the success state.
1535 * Reading from this pointer when `result_ok` is not set is undefined.
1537 struct LDKShutdownScript *result;
1539 * A pointer to the contents in the error state.
1540 * Reading from this pointer when `result_ok` is set is undefined.
1542 struct LDKInvalidShutdownScript *err;
1543 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
1546 * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
1547 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
1548 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1550 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
1552 * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
1553 * `err` or `result` depending on the state of `result_ok`.
1555 union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
1557 * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
1560 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
1565 * Represents the compressed public key of a node
1567 typedef struct MUST_USE_STRUCT LDKNodeId {
1569 * A pointer to the opaque Rust object.
1570 * Nearly everywhere, inner must be non-null, however in places where
1571 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1573 LDKnativeNodeId *inner;
1575 * Indicates that this is the only struct which contains the same pointer.
1576 * Rust functions which take ownership of an object provided via an argument require
1577 * this to be true and invalidate the object pointed to by inner.
1585 * Proposed use of a channel passed as a parameter to [`Score::channel_penalty_msat`].
1587 typedef struct MUST_USE_STRUCT LDKChannelUsage {
1589 * A pointer to the opaque Rust object.
1590 * Nearly everywhere, inner must be non-null, however in places where
1591 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1593 LDKnativeChannelUsage *inner;
1595 * Indicates that this is the only struct which contains the same pointer.
1596 * Rust functions which take ownership of an object provided via an argument require
1597 * this to be true and invalidate the object pointed to by inner.
1607 typedef struct MUST_USE_STRUCT LDKRouteHop {
1609 * A pointer to the opaque Rust object.
1610 * Nearly everywhere, inner must be non-null, however in places where
1611 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1613 LDKnativeRouteHop *inner;
1615 * Indicates that this is the only struct which contains the same pointer.
1616 * Rust functions which take ownership of an object provided via an argument require
1617 * this to be true and invalidate the object pointed to by inner.
1623 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
1624 * This corresponds to std::vector in C++
1626 typedef struct LDKCVec_RouteHopZ {
1628 * The elements in the array.
1629 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1631 struct LDKRouteHop *data;
1633 * The number of elements pointed to by `data`.
1636 } LDKCVec_RouteHopZ;
1639 * An interface used to score payment channels for path finding.
1641 *\tScoring is in terms of fees willing to be paid in order to avoid routing through a channel.
1643 typedef struct LDKScore {
1645 * An opaque pointer which is passed to your function implementations as an argument.
1646 * This has no meaning in the LDK, and can be NULL or any other value.
1650 * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
1651 * given channel in the direction from `source` to `target`.
1653 * The channel's capacity (less any other MPP parts that are also being considered for use in
1654 * the same payment) is given by `capacity_msat`. It may be determined from various sources
1655 * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
1656 * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
1657 * Thus, implementations should be overflow-safe.
1659 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);
1661 * Handles updating channel penalties after failing to route through a channel.
1663 void (*payment_path_failed)(void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
1665 * Handles updating channel penalties after successfully routing along a path.
1667 void (*payment_path_successful)(void *this_arg, struct LDKCVec_RouteHopZ path);
1669 * Serialize the object into a byte array
1671 struct LDKCVec_u8Z (*write)(const void *this_arg);
1673 * Frees any resources associated with this object given its this_arg pointer.
1674 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
1676 void (*free)(void *this_arg);
1680 * A scorer that is accessed under a lock.
1682 * Needed so that calls to [`Score::channel_penalty_msat`] in [`find_route`] can be made while
1683 * having shared ownership of a scorer but without requiring internal locking in [`Score`]
1684 * implementations. Internal locking would be detrimental to route finding performance and could
1685 * result in [`Score::channel_penalty_msat`] returning a different value for the same channel.
1687 * [`find_route`]: crate::routing::router::find_route
1689 typedef struct LDKLockableScore {
1691 * An opaque pointer which is passed to your function implementations as an argument.
1692 * This has no meaning in the LDK, and can be NULL or any other value.
1696 * Returns the locked scorer.
1698 struct LDKScore (*lock)(const void *this_arg);
1700 * Frees any resources associated with this object given its this_arg pointer.
1701 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
1703 void (*free)(void *this_arg);
1707 * Refers to a scorer that is accessible under lock and also writeable to disk
1709 * We need this trait to be able to pass in a scorer to `lightning-background-processor` that will enable us to
1710 * use the Persister to persist it.
1712 typedef struct LDKWriteableScore {
1714 * An opaque pointer which is passed to your function implementations as an argument.
1715 * This has no meaning in the LDK, and can be NULL or any other value.
1719 * Implementation of LockableScore for this object.
1721 struct LDKLockableScore LockableScore;
1723 * Serialize the object into a byte array
1725 struct LDKCVec_u8Z (*write)(const void *this_arg);
1727 * Frees any resources associated with this object given its this_arg pointer.
1728 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
1730 void (*free)(void *this_arg);
1731 } LDKWriteableScore;
1734 * An enum which can either contain a crate::lightning::routing::scoring::WriteableScore or not
1736 typedef enum LDKCOption_WriteableScoreZ_Tag {
1738 * When we're in this state, this COption_WriteableScoreZ contains a crate::lightning::routing::scoring::WriteableScore
1740 LDKCOption_WriteableScoreZ_Some,
1742 * When we're in this state, this COption_WriteableScoreZ contains nothing
1744 LDKCOption_WriteableScoreZ_None,
1746 * Must be last for serialization purposes
1748 LDKCOption_WriteableScoreZ_Sentinel,
1749 } LDKCOption_WriteableScoreZ_Tag;
1751 typedef struct LDKCOption_WriteableScoreZ {
1752 LDKCOption_WriteableScoreZ_Tag tag;
1755 struct LDKWriteableScore some;
1758 } LDKCOption_WriteableScoreZ;
1761 * The contents of CResult_NoneErrorZ
1763 typedef union LDKCResult_NoneErrorZPtr {
1765 * Note that this value is always NULL, as there are no contents in the OK variant
1769 * A pointer to the contents in the error state.
1770 * Reading from this pointer when `result_ok` is set is undefined.
1772 enum LDKIOError *err;
1773 } LDKCResult_NoneErrorZPtr;
1776 * A CResult_NoneErrorZ represents the result of a fallible operation,
1777 * containing a () on success and a crate::c_types::IOError on failure.
1778 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1780 typedef struct LDKCResult_NoneErrorZ {
1782 * The contents of this CResult_NoneErrorZ, accessible via either
1783 * `err` or `result` depending on the state of `result_ok`.
1785 union LDKCResult_NoneErrorZPtr contents;
1787 * Whether this CResult_NoneErrorZ represents a success state.
1790 } LDKCResult_NoneErrorZ;
1793 * The contents of CResult_RouteHopDecodeErrorZ
1795 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
1797 * A pointer to the contents in the success state.
1798 * Reading from this pointer when `result_ok` is not set is undefined.
1800 struct LDKRouteHop *result;
1802 * A pointer to the contents in the error state.
1803 * Reading from this pointer when `result_ok` is set is undefined.
1805 struct LDKDecodeError *err;
1806 } LDKCResult_RouteHopDecodeErrorZPtr;
1809 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
1810 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
1811 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1813 typedef struct LDKCResult_RouteHopDecodeErrorZ {
1815 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
1816 * `err` or `result` depending on the state of `result_ok`.
1818 union LDKCResult_RouteHopDecodeErrorZPtr contents;
1820 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
1823 } LDKCResult_RouteHopDecodeErrorZ;
1826 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
1827 * This corresponds to std::vector in C++
1829 typedef struct LDKCVec_CVec_RouteHopZZ {
1831 * The elements in the array.
1832 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1834 struct LDKCVec_RouteHopZ *data;
1836 * The number of elements pointed to by `data`.
1839 } LDKCVec_CVec_RouteHopZZ;
1844 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
1845 * it can take multiple paths. Each path is composed of one or more hops through the network.
1847 typedef struct MUST_USE_STRUCT LDKRoute {
1849 * A pointer to the opaque Rust object.
1850 * Nearly everywhere, inner must be non-null, however in places where
1851 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1853 LDKnativeRoute *inner;
1855 * Indicates that this is the only struct which contains the same pointer.
1856 * Rust functions which take ownership of an object provided via an argument require
1857 * this to be true and invalidate the object pointed to by inner.
1863 * The contents of CResult_RouteDecodeErrorZ
1865 typedef union LDKCResult_RouteDecodeErrorZPtr {
1867 * A pointer to the contents in the success state.
1868 * Reading from this pointer when `result_ok` is not set is undefined.
1870 struct LDKRoute *result;
1872 * A pointer to the contents in the error state.
1873 * Reading from this pointer when `result_ok` is set is undefined.
1875 struct LDKDecodeError *err;
1876 } LDKCResult_RouteDecodeErrorZPtr;
1879 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
1880 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
1881 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1883 typedef struct LDKCResult_RouteDecodeErrorZ {
1885 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
1886 * `err` or `result` depending on the state of `result_ok`.
1888 union LDKCResult_RouteDecodeErrorZPtr contents;
1890 * Whether this CResult_RouteDecodeErrorZ represents a success state.
1893 } LDKCResult_RouteDecodeErrorZ;
1898 * Parameters needed to find a [`Route`].
1900 * Passed to [`find_route`] and [`build_route_from_hops`], but also provided in
1901 * [`Event::PaymentPathFailed`] for retrying a failed payment path.
1903 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
1905 typedef struct MUST_USE_STRUCT LDKRouteParameters {
1907 * A pointer to the opaque Rust object.
1908 * Nearly everywhere, inner must be non-null, however in places where
1909 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1911 LDKnativeRouteParameters *inner;
1913 * Indicates that this is the only struct which contains the same pointer.
1914 * Rust functions which take ownership of an object provided via an argument require
1915 * this to be true and invalidate the object pointed to by inner.
1918 } LDKRouteParameters;
1921 * The contents of CResult_RouteParametersDecodeErrorZ
1923 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
1925 * A pointer to the contents in the success state.
1926 * Reading from this pointer when `result_ok` is not set is undefined.
1928 struct LDKRouteParameters *result;
1930 * A pointer to the contents in the error state.
1931 * Reading from this pointer when `result_ok` is set is undefined.
1933 struct LDKDecodeError *err;
1934 } LDKCResult_RouteParametersDecodeErrorZPtr;
1937 * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
1938 * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1939 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1941 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
1943 * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
1944 * `err` or `result` depending on the state of `result_ok`.
1946 union LDKCResult_RouteParametersDecodeErrorZPtr contents;
1948 * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
1951 } LDKCResult_RouteParametersDecodeErrorZ;
1956 * A list of hops along a payment path terminating with a channel to the recipient.
1958 typedef struct MUST_USE_STRUCT LDKRouteHint {
1960 * A pointer to the opaque Rust object.
1961 * Nearly everywhere, inner must be non-null, however in places where
1962 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1964 LDKnativeRouteHint *inner;
1966 * Indicates that this is the only struct which contains the same pointer.
1967 * Rust functions which take ownership of an object provided via an argument require
1968 * this to be true and invalidate the object pointed to by inner.
1974 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
1975 * This corresponds to std::vector in C++
1977 typedef struct LDKCVec_RouteHintZ {
1979 * The elements in the array.
1980 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1982 struct LDKRouteHint *data;
1984 * The number of elements pointed to by `data`.
1987 } LDKCVec_RouteHintZ;
1990 * An enum which can either contain a u64 or not
1992 typedef enum LDKCOption_u64Z_Tag {
1994 * When we're in this state, this COption_u64Z contains a u64
1996 LDKCOption_u64Z_Some,
1998 * When we're in this state, this COption_u64Z contains nothing
2000 LDKCOption_u64Z_None,
2002 * Must be last for serialization purposes
2004 LDKCOption_u64Z_Sentinel,
2005 } LDKCOption_u64Z_Tag;
2007 typedef struct LDKCOption_u64Z {
2008 LDKCOption_u64Z_Tag tag;
2019 * The recipient of a payment.
2021 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
2023 * A pointer to the opaque Rust object.
2024 * Nearly everywhere, inner must be non-null, however in places where
2025 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2027 LDKnativePaymentParameters *inner;
2029 * Indicates that this is the only struct which contains the same pointer.
2030 * Rust functions which take ownership of an object provided via an argument require
2031 * this to be true and invalidate the object pointed to by inner.
2034 } LDKPaymentParameters;
2037 * The contents of CResult_PaymentParametersDecodeErrorZ
2039 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
2041 * A pointer to the contents in the success state.
2042 * Reading from this pointer when `result_ok` is not set is undefined.
2044 struct LDKPaymentParameters *result;
2046 * A pointer to the contents in the error state.
2047 * Reading from this pointer when `result_ok` is set is undefined.
2049 struct LDKDecodeError *err;
2050 } LDKCResult_PaymentParametersDecodeErrorZPtr;
2053 * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
2054 * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
2055 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2057 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
2059 * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
2060 * `err` or `result` depending on the state of `result_ok`.
2062 union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
2064 * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
2067 } LDKCResult_PaymentParametersDecodeErrorZ;
2072 * A channel descriptor for a hop along a payment path.
2074 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
2076 * A pointer to the opaque Rust object.
2077 * Nearly everywhere, inner must be non-null, however in places where
2078 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2080 LDKnativeRouteHintHop *inner;
2082 * Indicates that this is the only struct which contains the same pointer.
2083 * Rust functions which take ownership of an object provided via an argument require
2084 * this to be true and invalidate the object pointed to by inner.
2090 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
2091 * This corresponds to std::vector in C++
2093 typedef struct LDKCVec_RouteHintHopZ {
2095 * The elements in the array.
2096 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2098 struct LDKRouteHintHop *data;
2100 * The number of elements pointed to by `data`.
2103 } LDKCVec_RouteHintHopZ;
2106 * The contents of CResult_RouteHintDecodeErrorZ
2108 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
2110 * A pointer to the contents in the success state.
2111 * Reading from this pointer when `result_ok` is not set is undefined.
2113 struct LDKRouteHint *result;
2115 * A pointer to the contents in the error state.
2116 * Reading from this pointer when `result_ok` is set is undefined.
2118 struct LDKDecodeError *err;
2119 } LDKCResult_RouteHintDecodeErrorZPtr;
2122 * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
2123 * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
2124 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2126 typedef struct LDKCResult_RouteHintDecodeErrorZ {
2128 * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
2129 * `err` or `result` depending on the state of `result_ok`.
2131 union LDKCResult_RouteHintDecodeErrorZPtr contents;
2133 * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
2136 } LDKCResult_RouteHintDecodeErrorZ;
2139 * The contents of CResult_RouteHintHopDecodeErrorZ
2141 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
2143 * A pointer to the contents in the success state.
2144 * Reading from this pointer when `result_ok` is not set is undefined.
2146 struct LDKRouteHintHop *result;
2148 * A pointer to the contents in the error state.
2149 * Reading from this pointer when `result_ok` is set is undefined.
2151 struct LDKDecodeError *err;
2152 } LDKCResult_RouteHintHopDecodeErrorZPtr;
2155 * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
2156 * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
2157 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2159 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
2161 * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
2162 * `err` or `result` depending on the state of `result_ok`.
2164 union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
2166 * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
2169 } LDKCResult_RouteHintHopDecodeErrorZ;
2174 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
2176 typedef struct MUST_USE_STRUCT LDKChannelDetails {
2178 * A pointer to the opaque Rust object.
2179 * Nearly everywhere, inner must be non-null, however in places where
2180 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2182 LDKnativeChannelDetails *inner;
2184 * Indicates that this is the only struct which contains the same pointer.
2185 * Rust functions which take ownership of an object provided via an argument require
2186 * this to be true and invalidate the object pointed to by inner.
2189 } LDKChannelDetails;
2192 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
2193 * This corresponds to std::vector in C++
2195 typedef struct LDKCVec_ChannelDetailsZ {
2197 * The elements in the array.
2198 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2200 struct LDKChannelDetails *data;
2202 * The number of elements pointed to by `data`.
2205 } LDKCVec_ChannelDetailsZ;
2210 * An Err type for failure to process messages.
2212 typedef struct MUST_USE_STRUCT LDKLightningError {
2214 * A pointer to the opaque Rust object.
2215 * Nearly everywhere, inner must be non-null, however in places where
2216 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2218 LDKnativeLightningError *inner;
2220 * Indicates that this is the only struct which contains the same pointer.
2221 * Rust functions which take ownership of an object provided via an argument require
2222 * this to be true and invalidate the object pointed to by inner.
2225 } LDKLightningError;
2228 * The contents of CResult_RouteLightningErrorZ
2230 typedef union LDKCResult_RouteLightningErrorZPtr {
2232 * A pointer to the contents in the success state.
2233 * Reading from this pointer when `result_ok` is not set is undefined.
2235 struct LDKRoute *result;
2237 * A pointer to the contents in the error state.
2238 * Reading from this pointer when `result_ok` is set is undefined.
2240 struct LDKLightningError *err;
2241 } LDKCResult_RouteLightningErrorZPtr;
2244 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
2245 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
2246 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2248 typedef struct LDKCResult_RouteLightningErrorZ {
2250 * The contents of this CResult_RouteLightningErrorZ, accessible via either
2251 * `err` or `result` depending on the state of `result_ok`.
2253 union LDKCResult_RouteLightningErrorZPtr contents;
2255 * Whether this CResult_RouteLightningErrorZ represents a success state.
2258 } LDKCResult_RouteLightningErrorZ;
2261 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
2262 * This corresponds to std::vector in C++
2264 typedef struct LDKCVec_PublicKeyZ {
2266 * The elements in the array.
2267 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2269 struct LDKPublicKey *data;
2271 * The number of elements pointed to by `data`.
2274 } LDKCVec_PublicKeyZ;
2277 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
2278 * look up the corresponding function in rust-lightning's docs.
2280 typedef struct LDKThirtyTwoBytes {
2282 * The thirty-two bytes
2285 } LDKThirtyTwoBytes;
2288 * Some information provided on receipt of payment depends on whether the payment received is a
2289 * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
2291 typedef enum LDKPaymentPurpose_Tag {
2293 * Information for receiving a payment that we generated an invoice for.
2295 LDKPaymentPurpose_InvoicePayment,
2297 * Because this is a spontaneous payment, the payer generated their own preimage rather than us
2298 * (the payee) providing a preimage.
2300 LDKPaymentPurpose_SpontaneousPayment,
2302 * Must be last for serialization purposes
2304 LDKPaymentPurpose_Sentinel,
2305 } LDKPaymentPurpose_Tag;
2307 typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
2309 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
2310 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
2311 * [`ChannelManager::claim_funds`].
2313 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2314 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2316 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2318 struct LDKThirtyTwoBytes payment_preimage;
2320 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
2321 * number of deanonymization attacks during the routing process.
2322 * It is provided here for your reference, however its accuracy is enforced directly by
2323 * [`ChannelManager`] using the values you previously provided to
2324 * [`ChannelManager::create_inbound_payment`] or
2325 * [`ChannelManager::create_inbound_payment_for_hash`].
2327 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2328 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2329 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
2331 struct LDKThirtyTwoBytes payment_secret;
2332 } LDKPaymentPurpose_LDKInvoicePayment_Body;
2334 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
2335 LDKPaymentPurpose_Tag tag;
2337 LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
2339 struct LDKThirtyTwoBytes spontaneous_payment;
2342 } LDKPaymentPurpose;
2345 * The contents of CResult_PaymentPurposeDecodeErrorZ
2347 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
2349 * A pointer to the contents in the success state.
2350 * Reading from this pointer when `result_ok` is not set is undefined.
2352 struct LDKPaymentPurpose *result;
2354 * A pointer to the contents in the error state.
2355 * Reading from this pointer when `result_ok` is set is undefined.
2357 struct LDKDecodeError *err;
2358 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
2361 * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
2362 * containing a crate::lightning::util::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
2363 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2365 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
2367 * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
2368 * `err` or `result` depending on the state of `result_ok`.
2370 union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
2372 * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
2375 } LDKCResult_PaymentPurposeDecodeErrorZ;
2378 * The reason the channel was closed. See individual variants more details.
2380 typedef enum LDKClosureReason_Tag {
2382 * Closure generated from receiving a peer error message.
2384 * Our counterparty may have broadcasted their latest commitment state, and we have
2387 LDKClosureReason_CounterpartyForceClosed,
2389 * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
2391 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
2393 LDKClosureReason_HolderForceClosed,
2395 * The channel was closed after negotiating a cooperative close and we've now broadcasted
2396 * the cooperative close transaction. Note the shutdown may have been initiated by us.
2398 LDKClosureReason_CooperativeClosure,
2400 * A commitment transaction was confirmed on chain, closing the channel. Most likely this
2401 * commitment transaction came from our counterparty, but it may also have come from
2402 * a copy of our own `ChannelMonitor`.
2404 LDKClosureReason_CommitmentTxConfirmed,
2406 * The funding transaction failed to confirm in a timely manner on an inbound channel.
2408 LDKClosureReason_FundingTimedOut,
2410 * Closure generated from processing an event, likely a HTLC forward/relay/reception.
2412 LDKClosureReason_ProcessingError,
2414 * The peer disconnected prior to funding completing. In this case the spec mandates that we
2415 * forget the channel entirely - we can attempt again if the peer reconnects.
2417 * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
2418 * peer because of mutual incompatibility between us and our channel counterparty.
2420 LDKClosureReason_DisconnectedPeer,
2422 * Closure generated from `ChannelManager::read` if the ChannelMonitor is newer than
2423 * the ChannelManager deserialized.
2425 LDKClosureReason_OutdatedChannelManager,
2427 * Must be last for serialization purposes
2429 LDKClosureReason_Sentinel,
2430 } LDKClosureReason_Tag;
2432 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
2434 * The error which the peer sent us.
2436 * The string should be sanitized before it is used (e.g emitted to logs
2437 * or printed to stdout). Otherwise, a well crafted error message may exploit
2438 * a security vulnerability in the terminal emulator or the logging subsystem.
2440 struct LDKStr peer_msg;
2441 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
2443 typedef struct LDKClosureReason_LDKProcessingError_Body {
2445 * A developer-readable error message which we generated.
2448 } LDKClosureReason_LDKProcessingError_Body;
2450 typedef struct MUST_USE_STRUCT LDKClosureReason {
2451 LDKClosureReason_Tag tag;
2453 LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
2454 LDKClosureReason_LDKProcessingError_Body processing_error;
2459 * An enum which can either contain a crate::lightning::util::events::ClosureReason or not
2461 typedef enum LDKCOption_ClosureReasonZ_Tag {
2463 * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::util::events::ClosureReason
2465 LDKCOption_ClosureReasonZ_Some,
2467 * When we're in this state, this COption_ClosureReasonZ contains nothing
2469 LDKCOption_ClosureReasonZ_None,
2471 * Must be last for serialization purposes
2473 LDKCOption_ClosureReasonZ_Sentinel,
2474 } LDKCOption_ClosureReasonZ_Tag;
2476 typedef struct LDKCOption_ClosureReasonZ {
2477 LDKCOption_ClosureReasonZ_Tag tag;
2480 struct LDKClosureReason some;
2483 } LDKCOption_ClosureReasonZ;
2486 * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
2488 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
2490 * A pointer to the contents in the success state.
2491 * Reading from this pointer when `result_ok` is not set is undefined.
2493 struct LDKCOption_ClosureReasonZ *result;
2495 * A pointer to the contents in the error state.
2496 * Reading from this pointer when `result_ok` is set is undefined.
2498 struct LDKDecodeError *err;
2499 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
2502 * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
2503 * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
2504 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2506 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
2508 * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
2509 * `err` or `result` depending on the state of `result_ok`.
2511 union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
2513 * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
2516 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
2521 * A channel_update message to be sent or received from a peer
2523 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
2525 * A pointer to the opaque Rust object.
2526 * Nearly everywhere, inner must be non-null, however in places where
2527 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2529 LDKnativeChannelUpdate *inner;
2531 * Indicates that this is the only struct which contains the same pointer.
2532 * Rust functions which take ownership of an object provided via an argument require
2533 * this to be true and invalidate the object pointed to by inner.
2539 * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
2540 * return packet by a node along the route. See [BOLT #4] for details.
2542 * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
2544 typedef enum LDKNetworkUpdate_Tag {
2546 * An error indicating a `channel_update` messages should be applied via
2547 * [`NetworkGraph::update_channel`].
2549 LDKNetworkUpdate_ChannelUpdateMessage,
2551 * An error indicating that a channel failed to route a payment, which should be applied via
2552 * [`NetworkGraph::channel_failed`].
2554 LDKNetworkUpdate_ChannelFailure,
2556 * An error indicating that a node failed to route a payment, which should be applied via
2557 * [`NetworkGraph::node_failed`].
2559 LDKNetworkUpdate_NodeFailure,
2561 * Must be last for serialization purposes
2563 LDKNetworkUpdate_Sentinel,
2564 } LDKNetworkUpdate_Tag;
2566 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
2568 * The update to apply via [`NetworkGraph::update_channel`].
2570 struct LDKChannelUpdate msg;
2571 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
2573 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
2575 * The short channel id of the closed channel.
2577 uint64_t short_channel_id;
2579 * Whether the channel should be permanently removed or temporarily disabled until a new
2580 * `channel_update` message is received.
2583 } LDKNetworkUpdate_LDKChannelFailure_Body;
2585 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
2587 * The node id of the failed node.
2589 struct LDKPublicKey node_id;
2591 * Whether the node should be permanently removed from consideration or can be restored
2592 * when a new `channel_update` message is received.
2595 } LDKNetworkUpdate_LDKNodeFailure_Body;
2597 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
2598 LDKNetworkUpdate_Tag tag;
2600 LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
2601 LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
2602 LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
2607 * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
2609 typedef enum LDKCOption_NetworkUpdateZ_Tag {
2611 * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
2613 LDKCOption_NetworkUpdateZ_Some,
2615 * When we're in this state, this COption_NetworkUpdateZ contains nothing
2617 LDKCOption_NetworkUpdateZ_None,
2619 * Must be last for serialization purposes
2621 LDKCOption_NetworkUpdateZ_Sentinel,
2622 } LDKCOption_NetworkUpdateZ_Tag;
2624 typedef struct LDKCOption_NetworkUpdateZ {
2625 LDKCOption_NetworkUpdateZ_Tag tag;
2628 struct LDKNetworkUpdate some;
2631 } LDKCOption_NetworkUpdateZ;
2636 * A reference to a transaction output.
2638 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
2639 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
2641 typedef struct MUST_USE_STRUCT LDKOutPoint {
2643 * A pointer to the opaque Rust object.
2644 * Nearly everywhere, inner must be non-null, however in places where
2645 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2647 LDKnativeOutPoint *inner;
2649 * Indicates that this is the only struct which contains the same pointer.
2650 * Rust functions which take ownership of an object provided via an argument require
2651 * this to be true and invalidate the object pointed to by inner.
2659 * Information about a spendable output to a P2WSH script. See
2660 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
2662 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
2664 * A pointer to the opaque Rust object.
2665 * Nearly everywhere, inner must be non-null, however in places where
2666 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2668 LDKnativeDelayedPaymentOutputDescriptor *inner;
2670 * Indicates that this is the only struct which contains the same pointer.
2671 * Rust functions which take ownership of an object provided via an argument require
2672 * this to be true and invalidate the object pointed to by inner.
2675 } LDKDelayedPaymentOutputDescriptor;
2680 * Information about a spendable output to our \"payment key\". See
2681 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
2683 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
2685 * A pointer to the opaque Rust object.
2686 * Nearly everywhere, inner must be non-null, however in places where
2687 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2689 LDKnativeStaticPaymentOutputDescriptor *inner;
2691 * Indicates that this is the only struct which contains the same pointer.
2692 * Rust functions which take ownership of an object provided via an argument require
2693 * this to be true and invalidate the object pointed to by inner.
2696 } LDKStaticPaymentOutputDescriptor;
2699 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
2700 * claim at any point in the future) an event is generated which you must track and be able to
2701 * spend on-chain. The information needed to do this is provided in this enum, including the
2702 * outpoint describing which txid and output index is available, the full output which exists at
2703 * that txid/index, and any keys or other information required to sign.
2705 typedef enum LDKSpendableOutputDescriptor_Tag {
2707 * An output to a script which was provided via KeysInterface directly, either from
2708 * `get_destination_script()` or `get_shutdown_scriptpubkey()`, thus you should already know
2709 * how to spend it. No secret keys are provided as rust-lightning was never given any key.
2710 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
2711 * on-chain using the payment preimage or after it has timed out.
2713 LDKSpendableOutputDescriptor_StaticOutput,
2715 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
2717 * The witness in the spending input should be:
2718 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
2720 * Note that the nSequence field in the spending input must be set to to_self_delay
2721 * (which means the transaction is not broadcastable until at least to_self_delay
2722 * blocks after the outpoint confirms).
2724 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
2725 * it is an output from an old state which we broadcast (which should never happen).
2727 * To derive the delayed_payment key which is used to sign for this input, you must pass the
2728 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
2729 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
2730 * chan_utils::derive_private_key. The public key can be generated without the secret key
2731 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
2734 * To derive the revocation_pubkey provided here (which is used in the witness
2735 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
2736 * call to Sign::ready_channel) and the provided per_commitment point
2737 * to chan_utils::derive_public_revocation_key.
2739 * The witness script which is hashed and included in the output script_pubkey may be
2740 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
2741 * (derived as above), and the to_self_delay contained here to
2742 * chan_utils::get_revokeable_redeemscript.
2744 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
2746 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
2747 * corresponds to the public key in Sign::pubkeys().payment_point).
2748 * The witness in the spending input, is, thus, simply:
2749 * <BIP 143 signature> <payment key>
2751 * These are generally the result of our counterparty having broadcast the current state,
2752 * allowing us to claim the non-HTLC-encumbered outputs immediately.
2754 LDKSpendableOutputDescriptor_StaticPaymentOutput,
2756 * Must be last for serialization purposes
2758 LDKSpendableOutputDescriptor_Sentinel,
2759 } LDKSpendableOutputDescriptor_Tag;
2761 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
2763 * The outpoint which is spendable
2765 struct LDKOutPoint outpoint;
2767 * The output which is referenced by the given outpoint.
2769 struct LDKTxOut output;
2770 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
2772 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
2773 LDKSpendableOutputDescriptor_Tag tag;
2775 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
2777 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
2780 struct LDKStaticPaymentOutputDescriptor static_payment_output;
2783 } LDKSpendableOutputDescriptor;
2786 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
2787 * This corresponds to std::vector in C++
2789 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2791 * The elements in the array.
2792 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2794 struct LDKSpendableOutputDescriptor *data;
2796 * The number of elements pointed to by `data`.
2799 } LDKCVec_SpendableOutputDescriptorZ;
2804 * Features used within the channel_type field in an OpenChannel message.
2806 * A channel is always of some known \"type\", describing the transaction formats used and the exact
2807 * semantics of our interaction with our peer.
2809 * Note that because a channel is a specific type which is proposed by the opener and accepted by
2810 * the counterparty, only required features are allowed here.
2812 * This is serialized differently from other feature types - it is not prefixed by a length, and
2813 * thus must only appear inside a TLV where its length is known in advance.
2815 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
2817 * A pointer to the opaque Rust object.
2818 * Nearly everywhere, inner must be non-null, however in places where
2819 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2821 LDKnativeChannelTypeFeatures *inner;
2823 * Indicates that this is the only struct which contains the same pointer.
2824 * Rust functions which take ownership of an object provided via an argument require
2825 * this to be true and invalidate the object pointed to by inner.
2828 } LDKChannelTypeFeatures;
2831 * An Event which you should probably take some action in response to.
2833 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
2834 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
2835 * written as it makes no sense to respond to it after reconnecting to peers).
2837 typedef enum LDKEvent_Tag {
2839 * Used to indicate that the client should generate a funding transaction with the given
2840 * parameters and then call [`ChannelManager::funding_transaction_generated`].
2841 * Generated in [`ChannelManager`] message handling.
2842 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
2843 * counterparty can steal your funds!
2845 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2846 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
2848 LDKEvent_FundingGenerationReady,
2850 * Indicates we've received (an offer of) money! Just gotta dig out that payment preimage and
2851 * feed it to [`ChannelManager::claim_funds`] to get it....
2853 * Note that if the preimage is not known, you should call
2854 * [`ChannelManager::fail_htlc_backwards`] to free up resources for this HTLC and avoid
2855 * network congestion.
2856 * If you fail to call either [`ChannelManager::claim_funds`] or
2857 * [`ChannelManager::fail_htlc_backwards`] within the HTLC's timeout, the HTLC will be
2858 * automatically failed.
2861 * LDK will not stop an inbound payment from being paid multiple times, so multiple
2862 * `PaymentReceived` events may be generated for the same payment.
2864 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2865 * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
2867 LDKEvent_PaymentReceived,
2869 * Indicates a payment has been claimed and we've received money!
2871 * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
2872 * to an [`Event::PaymentReceived`]. However, if we previously crashed during a
2873 * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
2874 * [`Event::PaymentReceived`] event.
2877 * LDK will not stop an inbound payment from being paid multiple times, so multiple
2878 * `PaymentReceived` events may be generated for the same payment. If you then call
2879 * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentReceived`] you may get
2880 * multiple `PaymentClaimed` events.
2882 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2884 LDKEvent_PaymentClaimed,
2886 * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
2887 * and we got back the payment preimage for it).
2889 * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
2890 * event. In this situation, you SHOULD treat this payment as having succeeded.
2892 LDKEvent_PaymentSent,
2894 * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
2895 * provide failure information for each MPP part in the payment.
2897 * This event is provided once there are no further pending HTLCs for the payment and the
2898 * payment is no longer retryable, either due to a several-block timeout or because
2899 * [`ChannelManager::abandon_payment`] was previously called for the corresponding payment.
2901 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
2903 LDKEvent_PaymentFailed,
2905 * Indicates that a path for an outbound payment was successful.
2907 * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
2908 * [`Event::PaymentSent`] for obtaining the payment preimage.
2910 LDKEvent_PaymentPathSuccessful,
2912 * Indicates an outbound HTLC we sent failed. Probably some intermediary node dropped
2913 * something. You may wish to retry with a different route.
2915 * Note that this does *not* indicate that all paths for an MPP payment have failed, see
2916 * [`Event::PaymentFailed`] and [`all_paths_failed`].
2918 * [`all_paths_failed`]: Self::PaymentPathFailed::all_paths_failed
2920 LDKEvent_PaymentPathFailed,
2922 * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
2923 * a time in the future.
2925 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
2927 LDKEvent_PendingHTLCsForwardable,
2929 * Used to indicate that an output which you should know how to spend was confirmed on chain
2930 * and is now spendable.
2931 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
2932 * counterparty spending them due to some kind of timeout. Thus, you need to store them
2933 * somewhere and spend them when you create on-chain transactions.
2935 LDKEvent_SpendableOutputs,
2937 * This event is generated when a payment has been successfully forwarded through us and a
2938 * forwarding fee earned.
2940 LDKEvent_PaymentForwarded,
2942 * Used to indicate that a previously opened channel with the given `channel_id` is in the
2943 * process of closure.
2945 LDKEvent_ChannelClosed,
2947 * Used to indicate to the user that they can abandon the funding transaction and recycle the
2948 * inputs for another purpose.
2950 LDKEvent_DiscardFunding,
2952 * Indicates a request to open a new channel by a peer.
2954 * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the
2955 * request, call [`ChannelManager::force_close_channel`].
2957 * The event is only triggered when a new open channel request is received and the
2958 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
2960 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
2961 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel
2962 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
2964 LDKEvent_OpenChannelRequest,
2966 * Must be last for serialization purposes
2971 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
2973 * The random channel_id we picked which you'll need to pass into
2974 * [`ChannelManager::funding_transaction_generated`].
2976 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
2978 struct LDKThirtyTwoBytes temporary_channel_id;
2980 * The counterparty's node_id, which you'll need to pass back into
2981 * [`ChannelManager::funding_transaction_generated`].
2983 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
2985 struct LDKPublicKey counterparty_node_id;
2987 * The value, in satoshis, that the output should have.
2989 uint64_t channel_value_satoshis;
2991 * The script which should be used in the transaction output.
2993 struct LDKCVec_u8Z output_script;
2995 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or 0 for
2996 * an inbound channel.
2998 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
3000 uint64_t user_channel_id;
3001 } LDKEvent_LDKFundingGenerationReady_Body;
3003 typedef struct LDKEvent_LDKPaymentReceived_Body {
3005 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
3006 * not stop you from registering duplicate payment hashes for inbound payments.
3008 struct LDKThirtyTwoBytes payment_hash;
3010 * The value, in thousandths of a satoshi, that this payment is for.
3012 uint64_t amount_msat;
3014 * Information for claiming this received payment, based on whether the purpose of the
3015 * payment is to pay an invoice or to send a spontaneous payment.
3017 struct LDKPaymentPurpose purpose;
3018 } LDKEvent_LDKPaymentReceived_Body;
3020 typedef struct LDKEvent_LDKPaymentClaimed_Body {
3022 * The payment hash of the claimed payment. Note that LDK will not stop you from
3023 * registering duplicate payment hashes for inbound payments.
3025 struct LDKThirtyTwoBytes payment_hash;
3027 * The value, in thousandths of a satoshi, that this payment is for.
3029 uint64_t amount_msat;
3031 * The purpose of this claimed payment, i.e. whether the payment was for an invoice or a
3032 * spontaneous payment.
3034 struct LDKPaymentPurpose purpose;
3035 } LDKEvent_LDKPaymentClaimed_Body;
3037 typedef struct LDKEvent_LDKPaymentSent_Body {
3039 * The id returned by [`ChannelManager::send_payment`] and used with
3040 * [`ChannelManager::retry_payment`].
3042 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3043 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3045 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3047 struct LDKThirtyTwoBytes payment_id;
3049 * The preimage to the hash given to ChannelManager::send_payment.
3050 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
3053 struct LDKThirtyTwoBytes payment_preimage;
3055 * The hash that was given to [`ChannelManager::send_payment`].
3057 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3059 struct LDKThirtyTwoBytes payment_hash;
3061 * The total fee which was spent at intermediate hops in this payment, across all paths.
3063 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
3064 * overpayment to the recipient node.
3066 * If the recipient or an intermediate node misbehaves and gives us free money, this may
3067 * overstate the amount paid, though this is unlikely.
3069 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
3071 struct LDKCOption_u64Z fee_paid_msat;
3072 } LDKEvent_LDKPaymentSent_Body;
3074 typedef struct LDKEvent_LDKPaymentFailed_Body {
3076 * The id returned by [`ChannelManager::send_payment`] and used with
3077 * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
3079 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3080 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3081 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3083 struct LDKThirtyTwoBytes payment_id;
3085 * The hash that was given to [`ChannelManager::send_payment`].
3087 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3089 struct LDKThirtyTwoBytes payment_hash;
3090 } LDKEvent_LDKPaymentFailed_Body;
3092 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
3094 * The id returned by [`ChannelManager::send_payment`] and used with
3095 * [`ChannelManager::retry_payment`].
3097 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3098 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3100 struct LDKThirtyTwoBytes payment_id;
3102 * The hash that was given to [`ChannelManager::send_payment`].
3104 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3106 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3108 struct LDKThirtyTwoBytes payment_hash;
3110 * The payment path that was successful.
3112 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
3114 struct LDKCVec_RouteHopZ path;
3115 } LDKEvent_LDKPaymentPathSuccessful_Body;
3117 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
3119 * The id returned by [`ChannelManager::send_payment`] and used with
3120 * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
3122 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3123 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3124 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3126 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3128 struct LDKThirtyTwoBytes payment_id;
3130 * The hash that was given to [`ChannelManager::send_payment`].
3132 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3134 struct LDKThirtyTwoBytes payment_hash;
3136 * Indicates the payment was rejected for some reason by the recipient. This implies that
3137 * the payment has failed, not just the route in question. If this is not set, you may
3138 * retry the payment via a different route.
3140 bool rejected_by_dest;
3142 * Any failure information conveyed via the Onion return packet by a node along the failed
3145 * Should be applied to the [`NetworkGraph`] so that routing decisions can take into
3146 * account the update.
3148 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
3150 struct LDKCOption_NetworkUpdateZ network_update;
3152 * For both single-path and multi-path payments, this is set if all paths of the payment have
3153 * failed. This will be set to false if (1) this is an MPP payment and (2) other parts of the
3154 * larger MPP payment were still in flight when this event was generated.
3156 * Note that if you are retrying individual MPP parts, using this value to determine if a
3157 * payment has fully failed is race-y. Because multiple failures can happen prior to events
3158 * being processed, you may retry in response to a first failure, with a second failure
3159 * (with `all_paths_failed` set) still pending. Then, when the second failure is processed
3160 * you will see `all_paths_failed` set even though the retry of the first failure still
3161 * has an associated in-flight HTLC. See (1) for an example of such a failure.
3163 * If you wish to retry individual MPP parts and learn when a payment has failed, you must
3164 * call [`ChannelManager::abandon_payment`] and wait for a [`Event::PaymentFailed`] event.
3166 * (1) <https://github.com/lightningdevkit/rust-lightning/issues/1164>
3168 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3170 bool all_paths_failed;
3172 * The payment path that failed.
3174 struct LDKCVec_RouteHopZ path;
3176 * The channel responsible for the failed payment path.
3178 * Note that for route hints or for the first hop in a path this may be an SCID alias and
3179 * may not refer to a channel in the public network graph. These aliases may also collide
3180 * with channels in the public network graph.
3182 * If this is `Some`, then the corresponding channel should be avoided when the payment is
3183 * retried. May be `None` for older [`Event`] serializations.
3185 struct LDKCOption_u64Z short_channel_id;
3187 * Parameters needed to compute a new [`Route`] when retrying the failed payment path.
3189 * See [`find_route`] for details.
3191 * [`Route`]: crate::routing::router::Route
3192 * [`find_route`]: crate::routing::router::find_route
3194 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3196 struct LDKRouteParameters retry;
3197 } LDKEvent_LDKPaymentPathFailed_Body;
3199 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
3201 * The minimum amount of time that should be waited prior to calling
3202 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
3203 * you should wait a random amount of time in roughly the range (now + time_forwardable,
3204 * now + 5*time_forwardable).
3206 uint64_t time_forwardable;
3207 } LDKEvent_LDKPendingHTLCsForwardable_Body;
3209 typedef struct LDKEvent_LDKSpendableOutputs_Body {
3211 * The outputs which you should store as spendable by you.
3213 struct LDKCVec_SpendableOutputDescriptorZ outputs;
3214 } LDKEvent_LDKSpendableOutputs_Body;
3216 typedef struct LDKEvent_LDKPaymentForwarded_Body {
3218 * The incoming channel between the previous node and us. This is only `None` for events
3219 * generated or serialized by versions prior to 0.0.107.
3221 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3223 struct LDKThirtyTwoBytes prev_channel_id;
3225 * The outgoing channel between the next node and us. This is only `None` for events
3226 * generated or serialized by versions prior to 0.0.107.
3228 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3230 struct LDKThirtyTwoBytes next_channel_id;
3232 * The fee, in milli-satoshis, which was earned as a result of the payment.
3234 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
3235 * was pending, the amount the next hop claimed will have been rounded down to the nearest
3236 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
3237 * claimed the full value in millisatoshis from the source. In this case,
3238 * `claim_from_onchain_tx` will be set.
3240 * If the channel which sent us the payment has been force-closed, we will claim the funds
3241 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
3242 * fees which we will spend and will instead set this to `None`. It is possible duplicate
3243 * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
3246 struct LDKCOption_u64Z fee_earned_msat;
3248 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
3251 bool claim_from_onchain_tx;
3252 } LDKEvent_LDKPaymentForwarded_Body;
3254 typedef struct LDKEvent_LDKChannelClosed_Body {
3256 * The channel_id of the channel which has been closed. Note that on-chain transactions
3257 * resolving the channel are likely still awaiting confirmation.
3259 struct LDKThirtyTwoBytes channel_id;
3261 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
3262 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
3263 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
3264 * `user_channel_id` will be 0 for an inbound channel.
3265 * This will always be zero for objects serialized with LDK versions prior to 0.0.102.
3267 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
3268 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3269 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
3271 uint64_t user_channel_id;
3273 * The reason the channel was closed.
3275 struct LDKClosureReason reason;
3276 } LDKEvent_LDKChannelClosed_Body;
3278 typedef struct LDKEvent_LDKDiscardFunding_Body {
3280 * The channel_id of the channel which has been closed.
3282 struct LDKThirtyTwoBytes channel_id;
3284 * The full transaction received from the user
3286 struct LDKTransaction transaction;
3287 } LDKEvent_LDKDiscardFunding_Body;
3289 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
3291 * The temporary channel ID of the channel requested to be opened.
3293 * When responding to the request, the `temporary_channel_id` should be passed
3294 * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
3295 * or through [`ChannelManager::force_close_channel`] to reject.
3297 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3298 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel
3300 struct LDKThirtyTwoBytes temporary_channel_id;
3302 * The node_id of the counterparty requesting to open the channel.
3304 * When responding to the request, the `counterparty_node_id` should be passed
3305 * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
3306 * accept the request, or through [`ChannelManager::force_close_channel`] to reject the
3309 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3310 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel
3312 struct LDKPublicKey counterparty_node_id;
3314 * The channel value of the requested channel.
3316 uint64_t funding_satoshis;
3318 * Our starting balance in the channel if the request is accepted, in milli-satoshi.
3322 * The features that this channel will operate with. If you reject the channel, a
3323 * well-behaved counterparty may automatically re-attempt the channel with a new set of
3326 * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
3327 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
3330 * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
3331 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
3332 * 0.0.107. Channels setting this type also need to get manually accepted via
3333 * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
3334 * or will be rejected otherwise.
3336 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3338 struct LDKChannelTypeFeatures channel_type;
3339 } LDKEvent_LDKOpenChannelRequest_Body;
3341 typedef struct MUST_USE_STRUCT LDKEvent {
3344 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
3345 LDKEvent_LDKPaymentReceived_Body payment_received;
3346 LDKEvent_LDKPaymentClaimed_Body payment_claimed;
3347 LDKEvent_LDKPaymentSent_Body payment_sent;
3348 LDKEvent_LDKPaymentFailed_Body payment_failed;
3349 LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
3350 LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
3351 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
3352 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
3353 LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
3354 LDKEvent_LDKChannelClosed_Body channel_closed;
3355 LDKEvent_LDKDiscardFunding_Body discard_funding;
3356 LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
3361 * An enum which can either contain a crate::lightning::util::events::Event or not
3363 typedef enum LDKCOption_EventZ_Tag {
3365 * When we're in this state, this COption_EventZ contains a crate::lightning::util::events::Event
3367 LDKCOption_EventZ_Some,
3369 * When we're in this state, this COption_EventZ contains nothing
3371 LDKCOption_EventZ_None,
3373 * Must be last for serialization purposes
3375 LDKCOption_EventZ_Sentinel,
3376 } LDKCOption_EventZ_Tag;
3378 typedef struct LDKCOption_EventZ {
3379 LDKCOption_EventZ_Tag tag;
3382 struct LDKEvent some;
3385 } LDKCOption_EventZ;
3388 * The contents of CResult_COption_EventZDecodeErrorZ
3390 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
3392 * A pointer to the contents in the success state.
3393 * Reading from this pointer when `result_ok` is not set is undefined.
3395 struct LDKCOption_EventZ *result;
3397 * A pointer to the contents in the error state.
3398 * Reading from this pointer when `result_ok` is set is undefined.
3400 struct LDKDecodeError *err;
3401 } LDKCResult_COption_EventZDecodeErrorZPtr;
3404 * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
3405 * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
3406 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3408 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
3410 * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
3411 * `err` or `result` depending on the state of `result_ok`.
3413 union LDKCResult_COption_EventZDecodeErrorZPtr contents;
3415 * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
3418 } LDKCResult_COption_EventZDecodeErrorZ;
3423 * An accept_channel message to be sent or received from a peer
3425 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
3427 * A pointer to the opaque Rust object.
3428 * Nearly everywhere, inner must be non-null, however in places where
3429 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3431 LDKnativeAcceptChannel *inner;
3433 * Indicates that this is the only struct which contains the same pointer.
3434 * Rust functions which take ownership of an object provided via an argument require
3435 * this to be true and invalidate the object pointed to by inner.
3443 * An open_channel message to be sent or received from a peer
3445 typedef struct MUST_USE_STRUCT LDKOpenChannel {
3447 * A pointer to the opaque Rust object.
3448 * Nearly everywhere, inner must be non-null, however in places where
3449 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3451 LDKnativeOpenChannel *inner;
3453 * Indicates that this is the only struct which contains the same pointer.
3454 * Rust functions which take ownership of an object provided via an argument require
3455 * this to be true and invalidate the object pointed to by inner.
3463 * A funding_created message to be sent or received from a peer
3465 typedef struct MUST_USE_STRUCT LDKFundingCreated {
3467 * A pointer to the opaque Rust object.
3468 * Nearly everywhere, inner must be non-null, however in places where
3469 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3471 LDKnativeFundingCreated *inner;
3473 * Indicates that this is the only struct which contains the same pointer.
3474 * Rust functions which take ownership of an object provided via an argument require
3475 * this to be true and invalidate the object pointed to by inner.
3478 } LDKFundingCreated;
3483 * A funding_signed message to be sent or received from a peer
3485 typedef struct MUST_USE_STRUCT LDKFundingSigned {
3487 * A pointer to the opaque Rust object.
3488 * Nearly everywhere, inner must be non-null, however in places where
3489 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3491 LDKnativeFundingSigned *inner;
3493 * Indicates that this is the only struct which contains the same pointer.
3494 * Rust functions which take ownership of an object provided via an argument require
3495 * this to be true and invalidate the object pointed to by inner.
3503 * A channel_ready message to be sent or received from a peer
3505 typedef struct MUST_USE_STRUCT LDKChannelReady {
3507 * A pointer to the opaque Rust object.
3508 * Nearly everywhere, inner must be non-null, however in places where
3509 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3511 LDKnativeChannelReady *inner;
3513 * Indicates that this is the only struct which contains the same pointer.
3514 * Rust functions which take ownership of an object provided via an argument require
3515 * this to be true and invalidate the object pointed to by inner.
3523 * An announcement_signatures message to be sent or received from a peer
3525 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
3527 * A pointer to the opaque Rust object.
3528 * Nearly everywhere, inner must be non-null, however in places where
3529 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3531 LDKnativeAnnouncementSignatures *inner;
3533 * Indicates that this is the only struct which contains the same pointer.
3534 * Rust functions which take ownership of an object provided via an argument require
3535 * this to be true and invalidate the object pointed to by inner.
3538 } LDKAnnouncementSignatures;
3543 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
3544 * transaction updates if they were pending.
3546 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
3548 * A pointer to the opaque Rust object.
3549 * Nearly everywhere, inner must be non-null, however in places where
3550 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3552 LDKnativeCommitmentUpdate *inner;
3554 * Indicates that this is the only struct which contains the same pointer.
3555 * Rust functions which take ownership of an object provided via an argument require
3556 * this to be true and invalidate the object pointed to by inner.
3559 } LDKCommitmentUpdate;
3564 * A revoke_and_ack message to be sent or received from a peer
3566 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
3568 * A pointer to the opaque Rust object.
3569 * Nearly everywhere, inner must be non-null, however in places where
3570 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3572 LDKnativeRevokeAndACK *inner;
3574 * Indicates that this is the only struct which contains the same pointer.
3575 * Rust functions which take ownership of an object provided via an argument require
3576 * this to be true and invalidate the object pointed to by inner.
3584 * A closing_signed message to be sent or received from a peer
3586 typedef struct MUST_USE_STRUCT LDKClosingSigned {
3588 * A pointer to the opaque Rust object.
3589 * Nearly everywhere, inner must be non-null, however in places where
3590 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3592 LDKnativeClosingSigned *inner;
3594 * Indicates that this is the only struct which contains the same pointer.
3595 * Rust functions which take ownership of an object provided via an argument require
3596 * this to be true and invalidate the object pointed to by inner.
3604 * A shutdown message to be sent or received from a peer
3606 typedef struct MUST_USE_STRUCT LDKShutdown {
3608 * A pointer to the opaque Rust object.
3609 * Nearly everywhere, inner must be non-null, however in places where
3610 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3612 LDKnativeShutdown *inner;
3614 * Indicates that this is the only struct which contains the same pointer.
3615 * Rust functions which take ownership of an object provided via an argument require
3616 * this to be true and invalidate the object pointed to by inner.
3624 * A channel_reestablish message to be sent or received from a peer
3626 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
3628 * A pointer to the opaque Rust object.
3629 * Nearly everywhere, inner must be non-null, however in places where
3630 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3632 LDKnativeChannelReestablish *inner;
3634 * Indicates that this is the only struct which contains the same pointer.
3635 * Rust functions which take ownership of an object provided via an argument require
3636 * this to be true and invalidate the object pointed to by inner.
3639 } LDKChannelReestablish;
3644 * A channel_announcement message to be sent or received from a peer
3646 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
3648 * A pointer to the opaque Rust object.
3649 * Nearly everywhere, inner must be non-null, however in places where
3650 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3652 LDKnativeChannelAnnouncement *inner;
3654 * Indicates that this is the only struct which contains the same pointer.
3655 * Rust functions which take ownership of an object provided via an argument require
3656 * this to be true and invalidate the object pointed to by inner.
3659 } LDKChannelAnnouncement;
3664 * A node_announcement message to be sent or received from a peer
3666 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
3668 * A pointer to the opaque Rust object.
3669 * Nearly everywhere, inner must be non-null, however in places where
3670 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3672 LDKnativeNodeAnnouncement *inner;
3674 * Indicates that this is the only struct which contains the same pointer.
3675 * Rust functions which take ownership of an object provided via an argument require
3676 * this to be true and invalidate the object pointed to by inner.
3679 } LDKNodeAnnouncement;
3684 * An error message to be sent or received from a peer
3686 typedef struct MUST_USE_STRUCT LDKErrorMessage {
3688 * A pointer to the opaque Rust object.
3689 * Nearly everywhere, inner must be non-null, however in places where
3690 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3692 LDKnativeErrorMessage *inner;
3694 * Indicates that this is the only struct which contains the same pointer.
3695 * Rust functions which take ownership of an object provided via an argument require
3696 * this to be true and invalidate the object pointed to by inner.
3704 * A warning message to be sent or received from a peer
3706 typedef struct MUST_USE_STRUCT LDKWarningMessage {
3708 * A pointer to the opaque Rust object.
3709 * Nearly everywhere, inner must be non-null, however in places where
3710 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3712 LDKnativeWarningMessage *inner;
3714 * Indicates that this is the only struct which contains the same pointer.
3715 * Rust functions which take ownership of an object provided via an argument require
3716 * this to be true and invalidate the object pointed to by inner.
3719 } LDKWarningMessage;
3722 * Used to put an error message in a LightningError
3724 typedef enum LDKErrorAction_Tag {
3726 * The peer took some action which made us think they were useless. Disconnect them.
3728 LDKErrorAction_DisconnectPeer,
3730 * The peer did something harmless that we weren't able to process, just log and ignore
3732 LDKErrorAction_IgnoreError,
3734 * The peer did something harmless that we weren't able to meaningfully process.
3735 * If the error is logged, log it at the given level.
3737 LDKErrorAction_IgnoreAndLog,
3739 * The peer provided us with a gossip message which we'd already seen. In most cases this
3740 * should be ignored, but it may result in the message being forwarded if it is a duplicate of
3741 * our own channel announcements.
3743 LDKErrorAction_IgnoreDuplicateGossip,
3745 * The peer did something incorrect. Tell them.
3747 LDKErrorAction_SendErrorMessage,
3749 * The peer did something incorrect. Tell them without closing any channels.
3751 LDKErrorAction_SendWarningMessage,
3753 * Must be last for serialization purposes
3755 LDKErrorAction_Sentinel,
3756 } LDKErrorAction_Tag;
3758 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
3760 * An error message which we should make an effort to send before we disconnect.
3762 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3764 struct LDKErrorMessage msg;
3765 } LDKErrorAction_LDKDisconnectPeer_Body;
3767 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
3769 * The message to send.
3771 struct LDKErrorMessage msg;
3772 } LDKErrorAction_LDKSendErrorMessage_Body;
3774 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
3776 * The message to send.
3778 struct LDKWarningMessage msg;
3780 * The peer may have done something harmless that we weren't able to meaningfully process,
3781 * though we should still tell them about it.
3782 * If this event is logged, log it at the given level.
3784 enum LDKLevel log_level;
3785 } LDKErrorAction_LDKSendWarningMessage_Body;
3787 typedef struct MUST_USE_STRUCT LDKErrorAction {
3788 LDKErrorAction_Tag tag;
3790 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
3792 enum LDKLevel ignore_and_log;
3794 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
3795 LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
3802 * A query_channel_range message is used to query a peer for channel
3803 * UTXOs in a range of blocks. The recipient of a query makes a best
3804 * effort to reply to the query using one or more reply_channel_range
3807 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
3809 * A pointer to the opaque Rust object.
3810 * Nearly everywhere, inner must be non-null, however in places where
3811 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3813 LDKnativeQueryChannelRange *inner;
3815 * Indicates that this is the only struct which contains the same pointer.
3816 * Rust functions which take ownership of an object provided via an argument require
3817 * this to be true and invalidate the object pointed to by inner.
3820 } LDKQueryChannelRange;
3825 * A query_short_channel_ids message is used to query a peer for
3826 * routing gossip messages related to one or more short_channel_ids.
3827 * The query recipient will reply with the latest, if available,
3828 * channel_announcement, channel_update and node_announcement messages
3829 * it maintains for the requested short_channel_ids followed by a
3830 * reply_short_channel_ids_end message. The short_channel_ids sent in
3831 * this query are encoded. We only support encoding_type=0 uncompressed
3832 * serialization and do not support encoding_type=1 zlib serialization.
3834 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
3836 * A pointer to the opaque Rust object.
3837 * Nearly everywhere, inner must be non-null, however in places where
3838 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3840 LDKnativeQueryShortChannelIds *inner;
3842 * Indicates that this is the only struct which contains the same pointer.
3843 * Rust functions which take ownership of an object provided via an argument require
3844 * this to be true and invalidate the object pointed to by inner.
3847 } LDKQueryShortChannelIds;
3852 * A reply_channel_range message is a reply to a query_channel_range
3853 * message. Multiple reply_channel_range messages can be sent in reply
3854 * to a single query_channel_range message. The query recipient makes a
3855 * best effort to respond based on their local network view which may
3856 * not be a perfect view of the network. The short_channel_ids in the
3857 * reply are encoded. We only support encoding_type=0 uncompressed
3858 * serialization and do not support encoding_type=1 zlib serialization.
3860 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
3862 * A pointer to the opaque Rust object.
3863 * Nearly everywhere, inner must be non-null, however in places where
3864 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3866 LDKnativeReplyChannelRange *inner;
3868 * Indicates that this is the only struct which contains the same pointer.
3869 * Rust functions which take ownership of an object provided via an argument require
3870 * this to be true and invalidate the object pointed to by inner.
3873 } LDKReplyChannelRange;
3878 * A gossip_timestamp_filter message is used by a node to request
3879 * gossip relay for messages in the requested time range when the
3880 * gossip_queries feature has been negotiated.
3882 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
3884 * A pointer to the opaque Rust object.
3885 * Nearly everywhere, inner must be non-null, however in places where
3886 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3888 LDKnativeGossipTimestampFilter *inner;
3890 * Indicates that this is the only struct which contains the same pointer.
3891 * Rust functions which take ownership of an object provided via an argument require
3892 * this to be true and invalidate the object pointed to by inner.
3895 } LDKGossipTimestampFilter;
3898 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
3899 * broadcast to most peers).
3900 * These events are handled by PeerManager::process_events if you are using a PeerManager.
3902 typedef enum LDKMessageSendEvent_Tag {
3904 * Used to indicate that we've accepted a channel open and should send the accept_channel
3905 * message provided to the given peer.
3907 LDKMessageSendEvent_SendAcceptChannel,
3909 * Used to indicate that we've initiated a channel open and should send the open_channel
3910 * message provided to the given peer.
3912 LDKMessageSendEvent_SendOpenChannel,
3914 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
3916 LDKMessageSendEvent_SendFundingCreated,
3918 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
3920 LDKMessageSendEvent_SendFundingSigned,
3922 * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
3924 LDKMessageSendEvent_SendChannelReady,
3926 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
3928 LDKMessageSendEvent_SendAnnouncementSignatures,
3930 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
3931 * message should be sent to the peer with the given node_id.
3933 LDKMessageSendEvent_UpdateHTLCs,
3935 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
3937 LDKMessageSendEvent_SendRevokeAndACK,
3939 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
3941 LDKMessageSendEvent_SendClosingSigned,
3943 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
3945 LDKMessageSendEvent_SendShutdown,
3947 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
3949 LDKMessageSendEvent_SendChannelReestablish,
3951 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
3952 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
3954 * Note that after doing so, you very likely (unless you did so very recently) want to call
3955 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
3956 * This ensures that any nodes which see our channel_announcement also have a relevant
3957 * node_announcement, including relevant feature flags which may be important for routing
3960 LDKMessageSendEvent_BroadcastChannelAnnouncement,
3962 * Used to indicate that a node_announcement should be broadcast to all peers.
3964 LDKMessageSendEvent_BroadcastNodeAnnouncement,
3966 * Used to indicate that a channel_update should be broadcast to all peers.
3968 LDKMessageSendEvent_BroadcastChannelUpdate,
3970 * Used to indicate that a channel_update should be sent to a single peer.
3971 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
3972 * private channel and we shouldn't be informing all of our peers of channel parameters.
3974 LDKMessageSendEvent_SendChannelUpdate,
3976 * Broadcast an error downstream to be handled
3978 LDKMessageSendEvent_HandleError,
3980 * Query a peer for channels with funding transaction UTXOs in a block range.
3982 LDKMessageSendEvent_SendChannelRangeQuery,
3984 * Request routing gossip messages from a peer for a list of channels identified by
3985 * their short_channel_ids.
3987 LDKMessageSendEvent_SendShortIdsQuery,
3989 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
3990 * emitted during processing of the query.
3992 LDKMessageSendEvent_SendReplyChannelRange,
3994 * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
3995 * enable receiving gossip messages from the peer.
3997 LDKMessageSendEvent_SendGossipTimestampFilter,
3999 * Must be last for serialization purposes
4001 LDKMessageSendEvent_Sentinel,
4002 } LDKMessageSendEvent_Tag;
4004 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
4006 * The node_id of the node which should receive this message
4008 struct LDKPublicKey node_id;
4010 * The message which should be sent.
4012 struct LDKAcceptChannel msg;
4013 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
4015 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
4017 * The node_id of the node which should receive this message
4019 struct LDKPublicKey node_id;
4021 * The message which should be sent.
4023 struct LDKOpenChannel msg;
4024 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
4026 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
4028 * The node_id of the node which should receive this message
4030 struct LDKPublicKey node_id;
4032 * The message which should be sent.
4034 struct LDKFundingCreated msg;
4035 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
4037 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
4039 * The node_id of the node which should receive this message
4041 struct LDKPublicKey node_id;
4043 * The message which should be sent.
4045 struct LDKFundingSigned msg;
4046 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
4048 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
4050 * The node_id of the node which should receive these message(s)
4052 struct LDKPublicKey node_id;
4054 * The channel_ready message which should be sent.
4056 struct LDKChannelReady msg;
4057 } LDKMessageSendEvent_LDKSendChannelReady_Body;
4059 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
4061 * The node_id of the node which should receive these message(s)
4063 struct LDKPublicKey node_id;
4065 * The announcement_signatures message which should be sent.
4067 struct LDKAnnouncementSignatures msg;
4068 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
4070 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
4072 * The node_id of the node which should receive these message(s)
4074 struct LDKPublicKey node_id;
4076 * The update messages which should be sent. ALL messages in the struct should be sent!
4078 struct LDKCommitmentUpdate updates;
4079 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
4081 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
4083 * The node_id of the node which should receive this message
4085 struct LDKPublicKey node_id;
4087 * The message which should be sent.
4089 struct LDKRevokeAndACK msg;
4090 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
4092 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
4094 * The node_id of the node which should receive this message
4096 struct LDKPublicKey node_id;
4098 * The message which should be sent.
4100 struct LDKClosingSigned msg;
4101 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
4103 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
4105 * The node_id of the node which should receive this message
4107 struct LDKPublicKey node_id;
4109 * The message which should be sent.
4111 struct LDKShutdown msg;
4112 } LDKMessageSendEvent_LDKSendShutdown_Body;
4114 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
4116 * The node_id of the node which should receive this message
4118 struct LDKPublicKey node_id;
4120 * The message which should be sent.
4122 struct LDKChannelReestablish msg;
4123 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
4125 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
4127 * The channel_announcement which should be sent.
4129 struct LDKChannelAnnouncement msg;
4131 * The followup channel_update which should be sent.
4133 struct LDKChannelUpdate update_msg;
4134 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
4136 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
4138 * The node_announcement which should be sent.
4140 struct LDKNodeAnnouncement msg;
4141 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
4143 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
4145 * The channel_update which should be sent.
4147 struct LDKChannelUpdate msg;
4148 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
4150 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
4152 * The node_id of the node which should receive this message
4154 struct LDKPublicKey node_id;
4156 * The channel_update which should be sent.
4158 struct LDKChannelUpdate msg;
4159 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
4161 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
4163 * The node_id of the node which should receive this message
4165 struct LDKPublicKey node_id;
4167 * The action which should be taken.
4169 struct LDKErrorAction action;
4170 } LDKMessageSendEvent_LDKHandleError_Body;
4172 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
4174 * The node_id of this message recipient
4176 struct LDKPublicKey node_id;
4178 * The query_channel_range which should be sent.
4180 struct LDKQueryChannelRange msg;
4181 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
4183 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
4185 * The node_id of this message recipient
4187 struct LDKPublicKey node_id;
4189 * The query_short_channel_ids which should be sent.
4191 struct LDKQueryShortChannelIds msg;
4192 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
4194 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
4196 * The node_id of this message recipient
4198 struct LDKPublicKey node_id;
4200 * The reply_channel_range which should be sent.
4202 struct LDKReplyChannelRange msg;
4203 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
4205 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
4207 * The node_id of this message recipient
4209 struct LDKPublicKey node_id;
4211 * The gossip_timestamp_filter which should be sent.
4213 struct LDKGossipTimestampFilter msg;
4214 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
4216 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
4217 LDKMessageSendEvent_Tag tag;
4219 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
4220 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
4221 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
4222 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
4223 LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
4224 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
4225 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
4226 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
4227 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
4228 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
4229 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
4230 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
4231 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
4232 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
4233 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
4234 LDKMessageSendEvent_LDKHandleError_Body handle_error;
4235 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
4236 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
4237 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
4238 LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
4240 } LDKMessageSendEvent;
4243 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
4244 * This corresponds to std::vector in C++
4246 typedef struct LDKCVec_MessageSendEventZ {
4248 * The elements in the array.
4249 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4251 struct LDKMessageSendEvent *data;
4253 * The number of elements pointed to by `data`.
4256 } LDKCVec_MessageSendEventZ;
4259 * The contents of CResult_TxOutAccessErrorZ
4261 typedef union LDKCResult_TxOutAccessErrorZPtr {
4263 * A pointer to the contents in the success state.
4264 * Reading from this pointer when `result_ok` is not set is undefined.
4266 struct LDKTxOut *result;
4268 * A pointer to the contents in the error state.
4269 * Reading from this pointer when `result_ok` is set is undefined.
4271 enum LDKAccessError *err;
4272 } LDKCResult_TxOutAccessErrorZPtr;
4275 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
4276 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
4277 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4279 typedef struct LDKCResult_TxOutAccessErrorZ {
4281 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
4282 * `err` or `result` depending on the state of `result_ok`.
4284 union LDKCResult_TxOutAccessErrorZPtr contents;
4286 * Whether this CResult_TxOutAccessErrorZ represents a success state.
4289 } LDKCResult_TxOutAccessErrorZ;
4292 * A tuple of 2 elements. See the individual fields for the types contained.
4294 typedef struct LDKC2Tuple_usizeTransactionZ {
4296 * The element at position 0
4300 * The element at position 1
4302 struct LDKTransaction b;
4303 } LDKC2Tuple_usizeTransactionZ;
4306 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
4307 * This corresponds to std::vector in C++
4309 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
4311 * The elements in the array.
4312 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4314 struct LDKC2Tuple_usizeTransactionZ *data;
4316 * The number of elements pointed to by `data`.
4319 } LDKCVec_C2Tuple_usizeTransactionZZ;
4322 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
4323 * This corresponds to std::vector in C++
4325 typedef struct LDKCVec_TxidZ {
4327 * The elements in the array.
4328 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4330 struct LDKThirtyTwoBytes *data;
4332 * The number of elements pointed to by `data`.
4338 * The contents of CResult_NoneChannelMonitorUpdateErrZ
4340 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
4342 * Note that this value is always NULL, as there are no contents in the OK variant
4346 * A pointer to the contents in the error state.
4347 * Reading from this pointer when `result_ok` is set is undefined.
4349 enum LDKChannelMonitorUpdateErr *err;
4350 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
4353 * A CResult_NoneChannelMonitorUpdateErrZ represents the result of a fallible operation,
4354 * containing a () on success and a crate::lightning::chain::ChannelMonitorUpdateErr on failure.
4355 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4357 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
4359 * The contents of this CResult_NoneChannelMonitorUpdateErrZ, accessible via either
4360 * `err` or `result` depending on the state of `result_ok`.
4362 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
4364 * Whether this CResult_NoneChannelMonitorUpdateErrZ represents a success state.
4367 } LDKCResult_NoneChannelMonitorUpdateErrZ;
4372 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
4373 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
4374 * preimage claim backward will lead to loss of funds.
4376 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
4378 * A pointer to the opaque Rust object.
4379 * Nearly everywhere, inner must be non-null, however in places where
4380 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4382 LDKnativeHTLCUpdate *inner;
4384 * Indicates that this is the only struct which contains the same pointer.
4385 * Rust functions which take ownership of an object provided via an argument require
4386 * this to be true and invalidate the object pointed to by inner.
4392 * An event to be processed by the ChannelManager.
4394 typedef enum LDKMonitorEvent_Tag {
4396 * A monitor event containing an HTLCUpdate.
4398 LDKMonitorEvent_HTLCEvent,
4400 * A monitor event that the Channel's commitment transaction was confirmed.
4402 LDKMonitorEvent_CommitmentTxConfirmed,
4404 * Indicates a [`ChannelMonitor`] update has completed. See
4405 * [`ChannelMonitorUpdateErr::TemporaryFailure`] for more information on how this is used.
4407 * [`ChannelMonitorUpdateErr::TemporaryFailure`]: super::ChannelMonitorUpdateErr::TemporaryFailure
4409 LDKMonitorEvent_UpdateCompleted,
4411 * Indicates a [`ChannelMonitor`] update has failed. See
4412 * [`ChannelMonitorUpdateErr::PermanentFailure`] for more information on how this is used.
4414 * [`ChannelMonitorUpdateErr::PermanentFailure`]: super::ChannelMonitorUpdateErr::PermanentFailure
4416 LDKMonitorEvent_UpdateFailed,
4418 * Must be last for serialization purposes
4420 LDKMonitorEvent_Sentinel,
4421 } LDKMonitorEvent_Tag;
4423 typedef struct LDKMonitorEvent_LDKUpdateCompleted_Body {
4425 * The funding outpoint of the [`ChannelMonitor`] that was updated
4427 struct LDKOutPoint funding_txo;
4429 * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
4430 * [`ChannelMonitor::get_latest_update_id`].
4432 * Note that this should only be set to a given update's ID if all previous updates for the
4433 * same [`ChannelMonitor`] have been applied and persisted.
4435 uint64_t monitor_update_id;
4436 } LDKMonitorEvent_LDKUpdateCompleted_Body;
4438 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
4439 LDKMonitorEvent_Tag tag;
4442 struct LDKHTLCUpdate htlc_event;
4445 struct LDKOutPoint commitment_tx_confirmed;
4447 LDKMonitorEvent_LDKUpdateCompleted_Body update_completed;
4449 struct LDKOutPoint update_failed;
4455 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
4456 * This corresponds to std::vector in C++
4458 typedef struct LDKCVec_MonitorEventZ {
4460 * The elements in the array.
4461 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4463 struct LDKMonitorEvent *data;
4465 * The number of elements pointed to by `data`.
4468 } LDKCVec_MonitorEventZ;
4471 * A tuple of 2 elements. See the individual fields for the types contained.
4473 typedef struct LDKC2Tuple_OutPointCVec_MonitorEventZZ {
4475 * The element at position 0
4477 struct LDKOutPoint a;
4479 * The element at position 1
4481 struct LDKCVec_MonitorEventZ b;
4482 } LDKC2Tuple_OutPointCVec_MonitorEventZZ;
4485 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointCVec_MonitorEventZZs of arbitrary size.
4486 * This corresponds to std::vector in C++
4488 typedef struct LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ {
4490 * The elements in the array.
4491 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4493 struct LDKC2Tuple_OutPointCVec_MonitorEventZZ *data;
4495 * The number of elements pointed to by `data`.
4498 } LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ;
4501 * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not
4503 typedef enum LDKCOption_C2Tuple_usizeTransactionZZ_Tag {
4505 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ
4507 LDKCOption_C2Tuple_usizeTransactionZZ_Some,
4509 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing
4511 LDKCOption_C2Tuple_usizeTransactionZZ_None,
4513 * Must be last for serialization purposes
4515 LDKCOption_C2Tuple_usizeTransactionZZ_Sentinel,
4516 } LDKCOption_C2Tuple_usizeTransactionZZ_Tag;
4518 typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
4519 LDKCOption_C2Tuple_usizeTransactionZZ_Tag tag;
4522 struct LDKC2Tuple_usizeTransactionZ some;
4525 } LDKCOption_C2Tuple_usizeTransactionZZ;
4530 * [`Score`] implementation that uses a fixed penalty.
4532 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
4534 * A pointer to the opaque Rust object.
4535 * Nearly everywhere, inner must be non-null, however in places where
4536 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4538 LDKnativeFixedPenaltyScorer *inner;
4540 * Indicates that this is the only struct which contains the same pointer.
4541 * Rust functions which take ownership of an object provided via an argument require
4542 * this to be true and invalidate the object pointed to by inner.
4545 } LDKFixedPenaltyScorer;
4548 * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
4550 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
4552 * A pointer to the contents in the success state.
4553 * Reading from this pointer when `result_ok` is not set is undefined.
4555 struct LDKFixedPenaltyScorer *result;
4557 * A pointer to the contents in the error state.
4558 * Reading from this pointer when `result_ok` is set is undefined.
4560 struct LDKDecodeError *err;
4561 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
4564 * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
4565 * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4566 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4568 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
4570 * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
4571 * `err` or `result` depending on the state of `result_ok`.
4573 union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
4575 * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
4578 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
4583 * A Record, unit of logging output with Metadata to enable filtering
4584 * Module_path, file, line to inform on log's source
4586 typedef struct MUST_USE_STRUCT LDKRecord {
4588 * A pointer to the opaque Rust object.
4589 * Nearly everywhere, inner must be non-null, however in places where
4590 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4592 LDKnativeRecord *inner;
4594 * Indicates that this is the only struct which contains the same pointer.
4595 * Rust functions which take ownership of an object provided via an argument require
4596 * this to be true and invalidate the object pointed to by inner.
4602 * A trait encapsulating the operations required of a logger
4604 typedef struct LDKLogger {
4606 * An opaque pointer which is passed to your function implementations as an argument.
4607 * This has no meaning in the LDK, and can be NULL or any other value.
4613 void (*log)(const void *this_arg, const struct LDKRecord *NONNULL_PTR record);
4615 * Frees any resources associated with this object given its this_arg pointer.
4616 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4618 void (*free)(void *this_arg);
4624 * Represents the network as nodes and channels between them
4626 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4628 * A pointer to the opaque Rust object.
4629 * Nearly everywhere, inner must be non-null, however in places where
4630 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4632 LDKnativeNetworkGraph *inner;
4634 * Indicates that this is the only struct which contains the same pointer.
4635 * Rust functions which take ownership of an object provided via an argument require
4636 * this to be true and invalidate the object pointed to by inner.
4644 * [`Score`] implementation using channel success probability distributions.
4646 * Based on *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
4647 * and Stefan Richter [[1]]. Given the uncertainty of channel liquidity balances, probability
4648 * distributions are defined based on knowledge learned from successful and unsuccessful attempts.
4649 * Then the negative `log10` of the success probability is used to determine the cost of routing a
4650 * specific HTLC amount through a channel.
4652 * Knowledge about channel liquidity balances takes the form of upper and lower bounds on the
4653 * possible liquidity. Certainty of the bounds is decreased over time using a decay function. See
4654 * [`ProbabilisticScoringParameters`] for details.
4656 * Since the scorer aims to learn the current channel liquidity balances, it works best for nodes
4657 * with high payment volume or that actively probe the [`NetworkGraph`]. Nodes with low payment
4658 * volume are more likely to experience failed payment paths, which would need to be retried.
4662 * Mixing the `no-std` feature between serialization and deserialization results in undefined
4665 * [1]: https://arxiv.org/abs/2107.05322
4667 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
4669 * A pointer to the opaque Rust object.
4670 * Nearly everywhere, inner must be non-null, however in places where
4671 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4673 LDKnativeProbabilisticScorer *inner;
4675 * Indicates that this is the only struct which contains the same pointer.
4676 * Rust functions which take ownership of an object provided via an argument require
4677 * this to be true and invalidate the object pointed to by inner.
4680 } LDKProbabilisticScorer;
4683 * The contents of CResult_ProbabilisticScorerDecodeErrorZ
4685 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
4687 * A pointer to the contents in the success state.
4688 * Reading from this pointer when `result_ok` is not set is undefined.
4690 struct LDKProbabilisticScorer *result;
4692 * A pointer to the contents in the error state.
4693 * Reading from this pointer when `result_ok` is set is undefined.
4695 struct LDKDecodeError *err;
4696 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
4699 * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
4700 * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4701 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4703 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
4705 * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
4706 * `err` or `result` depending on the state of `result_ok`.
4708 union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
4710 * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
4713 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
4718 * Features used within an `init` message.
4720 typedef struct MUST_USE_STRUCT LDKInitFeatures {
4722 * A pointer to the opaque Rust object.
4723 * Nearly everywhere, inner must be non-null, however in places where
4724 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4726 LDKnativeInitFeatures *inner;
4728 * Indicates that this is the only struct which contains the same pointer.
4729 * Rust functions which take ownership of an object provided via an argument require
4730 * this to be true and invalidate the object pointed to by inner.
4736 * The contents of CResult_InitFeaturesDecodeErrorZ
4738 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
4740 * A pointer to the contents in the success state.
4741 * Reading from this pointer when `result_ok` is not set is undefined.
4743 struct LDKInitFeatures *result;
4745 * A pointer to the contents in the error state.
4746 * Reading from this pointer when `result_ok` is set is undefined.
4748 struct LDKDecodeError *err;
4749 } LDKCResult_InitFeaturesDecodeErrorZPtr;
4752 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
4753 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4754 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4756 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
4758 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
4759 * `err` or `result` depending on the state of `result_ok`.
4761 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
4763 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
4766 } LDKCResult_InitFeaturesDecodeErrorZ;
4771 * Features used within a `channel_announcement` message.
4773 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
4775 * A pointer to the opaque Rust object.
4776 * Nearly everywhere, inner must be non-null, however in places where
4777 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4779 LDKnativeChannelFeatures *inner;
4781 * Indicates that this is the only struct which contains the same pointer.
4782 * Rust functions which take ownership of an object provided via an argument require
4783 * this to be true and invalidate the object pointed to by inner.
4786 } LDKChannelFeatures;
4789 * The contents of CResult_ChannelFeaturesDecodeErrorZ
4791 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
4793 * A pointer to the contents in the success state.
4794 * Reading from this pointer when `result_ok` is not set is undefined.
4796 struct LDKChannelFeatures *result;
4798 * A pointer to the contents in the error state.
4799 * Reading from this pointer when `result_ok` is set is undefined.
4801 struct LDKDecodeError *err;
4802 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
4805 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
4806 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4807 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4809 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
4811 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
4812 * `err` or `result` depending on the state of `result_ok`.
4814 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
4816 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
4819 } LDKCResult_ChannelFeaturesDecodeErrorZ;
4824 * Features used within a `node_announcement` message.
4826 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
4828 * A pointer to the opaque Rust object.
4829 * Nearly everywhere, inner must be non-null, however in places where
4830 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4832 LDKnativeNodeFeatures *inner;
4834 * Indicates that this is the only struct which contains the same pointer.
4835 * Rust functions which take ownership of an object provided via an argument require
4836 * this to be true and invalidate the object pointed to by inner.
4842 * The contents of CResult_NodeFeaturesDecodeErrorZ
4844 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
4846 * A pointer to the contents in the success state.
4847 * Reading from this pointer when `result_ok` is not set is undefined.
4849 struct LDKNodeFeatures *result;
4851 * A pointer to the contents in the error state.
4852 * Reading from this pointer when `result_ok` is set is undefined.
4854 struct LDKDecodeError *err;
4855 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
4858 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
4859 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4860 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4862 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
4864 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
4865 * `err` or `result` depending on the state of `result_ok`.
4867 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
4869 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
4872 } LDKCResult_NodeFeaturesDecodeErrorZ;
4877 * Features used within an invoice.
4879 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
4881 * A pointer to the opaque Rust object.
4882 * Nearly everywhere, inner must be non-null, however in places where
4883 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4885 LDKnativeInvoiceFeatures *inner;
4887 * Indicates that this is the only struct which contains the same pointer.
4888 * Rust functions which take ownership of an object provided via an argument require
4889 * this to be true and invalidate the object pointed to by inner.
4892 } LDKInvoiceFeatures;
4895 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
4897 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
4899 * A pointer to the contents in the success state.
4900 * Reading from this pointer when `result_ok` is not set is undefined.
4902 struct LDKInvoiceFeatures *result;
4904 * A pointer to the contents in the error state.
4905 * Reading from this pointer when `result_ok` is set is undefined.
4907 struct LDKDecodeError *err;
4908 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
4911 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
4912 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4913 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4915 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
4917 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
4918 * `err` or `result` depending on the state of `result_ok`.
4920 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
4922 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
4925 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
4928 * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
4930 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
4932 * A pointer to the contents in the success state.
4933 * Reading from this pointer when `result_ok` is not set is undefined.
4935 struct LDKChannelTypeFeatures *result;
4937 * A pointer to the contents in the error state.
4938 * Reading from this pointer when `result_ok` is set is undefined.
4940 struct LDKDecodeError *err;
4941 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
4944 * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
4945 * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4946 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4948 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
4950 * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
4951 * `err` or `result` depending on the state of `result_ok`.
4953 union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
4955 * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
4958 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
4961 * The contents of CResult_NodeIdDecodeErrorZ
4963 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
4965 * A pointer to the contents in the success state.
4966 * Reading from this pointer when `result_ok` is not set is undefined.
4968 struct LDKNodeId *result;
4970 * A pointer to the contents in the error state.
4971 * Reading from this pointer when `result_ok` is set is undefined.
4973 struct LDKDecodeError *err;
4974 } LDKCResult_NodeIdDecodeErrorZPtr;
4977 * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
4978 * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
4979 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4981 typedef struct LDKCResult_NodeIdDecodeErrorZ {
4983 * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
4984 * `err` or `result` depending on the state of `result_ok`.
4986 union LDKCResult_NodeIdDecodeErrorZPtr contents;
4988 * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
4991 } LDKCResult_NodeIdDecodeErrorZ;
4994 * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
4996 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
4998 * A pointer to the contents in the success state.
4999 * Reading from this pointer when `result_ok` is not set is undefined.
5001 struct LDKCOption_NetworkUpdateZ *result;
5003 * A pointer to the contents in the error state.
5004 * Reading from this pointer when `result_ok` is set is undefined.
5006 struct LDKDecodeError *err;
5007 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
5010 * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
5011 * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
5012 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5014 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
5016 * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
5017 * `err` or `result` depending on the state of `result_ok`.
5019 union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
5021 * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
5024 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
5027 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
5030 typedef struct LDKAccess {
5032 * An opaque pointer which is passed to your function implementations as an argument.
5033 * This has no meaning in the LDK, and can be NULL or any other value.
5037 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
5038 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
5041 * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
5043 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
5045 * Frees any resources associated with this object given its this_arg pointer.
5046 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5048 void (*free)(void *this_arg);
5052 * An enum which can either contain a crate::lightning::chain::Access or not
5054 typedef enum LDKCOption_AccessZ_Tag {
5056 * When we're in this state, this COption_AccessZ contains a crate::lightning::chain::Access
5058 LDKCOption_AccessZ_Some,
5060 * When we're in this state, this COption_AccessZ contains nothing
5062 LDKCOption_AccessZ_None,
5064 * Must be last for serialization purposes
5066 LDKCOption_AccessZ_Sentinel,
5067 } LDKCOption_AccessZ_Tag;
5069 typedef struct LDKCOption_AccessZ {
5070 LDKCOption_AccessZ_Tag tag;
5073 struct LDKAccess some;
5076 } LDKCOption_AccessZ;
5079 * The contents of CResult_boolLightningErrorZ
5081 typedef union LDKCResult_boolLightningErrorZPtr {
5083 * A pointer to the contents in the success state.
5084 * Reading from this pointer when `result_ok` is not set is undefined.
5088 * A pointer to the contents in the error state.
5089 * Reading from this pointer when `result_ok` is set is undefined.
5091 struct LDKLightningError *err;
5092 } LDKCResult_boolLightningErrorZPtr;
5095 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
5096 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
5097 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5099 typedef struct LDKCResult_boolLightningErrorZ {
5101 * The contents of this CResult_boolLightningErrorZ, accessible via either
5102 * `err` or `result` depending on the state of `result_ok`.
5104 union LDKCResult_boolLightningErrorZPtr contents;
5106 * Whether this CResult_boolLightningErrorZ represents a success state.
5109 } LDKCResult_boolLightningErrorZ;
5112 * A tuple of 3 elements. See the individual fields for the types contained.
5114 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
5116 * The element at position 0
5118 struct LDKChannelAnnouncement a;
5120 * The element at position 1
5122 struct LDKChannelUpdate b;
5124 * The element at position 2
5126 struct LDKChannelUpdate c;
5127 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
5130 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
5131 * This corresponds to std::vector in C++
5133 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
5135 * The elements in the array.
5136 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5138 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
5140 * The number of elements pointed to by `data`.
5143 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
5146 * A dynamically-allocated array of crate::lightning::ln::msgs::NodeAnnouncements of arbitrary size.
5147 * This corresponds to std::vector in C++
5149 typedef struct LDKCVec_NodeAnnouncementZ {
5151 * The elements in the array.
5152 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5154 struct LDKNodeAnnouncement *data;
5156 * The number of elements pointed to by `data`.
5159 } LDKCVec_NodeAnnouncementZ;
5162 * The contents of CResult_NoneLightningErrorZ
5164 typedef union LDKCResult_NoneLightningErrorZPtr {
5166 * Note that this value is always NULL, as there are no contents in the OK variant
5170 * A pointer to the contents in the error state.
5171 * Reading from this pointer when `result_ok` is set is undefined.
5173 struct LDKLightningError *err;
5174 } LDKCResult_NoneLightningErrorZPtr;
5177 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
5178 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
5179 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5181 typedef struct LDKCResult_NoneLightningErrorZ {
5183 * The contents of this CResult_NoneLightningErrorZ, accessible via either
5184 * `err` or `result` depending on the state of `result_ok`.
5186 union LDKCResult_NoneLightningErrorZPtr contents;
5188 * Whether this CResult_NoneLightningErrorZ represents a success state.
5191 } LDKCResult_NoneLightningErrorZ;
5196 * Details about one direction of a channel as received within a [`ChannelUpdate`].
5198 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
5200 * A pointer to the opaque Rust object.
5201 * Nearly everywhere, inner must be non-null, however in places where
5202 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5204 LDKnativeChannelUpdateInfo *inner;
5206 * Indicates that this is the only struct which contains the same pointer.
5207 * Rust functions which take ownership of an object provided via an argument require
5208 * this to be true and invalidate the object pointed to by inner.
5211 } LDKChannelUpdateInfo;
5214 * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
5216 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
5218 * A pointer to the contents in the success state.
5219 * Reading from this pointer when `result_ok` is not set is undefined.
5221 struct LDKChannelUpdateInfo *result;
5223 * A pointer to the contents in the error state.
5224 * Reading from this pointer when `result_ok` is set is undefined.
5226 struct LDKDecodeError *err;
5227 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
5230 * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
5231 * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5232 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5234 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
5236 * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
5237 * `err` or `result` depending on the state of `result_ok`.
5239 union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
5241 * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
5244 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
5249 * Details about a channel (both directions).
5250 * Received within a channel announcement.
5252 typedef struct MUST_USE_STRUCT LDKChannelInfo {
5254 * A pointer to the opaque Rust object.
5255 * Nearly everywhere, inner must be non-null, however in places where
5256 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5258 LDKnativeChannelInfo *inner;
5260 * Indicates that this is the only struct which contains the same pointer.
5261 * Rust functions which take ownership of an object provided via an argument require
5262 * this to be true and invalidate the object pointed to by inner.
5268 * The contents of CResult_ChannelInfoDecodeErrorZ
5270 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
5272 * A pointer to the contents in the success state.
5273 * Reading from this pointer when `result_ok` is not set is undefined.
5275 struct LDKChannelInfo *result;
5277 * A pointer to the contents in the error state.
5278 * Reading from this pointer when `result_ok` is set is undefined.
5280 struct LDKDecodeError *err;
5281 } LDKCResult_ChannelInfoDecodeErrorZPtr;
5284 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
5285 * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5286 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5288 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
5290 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
5291 * `err` or `result` depending on the state of `result_ok`.
5293 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
5295 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
5298 } LDKCResult_ChannelInfoDecodeErrorZ;
5303 * Fees for routing via a given channel or a node
5305 typedef struct MUST_USE_STRUCT LDKRoutingFees {
5307 * A pointer to the opaque Rust object.
5308 * Nearly everywhere, inner must be non-null, however in places where
5309 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5311 LDKnativeRoutingFees *inner;
5313 * Indicates that this is the only struct which contains the same pointer.
5314 * Rust functions which take ownership of an object provided via an argument require
5315 * this to be true and invalidate the object pointed to by inner.
5321 * The contents of CResult_RoutingFeesDecodeErrorZ
5323 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
5325 * A pointer to the contents in the success state.
5326 * Reading from this pointer when `result_ok` is not set is undefined.
5328 struct LDKRoutingFees *result;
5330 * A pointer to the contents in the error state.
5331 * Reading from this pointer when `result_ok` is set is undefined.
5333 struct LDKDecodeError *err;
5334 } LDKCResult_RoutingFeesDecodeErrorZPtr;
5337 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
5338 * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
5339 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5341 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
5343 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
5344 * `err` or `result` depending on the state of `result_ok`.
5346 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
5348 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
5351 } LDKCResult_RoutingFeesDecodeErrorZ;
5354 * A 4-byte byte array.
5356 typedef struct LDKFourBytes {
5364 * A 16-byte byte array.
5366 typedef struct LDKSixteenBytes {
5374 * A 12-byte byte array.
5376 typedef struct LDKTwelveBytes {
5384 * An address which can be used to connect to a remote peer
5386 typedef enum LDKNetAddress_Tag {
5388 * An IPv4 address/port on which the peer is listening.
5392 * An IPv6 address/port on which the peer is listening.
5396 * An old-style Tor onion address/port on which the peer is listening.
5398 * This field is deprecated and the Tor network generally no longer supports V2 Onion
5399 * addresses. Thus, the details are not parsed here.
5401 LDKNetAddress_OnionV2,
5403 * A new-style Tor onion address/port on which the peer is listening.
5404 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
5405 * wrap as base32 and append \".onion\".
5407 LDKNetAddress_OnionV3,
5409 * Must be last for serialization purposes
5411 LDKNetAddress_Sentinel,
5412 } LDKNetAddress_Tag;
5414 typedef struct LDKNetAddress_LDKIPv4_Body {
5416 * The 4-byte IPv4 address
5418 struct LDKFourBytes addr;
5420 * The port on which the node is listening
5423 } LDKNetAddress_LDKIPv4_Body;
5425 typedef struct LDKNetAddress_LDKIPv6_Body {
5427 * The 16-byte IPv6 address
5429 struct LDKSixteenBytes addr;
5431 * The port on which the node is listening
5434 } LDKNetAddress_LDKIPv6_Body;
5436 typedef struct LDKNetAddress_LDKOnionV3_Body {
5438 * The ed25519 long-term public key of the peer
5440 struct LDKThirtyTwoBytes ed25519_pubkey;
5442 * The checksum of the pubkey and version, as included in the onion address
5446 * The version byte, as defined by the Tor Onion v3 spec.
5450 * The port on which the node is listening
5453 } LDKNetAddress_LDKOnionV3_Body;
5455 typedef struct MUST_USE_STRUCT LDKNetAddress {
5456 LDKNetAddress_Tag tag;
5458 LDKNetAddress_LDKIPv4_Body i_pv4;
5459 LDKNetAddress_LDKIPv6_Body i_pv6;
5461 struct LDKTwelveBytes onion_v2;
5463 LDKNetAddress_LDKOnionV3_Body onion_v3;
5468 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
5469 * This corresponds to std::vector in C++
5471 typedef struct LDKCVec_NetAddressZ {
5473 * The elements in the array.
5474 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5476 struct LDKNetAddress *data;
5478 * The number of elements pointed to by `data`.
5481 } LDKCVec_NetAddressZ;
5486 * Information received in the latest node_announcement from this node.
5488 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
5490 * A pointer to the opaque Rust object.
5491 * Nearly everywhere, inner must be non-null, however in places where
5492 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5494 LDKnativeNodeAnnouncementInfo *inner;
5496 * Indicates that this is the only struct which contains the same pointer.
5497 * Rust functions which take ownership of an object provided via an argument require
5498 * this to be true and invalidate the object pointed to by inner.
5501 } LDKNodeAnnouncementInfo;
5504 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
5506 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
5508 * A pointer to the contents in the success state.
5509 * Reading from this pointer when `result_ok` is not set is undefined.
5511 struct LDKNodeAnnouncementInfo *result;
5513 * A pointer to the contents in the error state.
5514 * Reading from this pointer when `result_ok` is set is undefined.
5516 struct LDKDecodeError *err;
5517 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
5520 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
5521 * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5522 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5524 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
5526 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
5527 * `err` or `result` depending on the state of `result_ok`.
5529 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
5531 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
5534 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
5537 * A dynamically-allocated array of u64s of arbitrary size.
5538 * This corresponds to std::vector in C++
5540 typedef struct LDKCVec_u64Z {
5542 * The elements in the array.
5543 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5547 * The number of elements pointed to by `data`.
5555 * Details about a node in the network, known from the network announcement.
5557 typedef struct MUST_USE_STRUCT LDKNodeInfo {
5559 * A pointer to the opaque Rust object.
5560 * Nearly everywhere, inner must be non-null, however in places where
5561 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5563 LDKnativeNodeInfo *inner;
5565 * Indicates that this is the only struct which contains the same pointer.
5566 * Rust functions which take ownership of an object provided via an argument require
5567 * this to be true and invalidate the object pointed to by inner.
5573 * The contents of CResult_NodeInfoDecodeErrorZ
5575 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
5577 * A pointer to the contents in the success state.
5578 * Reading from this pointer when `result_ok` is not set is undefined.
5580 struct LDKNodeInfo *result;
5582 * A pointer to the contents in the error state.
5583 * Reading from this pointer when `result_ok` is set is undefined.
5585 struct LDKDecodeError *err;
5586 } LDKCResult_NodeInfoDecodeErrorZPtr;
5589 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
5590 * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5591 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5593 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
5595 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
5596 * `err` or `result` depending on the state of `result_ok`.
5598 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
5600 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
5603 } LDKCResult_NodeInfoDecodeErrorZ;
5606 * The contents of CResult_NetworkGraphDecodeErrorZ
5608 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
5610 * A pointer to the contents in the success state.
5611 * Reading from this pointer when `result_ok` is not set is undefined.
5613 struct LDKNetworkGraph *result;
5615 * A pointer to the contents in the error state.
5616 * Reading from this pointer when `result_ok` is set is undefined.
5618 struct LDKDecodeError *err;
5619 } LDKCResult_NetworkGraphDecodeErrorZPtr;
5622 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
5623 * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
5624 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5626 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
5628 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
5629 * `err` or `result` depending on the state of `result_ok`.
5631 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
5633 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
5636 } LDKCResult_NetworkGraphDecodeErrorZ;
5639 * An enum which can either contain a crate::c_types::derived::CVec_NetAddressZ or not
5641 typedef enum LDKCOption_CVec_NetAddressZZ_Tag {
5643 * When we're in this state, this COption_CVec_NetAddressZZ contains a crate::c_types::derived::CVec_NetAddressZ
5645 LDKCOption_CVec_NetAddressZZ_Some,
5647 * When we're in this state, this COption_CVec_NetAddressZZ contains nothing
5649 LDKCOption_CVec_NetAddressZZ_None,
5651 * Must be last for serialization purposes
5653 LDKCOption_CVec_NetAddressZZ_Sentinel,
5654 } LDKCOption_CVec_NetAddressZZ_Tag;
5656 typedef struct LDKCOption_CVec_NetAddressZZ {
5657 LDKCOption_CVec_NetAddressZZ_Tag tag;
5660 struct LDKCVec_NetAddressZ some;
5663 } LDKCOption_CVec_NetAddressZZ;
5666 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
5668 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
5670 * A pointer to the contents in the success state.
5671 * Reading from this pointer when `result_ok` is not set is undefined.
5673 struct LDKDelayedPaymentOutputDescriptor *result;
5675 * A pointer to the contents in the error state.
5676 * Reading from this pointer when `result_ok` is set is undefined.
5678 struct LDKDecodeError *err;
5679 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
5682 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
5683 * containing a crate::lightning::chain::keysinterface::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
5684 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5686 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
5688 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
5689 * `err` or `result` depending on the state of `result_ok`.
5691 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
5693 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
5696 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
5699 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
5701 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
5703 * A pointer to the contents in the success state.
5704 * Reading from this pointer when `result_ok` is not set is undefined.
5706 struct LDKStaticPaymentOutputDescriptor *result;
5708 * A pointer to the contents in the error state.
5709 * Reading from this pointer when `result_ok` is set is undefined.
5711 struct LDKDecodeError *err;
5712 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
5715 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
5716 * containing a crate::lightning::chain::keysinterface::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
5717 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5719 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
5721 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
5722 * `err` or `result` depending on the state of `result_ok`.
5724 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
5726 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
5729 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
5732 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
5734 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
5736 * A pointer to the contents in the success state.
5737 * Reading from this pointer when `result_ok` is not set is undefined.
5739 struct LDKSpendableOutputDescriptor *result;
5741 * A pointer to the contents in the error state.
5742 * Reading from this pointer when `result_ok` is set is undefined.
5744 struct LDKDecodeError *err;
5745 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
5748 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
5749 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
5750 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5752 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
5754 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
5755 * `err` or `result` depending on the state of `result_ok`.
5757 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
5759 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
5762 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
5765 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
5766 * This corresponds to std::vector in C++
5768 typedef struct LDKCVec_PaymentPreimageZ {
5770 * The elements in the array.
5771 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5773 struct LDKThirtyTwoBytes *data;
5775 * The number of elements pointed to by `data`.
5778 } LDKCVec_PaymentPreimageZ;
5781 * A tuple of 2 elements. See the individual fields for the types contained.
5783 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
5785 * The element at position 0
5787 struct LDKSignature a;
5789 * The element at position 1
5791 struct LDKCVec_SignatureZ b;
5792 } LDKC2Tuple_SignatureCVec_SignatureZZ;
5795 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
5797 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
5799 * A pointer to the contents in the success state.
5800 * Reading from this pointer when `result_ok` is not set is undefined.
5802 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
5804 * Note that this value is always NULL, as there are no contents in the Err variant
5807 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
5810 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
5811 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
5812 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5814 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
5816 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
5817 * `err` or `result` depending on the state of `result_ok`.
5819 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
5821 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
5824 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
5827 * The contents of CResult_SignatureNoneZ
5829 typedef union LDKCResult_SignatureNoneZPtr {
5831 * A pointer to the contents in the success state.
5832 * Reading from this pointer when `result_ok` is not set is undefined.
5834 struct LDKSignature *result;
5836 * Note that this value is always NULL, as there are no contents in the Err variant
5839 } LDKCResult_SignatureNoneZPtr;
5842 * A CResult_SignatureNoneZ represents the result of a fallible operation,
5843 * containing a crate::c_types::Signature on success and a () on failure.
5844 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5846 typedef struct LDKCResult_SignatureNoneZ {
5848 * The contents of this CResult_SignatureNoneZ, accessible via either
5849 * `err` or `result` depending on the state of `result_ok`.
5851 union LDKCResult_SignatureNoneZPtr contents;
5853 * Whether this CResult_SignatureNoneZ represents a success state.
5856 } LDKCResult_SignatureNoneZ;
5859 * A tuple of 2 elements. See the individual fields for the types contained.
5861 typedef struct LDKC2Tuple_SignatureSignatureZ {
5863 * The element at position 0
5865 struct LDKSignature a;
5867 * The element at position 1
5869 struct LDKSignature b;
5870 } LDKC2Tuple_SignatureSignatureZ;
5873 * The contents of CResult_C2Tuple_SignatureSignatureZNoneZ
5875 typedef union LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr {
5877 * A pointer to the contents in the success state.
5878 * Reading from this pointer when `result_ok` is not set is undefined.
5880 struct LDKC2Tuple_SignatureSignatureZ *result;
5882 * Note that this value is always NULL, as there are no contents in the Err variant
5885 } LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr;
5888 * A CResult_C2Tuple_SignatureSignatureZNoneZ represents the result of a fallible operation,
5889 * containing a crate::c_types::derived::C2Tuple_SignatureSignatureZ on success and a () on failure.
5890 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5892 typedef struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ {
5894 * The contents of this CResult_C2Tuple_SignatureSignatureZNoneZ, accessible via either
5895 * `err` or `result` depending on the state of `result_ok`.
5897 union LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr contents;
5899 * Whether this CResult_C2Tuple_SignatureSignatureZNoneZ represents a success state.
5902 } LDKCResult_C2Tuple_SignatureSignatureZNoneZ;
5905 * The contents of CResult_SecretKeyNoneZ
5907 typedef union LDKCResult_SecretKeyNoneZPtr {
5909 * A pointer to the contents in the success state.
5910 * Reading from this pointer when `result_ok` is not set is undefined.
5912 struct LDKSecretKey *result;
5914 * Note that this value is always NULL, as there are no contents in the Err variant
5917 } LDKCResult_SecretKeyNoneZPtr;
5920 * A CResult_SecretKeyNoneZ represents the result of a fallible operation,
5921 * containing a crate::c_types::SecretKey on success and a () on failure.
5922 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5924 typedef struct LDKCResult_SecretKeyNoneZ {
5926 * The contents of this CResult_SecretKeyNoneZ, accessible via either
5927 * `err` or `result` depending on the state of `result_ok`.
5929 union LDKCResult_SecretKeyNoneZPtr contents;
5931 * Whether this CResult_SecretKeyNoneZ represents a success state.
5934 } LDKCResult_SecretKeyNoneZ;
5939 * This class tracks the per-transaction information needed to build a closing transaction and will
5940 * actually build it and sign.
5942 * This class can be used inside a signer implementation to generate a signature given the relevant
5945 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
5947 * A pointer to the opaque Rust object.
5948 * Nearly everywhere, inner must be non-null, however in places where
5949 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5951 LDKnativeClosingTransaction *inner;
5953 * Indicates that this is the only struct which contains the same pointer.
5954 * Rust functions which take ownership of an object provided via an argument require
5955 * this to be true and invalidate the object pointed to by inner.
5958 } LDKClosingTransaction;
5963 * The unsigned part of a channel_announcement
5965 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
5967 * A pointer to the opaque Rust object.
5968 * Nearly everywhere, inner must be non-null, however in places where
5969 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5971 LDKnativeUnsignedChannelAnnouncement *inner;
5973 * Indicates that this is the only struct which contains the same pointer.
5974 * Rust functions which take ownership of an object provided via an argument require
5975 * this to be true and invalidate the object pointed to by inner.
5978 } LDKUnsignedChannelAnnouncement;
5981 * A trait to sign lightning channel transactions as described in BOLT 3.
5983 * Signing services could be implemented on a hardware wallet. In this case,
5984 * the current Sign would be a front-end on top of a communication
5985 * channel connected to your secure device and lightning key material wouldn't
5986 * reside on a hot server. Nevertheless, a this deployment would still need
5987 * to trust the ChannelManager to avoid loss of funds as this latest component
5988 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
5990 * A more secure iteration would be to use hashlock (or payment points) to pair
5991 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
5992 * at the price of more state and computation on the hardware wallet side. In the future,
5993 * we are looking forward to design such interface.
5995 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
5996 * to act, as liveness and breach reply correctness are always going to be hard requirements
5997 * of LN security model, orthogonal of key management issues.
5999 typedef struct LDKBaseSign {
6001 * An opaque pointer which is passed to your function implementations as an argument.
6002 * This has no meaning in the LDK, and can be NULL or any other value.
6006 * Gets the per-commitment point for a specific commitment number
6008 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
6010 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
6012 * Gets the commitment secret for a specific commitment number as part of the revocation process
6014 * An external signer implementation should error here if the commitment was already signed
6015 * and should refuse to sign it in the future.
6017 * May be called more than once for the same index.
6019 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
6021 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
6023 * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
6025 * This is required in order for the signer to make sure that releasing a commitment
6026 * secret won't leave us without a broadcastable holder transaction.
6027 * Policy checks should be implemented in this function, including checking the amount
6028 * sent to us and checking the HTLCs.
6030 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
6031 * A validating signer should ensure that an HTLC output is removed only when the matching
6032 * preimage is provided, or when the value to holder is restored.
6034 * NOTE: all the relevant preimages will be provided, but there may also be additional
6035 * irrelevant or duplicate preimages.
6037 struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_PaymentPreimageZ preimages);
6039 * Gets the holder's channel public keys and basepoints
6041 struct LDKChannelPublicKeys pubkeys;
6043 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
6044 * Note that this takes a pointer to this object, not the this_ptr like other methods do
6045 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
6047 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
6049 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
6050 * some SpendableOutputDescriptor types. This should be sufficient to identify this
6051 * Sign object uniquely and lookup or re-derive its keys.
6053 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
6055 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
6057 * Note that if signing fails or is rejected, the channel will be force-closed.
6059 * Policy checks should be implemented in this function, including checking the amount
6060 * sent to us and checking the HTLCs.
6062 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
6063 * A validating signer should ensure that an HTLC output is removed only when the matching
6064 * preimage is provided, or when the value to holder is restored.
6066 * NOTE: all the relevant preimages will be provided, but there may also be additional
6067 * irrelevant or duplicate preimages.
6069 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_PaymentPreimageZ preimages);
6071 * Validate the counterparty's revocation.
6073 * This is required in order for the signer to make sure that the state has moved
6074 * forward and it is safe to sign the next counterparty commitment.
6076 struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
6078 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
6079 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
6080 * latest commitment_tx when we initiate a force-close.
6081 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
6082 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
6084 * This may be called multiple times for the same transaction.
6086 * An external signer implementation should check that the commitment has not been revoked.
6088 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
6090 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
6092 * Create a signature for the given input in a transaction spending an HTLC transaction output
6093 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
6095 * A justice transaction may claim multiple outputs at the same time if timelocks are
6096 * similar, but only a signature for the input at index `input` should be signed for here.
6097 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
6098 * to an upcoming timelock expiration.
6100 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
6102 * per_commitment_key is revocation secret which was provided by our counterparty when they
6103 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
6104 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
6107 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]);
6109 * Create a signature for the given input in a transaction spending a commitment transaction
6110 * HTLC output when our counterparty broadcasts an old state.
6112 * A justice transaction may claim multiple outputs at the same time if timelocks are
6113 * similar, but only a signature for the input at index `input` should be signed for here.
6114 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
6115 * to an upcoming timelock expiration.
6117 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
6119 * per_commitment_key is revocation secret which was provided by our counterparty when they
6120 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
6121 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
6124 * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script
6125 * (which is committed to in the BIP 143 signatures).
6127 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);
6129 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
6130 * transaction, either offered or received.
6132 * Such a transaction may claim multiples offered outputs at same time if we know the
6133 * preimage for each when we create it, but only the input at index `input` should be
6134 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
6135 * needed with regards to an upcoming timelock expiration.
6137 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
6140 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
6142 * Per_commitment_point is the dynamic point corresponding to the channel state
6143 * detected onchain. It has been generated by our counterparty and is used to derive
6144 * channel state keys, which are then included in the witness script and committed to in the
6145 * BIP 143 signature.
6147 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);
6149 * Create a signature for a (proposed) closing transaction.
6151 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
6152 * chosen to forgo their output as dust.
6154 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
6156 * Signs a channel announcement message with our funding key and our node secret key (aka
6157 * node_id or network_key), proving it comes from one of the channel participants.
6159 * The first returned signature should be from our node secret key, the second from our
6162 * Note that if this fails or is rejected, the channel will not be publicly announced and
6163 * our counterparty may (though likely will not) close the channel on us for violating the
6166 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
6168 * Set the counterparty static channel data, including basepoints,
6169 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
6170 * This is done as soon as the funding outpoint is known. Since these are static channel data,
6171 * they MUST NOT be allowed to change to different values once set.
6173 * channel_parameters.is_populated() MUST be true.
6175 * We bind holder_selected_contest_delay late here for API convenience.
6177 * Will be called before any signatures are applied.
6179 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
6181 * Frees any resources associated with this object given its this_arg pointer.
6182 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6184 void (*free)(void *this_arg);
6188 * A cloneable signer.
6190 * Although we require signers to be cloneable, it may be useful for developers to be able to use
6191 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
6192 * which implies Sized, into this derived trait.
6194 typedef struct LDKSign {
6196 * An opaque pointer which is passed to your function implementations as an argument.
6197 * This has no meaning in the LDK, and can be NULL or any other value.
6201 * Implementation of BaseSign for this object.
6203 struct LDKBaseSign BaseSign;
6205 * Serialize the object into a byte array
6207 struct LDKCVec_u8Z (*write)(const void *this_arg);
6209 * Called, if set, after this Sign has been cloned into a duplicate object.
6210 * The new Sign is provided, and should be mutated as needed to perform a
6211 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
6213 void (*cloned)(struct LDKSign *NONNULL_PTR new_Sign);
6215 * Frees any resources associated with this object given its this_arg pointer.
6216 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6218 void (*free)(void *this_arg);
6222 * The contents of CResult_SignDecodeErrorZ
6224 typedef union LDKCResult_SignDecodeErrorZPtr {
6226 * A pointer to the contents in the success state.
6227 * Reading from this pointer when `result_ok` is not set is undefined.
6229 struct LDKSign *result;
6231 * A pointer to the contents in the error state.
6232 * Reading from this pointer when `result_ok` is set is undefined.
6234 struct LDKDecodeError *err;
6235 } LDKCResult_SignDecodeErrorZPtr;
6238 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
6239 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
6240 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6242 typedef struct LDKCResult_SignDecodeErrorZ {
6244 * The contents of this CResult_SignDecodeErrorZ, accessible via either
6245 * `err` or `result` depending on the state of `result_ok`.
6247 union LDKCResult_SignDecodeErrorZPtr contents;
6249 * Whether this CResult_SignDecodeErrorZ represents a success state.
6252 } LDKCResult_SignDecodeErrorZ;
6255 * Integer in the range `0..32`
6257 typedef struct LDKu5 {
6262 * A dynamically-allocated array of crate::c_types::u5s of arbitrary size.
6263 * This corresponds to std::vector in C++
6265 typedef struct LDKCVec_u5Z {
6267 * The elements in the array.
6268 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6272 * The number of elements pointed to by `data`.
6278 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
6279 * allows recovering the exact public key which created the signature given the message.
6281 typedef struct LDKRecoverableSignature {
6283 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
6286 uint8_t serialized_form[68];
6287 } LDKRecoverableSignature;
6290 * The contents of CResult_RecoverableSignatureNoneZ
6292 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
6294 * A pointer to the contents in the success state.
6295 * Reading from this pointer when `result_ok` is not set is undefined.
6297 struct LDKRecoverableSignature *result;
6299 * Note that this value is always NULL, as there are no contents in the Err variant
6302 } LDKCResult_RecoverableSignatureNoneZPtr;
6305 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
6306 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
6307 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6309 typedef struct LDKCResult_RecoverableSignatureNoneZ {
6311 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
6312 * `err` or `result` depending on the state of `result_ok`.
6314 union LDKCResult_RecoverableSignatureNoneZPtr contents;
6316 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
6319 } LDKCResult_RecoverableSignatureNoneZ;
6322 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
6323 * This corresponds to std::vector in C++
6325 typedef struct LDKCVec_CVec_u8ZZ {
6327 * The elements in the array.
6328 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6330 struct LDKCVec_u8Z *data;
6332 * The number of elements pointed to by `data`.
6335 } LDKCVec_CVec_u8ZZ;
6338 * The contents of CResult_CVec_CVec_u8ZZNoneZ
6340 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
6342 * A pointer to the contents in the success state.
6343 * Reading from this pointer when `result_ok` is not set is undefined.
6345 struct LDKCVec_CVec_u8ZZ *result;
6347 * Note that this value is always NULL, as there are no contents in the Err variant
6350 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
6353 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
6354 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
6355 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6357 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
6359 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
6360 * `err` or `result` depending on the state of `result_ok`.
6362 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
6364 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
6367 } LDKCResult_CVec_CVec_u8ZZNoneZ;
6372 * A simple implementation of Sign that just keeps the private keys in memory.
6374 * This implementation performs no policy checks and is insufficient by itself as
6375 * a secure external signer.
6377 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
6379 * A pointer to the opaque Rust object.
6380 * Nearly everywhere, inner must be non-null, however in places where
6381 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6383 LDKnativeInMemorySigner *inner;
6385 * Indicates that this is the only struct which contains the same pointer.
6386 * Rust functions which take ownership of an object provided via an argument require
6387 * this to be true and invalidate the object pointed to by inner.
6390 } LDKInMemorySigner;
6393 * The contents of CResult_InMemorySignerDecodeErrorZ
6395 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
6397 * A pointer to the contents in the success state.
6398 * Reading from this pointer when `result_ok` is not set is undefined.
6400 struct LDKInMemorySigner *result;
6402 * A pointer to the contents in the error state.
6403 * Reading from this pointer when `result_ok` is set is undefined.
6405 struct LDKDecodeError *err;
6406 } LDKCResult_InMemorySignerDecodeErrorZPtr;
6409 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
6410 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
6411 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6413 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
6415 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
6416 * `err` or `result` depending on the state of `result_ok`.
6418 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
6420 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
6423 } LDKCResult_InMemorySignerDecodeErrorZ;
6426 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
6427 * This corresponds to std::vector in C++
6429 typedef struct LDKCVec_TxOutZ {
6431 * The elements in the array.
6432 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6434 struct LDKTxOut *data;
6436 * The number of elements pointed to by `data`.
6442 * The contents of CResult_TransactionNoneZ
6444 typedef union LDKCResult_TransactionNoneZPtr {
6446 * A pointer to the contents in the success state.
6447 * Reading from this pointer when `result_ok` is not set is undefined.
6449 struct LDKTransaction *result;
6451 * Note that this value is always NULL, as there are no contents in the Err variant
6454 } LDKCResult_TransactionNoneZPtr;
6457 * A CResult_TransactionNoneZ represents the result of a fallible operation,
6458 * containing a crate::c_types::Transaction on success and a () on failure.
6459 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6461 typedef struct LDKCResult_TransactionNoneZ {
6463 * The contents of this CResult_TransactionNoneZ, accessible via either
6464 * `err` or `result` depending on the state of `result_ok`.
6466 union LDKCResult_TransactionNoneZPtr contents;
6468 * Whether this CResult_TransactionNoneZ represents a success state.
6471 } LDKCResult_TransactionNoneZ;
6476 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
6477 * on-chain transactions to ensure no loss of funds occurs.
6479 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
6480 * information and are actively monitoring the chain.
6482 * Pending Events or updated HTLCs which have not yet been read out by
6483 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
6484 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
6485 * gotten are fully handled before re-serializing the new state.
6487 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
6488 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
6489 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
6490 * returned block hash and the the current chain and then reconnecting blocks to get to the
6491 * best chain) upon deserializing the object!
6493 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
6495 * A pointer to the opaque Rust object.
6496 * Nearly everywhere, inner must be non-null, however in places where
6497 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6499 LDKnativeChannelMonitor *inner;
6501 * Indicates that this is the only struct which contains the same pointer.
6502 * Rust functions which take ownership of an object provided via an argument require
6503 * this to be true and invalidate the object pointed to by inner.
6506 } LDKChannelMonitor;
6509 * A tuple of 2 elements. See the individual fields for the types contained.
6511 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
6513 * The element at position 0
6515 struct LDKThirtyTwoBytes a;
6517 * The element at position 1
6519 struct LDKChannelMonitor b;
6520 } LDKC2Tuple_BlockHashChannelMonitorZ;
6523 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
6524 * This corresponds to std::vector in C++
6526 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
6528 * The elements in the array.
6529 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6531 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
6533 * The number of elements pointed to by `data`.
6536 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
6539 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
6541 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
6543 * A pointer to the contents in the success state.
6544 * Reading from this pointer when `result_ok` is not set is undefined.
6546 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
6548 * A pointer to the contents in the error state.
6549 * Reading from this pointer when `result_ok` is set is undefined.
6551 enum LDKIOError *err;
6552 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
6555 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
6556 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
6557 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6559 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
6561 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
6562 * `err` or `result` depending on the state of `result_ok`.
6564 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
6566 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
6569 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
6572 * An enum which can either contain a u16 or not
6574 typedef enum LDKCOption_u16Z_Tag {
6576 * When we're in this state, this COption_u16Z contains a u16
6578 LDKCOption_u16Z_Some,
6580 * When we're in this state, this COption_u16Z contains nothing
6582 LDKCOption_u16Z_None,
6584 * Must be last for serialization purposes
6586 LDKCOption_u16Z_Sentinel,
6587 } LDKCOption_u16Z_Tag;
6589 typedef struct LDKCOption_u16Z {
6590 LDKCOption_u16Z_Tag tag;
6599 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
6602 typedef enum LDKAPIError_Tag {
6604 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
6605 * are documented, but generally indicates some precondition of a function was violated.
6607 LDKAPIError_APIMisuseError,
6609 * Due to a high feerate, we were unable to complete the request.
6610 * For example, this may be returned if the feerate implies we cannot open a channel at the
6611 * requested value, but opening a larger channel would succeed.
6613 LDKAPIError_FeeRateTooHigh,
6615 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
6616 * too-many-hops, etc).
6618 LDKAPIError_RouteError,
6620 * We were unable to complete the request as the Channel required to do so is unable to
6621 * complete the request (or was not found). This can take many forms, including disconnected
6622 * peer, channel at capacity, channel shutting down, etc.
6624 LDKAPIError_ChannelUnavailable,
6626 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
6627 * attempted action to fail.
6629 LDKAPIError_MonitorUpdateFailed,
6631 * [`KeysInterface::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
6632 * with the channel counterparty as negotiated in [`InitFeatures`].
6634 * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
6635 * a channel or cooperatively close one with this peer (and will have to force-close instead).
6637 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
6638 * [`InitFeatures`]: crate::ln::features::InitFeatures
6640 LDKAPIError_IncompatibleShutdownScript,
6642 * Must be last for serialization purposes
6644 LDKAPIError_Sentinel,
6647 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
6649 * A human-readable error message
6652 } LDKAPIError_LDKAPIMisuseError_Body;
6654 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
6656 * A human-readable error message
6660 * The feerate which was too high.
6663 } LDKAPIError_LDKFeeRateTooHigh_Body;
6665 typedef struct LDKAPIError_LDKRouteError_Body {
6667 * A human-readable error message
6670 } LDKAPIError_LDKRouteError_Body;
6672 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
6674 * A human-readable error message
6677 } LDKAPIError_LDKChannelUnavailable_Body;
6679 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
6681 * The incompatible shutdown script.
6683 struct LDKShutdownScript script;
6684 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
6686 typedef struct MUST_USE_STRUCT LDKAPIError {
6687 LDKAPIError_Tag tag;
6689 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
6690 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
6691 LDKAPIError_LDKRouteError_Body route_error;
6692 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
6693 LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
6698 * The contents of CResult_NoneAPIErrorZ
6700 typedef union LDKCResult_NoneAPIErrorZPtr {
6702 * Note that this value is always NULL, as there are no contents in the OK variant
6706 * A pointer to the contents in the error state.
6707 * Reading from this pointer when `result_ok` is set is undefined.
6709 struct LDKAPIError *err;
6710 } LDKCResult_NoneAPIErrorZPtr;
6713 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
6714 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
6715 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6717 typedef struct LDKCResult_NoneAPIErrorZ {
6719 * The contents of this CResult_NoneAPIErrorZ, accessible via either
6720 * `err` or `result` depending on the state of `result_ok`.
6722 union LDKCResult_NoneAPIErrorZPtr contents;
6724 * Whether this CResult_NoneAPIErrorZ represents a success state.
6727 } LDKCResult_NoneAPIErrorZ;
6730 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
6731 * This corresponds to std::vector in C++
6733 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
6735 * The elements in the array.
6736 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6738 struct LDKCResult_NoneAPIErrorZ *data;
6740 * The number of elements pointed to by `data`.
6743 } LDKCVec_CResult_NoneAPIErrorZZ;
6746 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
6747 * This corresponds to std::vector in C++
6749 typedef struct LDKCVec_APIErrorZ {
6751 * The elements in the array.
6752 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6754 struct LDKAPIError *data;
6756 * The number of elements pointed to by `data`.
6759 } LDKCVec_APIErrorZ;
6762 * The contents of CResult__u832APIErrorZ
6764 typedef union LDKCResult__u832APIErrorZPtr {
6766 * A pointer to the contents in the success state.
6767 * Reading from this pointer when `result_ok` is not set is undefined.
6769 struct LDKThirtyTwoBytes *result;
6771 * A pointer to the contents in the error state.
6772 * Reading from this pointer when `result_ok` is set is undefined.
6774 struct LDKAPIError *err;
6775 } LDKCResult__u832APIErrorZPtr;
6778 * A CResult__u832APIErrorZ represents the result of a fallible operation,
6779 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
6780 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6782 typedef struct LDKCResult__u832APIErrorZ {
6784 * The contents of this CResult__u832APIErrorZ, accessible via either
6785 * `err` or `result` depending on the state of `result_ok`.
6787 union LDKCResult__u832APIErrorZPtr contents;
6789 * Whether this CResult__u832APIErrorZ represents a success state.
6792 } LDKCResult__u832APIErrorZ;
6795 * If a payment fails to send, it can be in one of several states. This enum is returned as the
6796 * Err() type describing which state the payment is in, see the description of individual enum
6799 typedef enum LDKPaymentSendFailure_Tag {
6801 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
6802 * send the payment at all. No channel state has been changed or messages sent to peers, and
6803 * once you've changed the parameter at error, you can freely retry the payment in full.
6805 LDKPaymentSendFailure_ParameterError,
6807 * A parameter in a single path which was passed to send_payment was invalid, preventing us
6808 * from attempting to send the payment at all. No channel state has been changed or messages
6809 * sent to peers, and once you've changed the parameter at error, you can freely retry the
6812 * The results here are ordered the same as the paths in the route object which was passed to
6815 LDKPaymentSendFailure_PathParameterError,
6817 * All paths which were attempted failed to send, with no channel state change taking place.
6818 * You can freely retry the payment in full (though you probably want to do so over different
6819 * paths than the ones selected).
6821 LDKPaymentSendFailure_AllFailedRetrySafe,
6823 * Some paths which were attempted failed to send, though possibly not all. At least some
6824 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
6825 * in over-/re-payment.
6827 * The results here are ordered the same as the paths in the route object which was passed to
6828 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
6829 * retried (though there is currently no API with which to do so).
6831 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
6832 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
6833 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
6834 * with the latest update_id.
6836 LDKPaymentSendFailure_PartialFailure,
6838 * Must be last for serialization purposes
6840 LDKPaymentSendFailure_Sentinel,
6841 } LDKPaymentSendFailure_Tag;
6843 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
6845 * The errors themselves, in the same order as the route hops.
6847 struct LDKCVec_CResult_NoneAPIErrorZZ results;
6849 * If some paths failed without irrevocably committing to the new HTLC(s), this will
6850 * contain a [`RouteParameters`] object which can be used to calculate a new route that
6851 * will pay all remaining unpaid balance.
6853 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
6855 struct LDKRouteParameters failed_paths_retry;
6857 * The payment id for the payment, which is now at least partially pending.
6859 struct LDKThirtyTwoBytes payment_id;
6860 } LDKPaymentSendFailure_LDKPartialFailure_Body;
6862 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
6863 LDKPaymentSendFailure_Tag tag;
6866 struct LDKAPIError parameter_error;
6869 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
6872 struct LDKCVec_APIErrorZ all_failed_retry_safe;
6874 LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
6876 } LDKPaymentSendFailure;
6879 * The contents of CResult_PaymentIdPaymentSendFailureZ
6881 typedef union LDKCResult_PaymentIdPaymentSendFailureZPtr {
6883 * A pointer to the contents in the success state.
6884 * Reading from this pointer when `result_ok` is not set is undefined.
6886 struct LDKThirtyTwoBytes *result;
6888 * A pointer to the contents in the error state.
6889 * Reading from this pointer when `result_ok` is set is undefined.
6891 struct LDKPaymentSendFailure *err;
6892 } LDKCResult_PaymentIdPaymentSendFailureZPtr;
6895 * A CResult_PaymentIdPaymentSendFailureZ represents the result of a fallible operation,
6896 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
6897 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6899 typedef struct LDKCResult_PaymentIdPaymentSendFailureZ {
6901 * The contents of this CResult_PaymentIdPaymentSendFailureZ, accessible via either
6902 * `err` or `result` depending on the state of `result_ok`.
6904 union LDKCResult_PaymentIdPaymentSendFailureZPtr contents;
6906 * Whether this CResult_PaymentIdPaymentSendFailureZ represents a success state.
6909 } LDKCResult_PaymentIdPaymentSendFailureZ;
6912 * The contents of CResult_NonePaymentSendFailureZ
6914 typedef union LDKCResult_NonePaymentSendFailureZPtr {
6916 * Note that this value is always NULL, as there are no contents in the OK variant
6920 * A pointer to the contents in the error state.
6921 * Reading from this pointer when `result_ok` is set is undefined.
6923 struct LDKPaymentSendFailure *err;
6924 } LDKCResult_NonePaymentSendFailureZPtr;
6927 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
6928 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
6929 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6931 typedef struct LDKCResult_NonePaymentSendFailureZ {
6933 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
6934 * `err` or `result` depending on the state of `result_ok`.
6936 union LDKCResult_NonePaymentSendFailureZPtr contents;
6938 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
6941 } LDKCResult_NonePaymentSendFailureZ;
6944 * A tuple of 2 elements. See the individual fields for the types contained.
6946 typedef struct LDKC2Tuple_PaymentHashPaymentIdZ {
6948 * The element at position 0
6950 struct LDKThirtyTwoBytes a;
6952 * The element at position 1
6954 struct LDKThirtyTwoBytes b;
6955 } LDKC2Tuple_PaymentHashPaymentIdZ;
6958 * The contents of CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ
6960 typedef union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr {
6962 * A pointer to the contents in the success state.
6963 * Reading from this pointer when `result_ok` is not set is undefined.
6965 struct LDKC2Tuple_PaymentHashPaymentIdZ *result;
6967 * A pointer to the contents in the error state.
6968 * Reading from this pointer when `result_ok` is set is undefined.
6970 struct LDKPaymentSendFailure *err;
6971 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr;
6974 * A CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents the result of a fallible operation,
6975 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentIdZ on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
6976 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6978 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ {
6980 * The contents of this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ, accessible via either
6981 * `err` or `result` depending on the state of `result_ok`.
6983 union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr contents;
6985 * Whether this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents a success state.
6988 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ;
6991 * A tuple of 2 elements. See the individual fields for the types contained.
6993 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
6995 * The element at position 0
6997 struct LDKThirtyTwoBytes a;
6999 * The element at position 1
7001 struct LDKThirtyTwoBytes b;
7002 } LDKC2Tuple_PaymentHashPaymentSecretZ;
7005 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ
7007 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
7009 * A pointer to the contents in the success state.
7010 * Reading from this pointer when `result_ok` is not set is undefined.
7012 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
7014 * Note that this value is always NULL, as there are no contents in the Err variant
7017 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr;
7020 * A CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents the result of a fallible operation,
7021 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a () on failure.
7022 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7024 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
7026 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ, accessible via either
7027 * `err` or `result` depending on the state of `result_ok`.
7029 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr contents;
7031 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents a success state.
7034 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ;
7037 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ
7039 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr {
7041 * A pointer to the contents in the success state.
7042 * Reading from this pointer when `result_ok` is not set is undefined.
7044 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
7046 * A pointer to the contents in the error state.
7047 * Reading from this pointer when `result_ok` is set is undefined.
7049 struct LDKAPIError *err;
7050 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr;
7053 * A CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents the result of a fallible operation,
7054 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a crate::lightning::util::errors::APIError on failure.
7055 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7057 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
7059 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ, accessible via either
7060 * `err` or `result` depending on the state of `result_ok`.
7062 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr contents;
7064 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents a success state.
7067 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ;
7070 * The contents of CResult_PaymentSecretNoneZ
7072 typedef union LDKCResult_PaymentSecretNoneZPtr {
7074 * A pointer to the contents in the success state.
7075 * Reading from this pointer when `result_ok` is not set is undefined.
7077 struct LDKThirtyTwoBytes *result;
7079 * Note that this value is always NULL, as there are no contents in the Err variant
7082 } LDKCResult_PaymentSecretNoneZPtr;
7085 * A CResult_PaymentSecretNoneZ represents the result of a fallible operation,
7086 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
7087 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7089 typedef struct LDKCResult_PaymentSecretNoneZ {
7091 * The contents of this CResult_PaymentSecretNoneZ, accessible via either
7092 * `err` or `result` depending on the state of `result_ok`.
7094 union LDKCResult_PaymentSecretNoneZPtr contents;
7096 * Whether this CResult_PaymentSecretNoneZ represents a success state.
7099 } LDKCResult_PaymentSecretNoneZ;
7102 * The contents of CResult_PaymentSecretAPIErrorZ
7104 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
7106 * A pointer to the contents in the success state.
7107 * Reading from this pointer when `result_ok` is not set is undefined.
7109 struct LDKThirtyTwoBytes *result;
7111 * A pointer to the contents in the error state.
7112 * Reading from this pointer when `result_ok` is set is undefined.
7114 struct LDKAPIError *err;
7115 } LDKCResult_PaymentSecretAPIErrorZPtr;
7118 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
7119 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7120 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7122 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
7124 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
7125 * `err` or `result` depending on the state of `result_ok`.
7127 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
7129 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
7132 } LDKCResult_PaymentSecretAPIErrorZ;
7135 * The contents of CResult_PaymentPreimageAPIErrorZ
7137 typedef union LDKCResult_PaymentPreimageAPIErrorZPtr {
7139 * A pointer to the contents in the success state.
7140 * Reading from this pointer when `result_ok` is not set is undefined.
7142 struct LDKThirtyTwoBytes *result;
7144 * A pointer to the contents in the error state.
7145 * Reading from this pointer when `result_ok` is set is undefined.
7147 struct LDKAPIError *err;
7148 } LDKCResult_PaymentPreimageAPIErrorZPtr;
7151 * A CResult_PaymentPreimageAPIErrorZ represents the result of a fallible operation,
7152 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7153 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7155 typedef struct LDKCResult_PaymentPreimageAPIErrorZ {
7157 * The contents of this CResult_PaymentPreimageAPIErrorZ, accessible via either
7158 * `err` or `result` depending on the state of `result_ok`.
7160 union LDKCResult_PaymentPreimageAPIErrorZPtr contents;
7162 * Whether this CResult_PaymentPreimageAPIErrorZ represents a success state.
7165 } LDKCResult_PaymentPreimageAPIErrorZ;
7170 * Information needed for constructing an invoice route hint for this channel.
7172 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
7174 * A pointer to the opaque Rust object.
7175 * Nearly everywhere, inner must be non-null, however in places where
7176 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7178 LDKnativeCounterpartyForwardingInfo *inner;
7180 * Indicates that this is the only struct which contains the same pointer.
7181 * Rust functions which take ownership of an object provided via an argument require
7182 * this to be true and invalidate the object pointed to by inner.
7185 } LDKCounterpartyForwardingInfo;
7188 * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
7190 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
7192 * A pointer to the contents in the success state.
7193 * Reading from this pointer when `result_ok` is not set is undefined.
7195 struct LDKCounterpartyForwardingInfo *result;
7197 * A pointer to the contents in the error state.
7198 * Reading from this pointer when `result_ok` is set is undefined.
7200 struct LDKDecodeError *err;
7201 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
7204 * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
7205 * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7206 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7208 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
7210 * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
7211 * `err` or `result` depending on the state of `result_ok`.
7213 union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
7215 * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
7218 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
7223 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
7224 * to better separate parameters.
7226 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
7228 * A pointer to the opaque Rust object.
7229 * Nearly everywhere, inner must be non-null, however in places where
7230 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7232 LDKnativeChannelCounterparty *inner;
7234 * Indicates that this is the only struct which contains the same pointer.
7235 * Rust functions which take ownership of an object provided via an argument require
7236 * this to be true and invalidate the object pointed to by inner.
7239 } LDKChannelCounterparty;
7242 * The contents of CResult_ChannelCounterpartyDecodeErrorZ
7244 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
7246 * A pointer to the contents in the success state.
7247 * Reading from this pointer when `result_ok` is not set is undefined.
7249 struct LDKChannelCounterparty *result;
7251 * A pointer to the contents in the error state.
7252 * Reading from this pointer when `result_ok` is set is undefined.
7254 struct LDKDecodeError *err;
7255 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
7258 * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
7259 * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
7260 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7262 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
7264 * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
7265 * `err` or `result` depending on the state of `result_ok`.
7267 union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
7269 * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
7272 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
7275 * The contents of CResult_ChannelDetailsDecodeErrorZ
7277 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
7279 * A pointer to the contents in the success state.
7280 * Reading from this pointer when `result_ok` is not set is undefined.
7282 struct LDKChannelDetails *result;
7284 * A pointer to the contents in the error state.
7285 * Reading from this pointer when `result_ok` is set is undefined.
7287 struct LDKDecodeError *err;
7288 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
7291 * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
7292 * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
7293 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7295 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
7297 * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
7298 * `err` or `result` depending on the state of `result_ok`.
7300 union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
7302 * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
7305 } LDKCResult_ChannelDetailsDecodeErrorZ;
7310 * Route hints used in constructing invoices for [phantom node payents].
7312 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
7314 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
7316 * A pointer to the opaque Rust object.
7317 * Nearly everywhere, inner must be non-null, however in places where
7318 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7320 LDKnativePhantomRouteHints *inner;
7322 * Indicates that this is the only struct which contains the same pointer.
7323 * Rust functions which take ownership of an object provided via an argument require
7324 * this to be true and invalidate the object pointed to by inner.
7327 } LDKPhantomRouteHints;
7330 * The contents of CResult_PhantomRouteHintsDecodeErrorZ
7332 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
7334 * A pointer to the contents in the success state.
7335 * Reading from this pointer when `result_ok` is not set is undefined.
7337 struct LDKPhantomRouteHints *result;
7339 * A pointer to the contents in the error state.
7340 * Reading from this pointer when `result_ok` is set is undefined.
7342 struct LDKDecodeError *err;
7343 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
7346 * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
7347 * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
7348 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7350 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
7352 * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
7353 * `err` or `result` depending on the state of `result_ok`.
7355 union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
7357 * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
7360 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
7363 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
7364 * This corresponds to std::vector in C++
7366 typedef struct LDKCVec_ChannelMonitorZ {
7368 * The elements in the array.
7369 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7371 struct LDKChannelMonitor *data;
7373 * The number of elements pointed to by `data`.
7376 } LDKCVec_ChannelMonitorZ;
7381 * An update generated by the underlying Channel itself which contains some new information the
7382 * ChannelMonitor should be made aware of.
7384 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
7386 * A pointer to the opaque Rust object.
7387 * Nearly everywhere, inner must be non-null, however in places where
7388 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7390 LDKnativeChannelMonitorUpdate *inner;
7392 * Indicates that this is the only struct which contains the same pointer.
7393 * Rust functions which take ownership of an object provided via an argument require
7394 * this to be true and invalidate the object pointed to by inner.
7397 } LDKChannelMonitorUpdate;
7400 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
7401 * blocks are connected and disconnected.
7403 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
7404 * responsible for maintaining a set of monitors such that they can be updated accordingly as
7405 * channel state changes and HTLCs are resolved. See method documentation for specific
7408 * Implementations **must** ensure that updates are successfully applied and persisted upon method
7409 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
7410 * without taking any further action such as persisting the current state.
7412 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
7413 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
7414 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
7415 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
7416 * multiple instances.
7418 * [`PermanentFailure`]: ChannelMonitorUpdateErr::PermanentFailure
7420 typedef struct LDKWatch {
7422 * An opaque pointer which is passed to your function implementations as an argument.
7423 * This has no meaning in the LDK, and can be NULL or any other value.
7427 * Watches a channel identified by `funding_txo` using `monitor`.
7429 * Implementations are responsible for watching the chain for the funding transaction along
7430 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
7431 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
7433 * Note: this interface MUST error with `ChannelMonitorUpdateErr::PermanentFailure` if
7434 * the given `funding_txo` has previously been registered via `watch_channel`.
7436 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
7437 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
7438 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
7440 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
7442 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
7444 * Implementations must call [`update_monitor`] with the given update. See
7445 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
7447 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
7449 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
7451 * Returns any monitor events since the last call. Subsequent calls must only return new
7454 * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
7455 * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
7458 * For details on asynchronous [`ChannelMonitor`] updating and returning
7459 * [`MonitorEvent::UpdateCompleted`] here, see [`ChannelMonitorUpdateErr::TemporaryFailure`].
7461 struct LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ (*release_pending_monitor_events)(const void *this_arg);
7463 * Frees any resources associated with this object given its this_arg pointer.
7464 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7466 void (*free)(void *this_arg);
7470 * An interface to send a transaction to the Bitcoin network.
7472 typedef struct LDKBroadcasterInterface {
7474 * An opaque pointer which is passed to your function implementations as an argument.
7475 * This has no meaning in the LDK, and can be NULL or any other value.
7479 * Sends a transaction out to (hopefully) be mined.
7481 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
7483 * Frees any resources associated with this object given its this_arg pointer.
7484 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7486 void (*free)(void *this_arg);
7487 } LDKBroadcasterInterface;
7490 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
7491 * own the memory pointed to by data.
7493 typedef struct LDKu8slice {
7495 * A pointer to the byte buffer
7497 const uint8_t *data;
7499 * The number of bytes pointed to by `data`.
7505 * A trait to describe an object which can get user secrets and key material.
7507 typedef struct LDKKeysInterface {
7509 * An opaque pointer which is passed to your function implementations as an argument.
7510 * This has no meaning in the LDK, and can be NULL or any other value.
7514 * Get node secret key (aka node_id or network_key) based on the provided [`Recipient`].
7516 * This method must return the same value each time it is called with a given `Recipient`
7519 struct LDKCResult_SecretKeyNoneZ (*get_node_secret)(const void *this_arg, enum LDKRecipient recipient);
7521 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
7523 * This method should return a different value each time it is called, to avoid linking
7524 * on-chain funds across channels as controlled to the same user.
7526 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
7528 * Get a script pubkey which we will send funds to when closing a channel.
7530 * This method should return a different value each time it is called, to avoid linking
7531 * on-chain funds across channels as controlled to the same user.
7533 struct LDKShutdownScript (*get_shutdown_scriptpubkey)(const void *this_arg);
7535 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
7536 * restarted with some stale data!
7538 * This method must return a different value each time it is called.
7540 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
7542 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
7543 * onion packets and for temporary channel IDs. There is no requirement that these be
7544 * persisted anywhere, though they must be unique across restarts.
7546 * This method must return a different value each time it is called.
7548 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
7550 * Reads a `Signer` for this `KeysInterface` from the given input stream.
7551 * This is only called during deserialization of other objects which contain
7552 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
7553 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
7554 * contain no versioning scheme. You may wish to include your own version prefix and ensure
7555 * you've read all of the provided bytes to ensure no corruption occurred.
7557 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
7560 * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
7561 * this trait to parse the invoice and make sure they're signing what they expect, rather than
7562 * blindly signing the hash.
7563 * The hrp is ascii bytes, while the invoice data is base32.
7565 * The secret key used to sign the invoice is dependent on the [`Recipient`].
7567 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z invoice_data, enum LDKRecipient receipient);
7569 * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
7571 * If the implementor of this trait supports [phantom node payments], then every node that is
7572 * intended to be included in the phantom invoice route hints must return the same value from
7575 * This method must return the same value each time it is called.
7577 * [phantom node payments]: PhantomKeysManager
7579 struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
7581 * Frees any resources associated with this object given its this_arg pointer.
7582 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7584 void (*free)(void *this_arg);
7588 * A trait which should be implemented to provide feerate information on a number of time
7591 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
7592 * called from inside the library in response to chain events, P2P events, or timer events).
7594 typedef struct LDKFeeEstimator {
7596 * An opaque pointer which is passed to your function implementations as an argument.
7597 * This has no meaning in the LDK, and can be NULL or any other value.
7601 * Gets estimated satoshis of fee required per 1000 Weight-Units.
7603 * Must return a value no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later
7604 * round-downs don't put us below 1 satoshi-per-byte).
7606 * This method can be implemented with the following unit conversions:
7607 * * max(satoshis-per-byte * 250, 253)
7608 * * max(satoshis-per-kbyte / 4, 253)
7610 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
7612 * Frees any resources associated with this object given its this_arg pointer.
7613 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7615 void (*free)(void *this_arg);
7621 * Manager which keeps track of a number of channels and sends messages to the appropriate
7622 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
7624 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
7625 * to individual Channels.
7627 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
7628 * all peers during write/read (though does not modify this instance, only the instance being
7629 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
7630 * called funding_transaction_generated for outbound channels).
7632 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
7633 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
7634 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
7635 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
7636 * the serialization process). If the deserialized version is out-of-date compared to the
7637 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
7638 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
7640 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
7641 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
7642 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
7643 * block_connected() to step towards your best block) upon deserialization before using the
7646 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
7647 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
7648 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
7649 * offline for a full minute. In order to track this, you must call
7650 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
7652 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
7653 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
7654 * essentially you should default to using a SimpleRefChannelManager, and use a
7655 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
7656 * you're using lightning-net-tokio.
7658 typedef struct MUST_USE_STRUCT LDKChannelManager {
7660 * A pointer to the opaque Rust object.
7661 * Nearly everywhere, inner must be non-null, however in places where
7662 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7664 LDKnativeChannelManager *inner;
7666 * Indicates that this is the only struct which contains the same pointer.
7667 * Rust functions which take ownership of an object provided via an argument require
7668 * this to be true and invalidate the object pointed to by inner.
7671 } LDKChannelManager;
7674 * A tuple of 2 elements. See the individual fields for the types contained.
7676 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
7678 * The element at position 0
7680 struct LDKThirtyTwoBytes a;
7682 * The element at position 1
7684 struct LDKChannelManager b;
7685 } LDKC2Tuple_BlockHashChannelManagerZ;
7688 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
7690 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
7692 * A pointer to the contents in the success state.
7693 * Reading from this pointer when `result_ok` is not set is undefined.
7695 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
7697 * A pointer to the contents in the error state.
7698 * Reading from this pointer when `result_ok` is set is undefined.
7700 struct LDKDecodeError *err;
7701 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
7704 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
7705 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
7706 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7708 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
7710 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
7711 * `err` or `result` depending on the state of `result_ok`.
7713 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
7715 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
7718 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
7723 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
7724 * with our counterparty.
7726 typedef struct MUST_USE_STRUCT LDKChannelConfig {
7728 * A pointer to the opaque Rust object.
7729 * Nearly everywhere, inner must be non-null, however in places where
7730 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7732 LDKnativeChannelConfig *inner;
7734 * Indicates that this is the only struct which contains the same pointer.
7735 * Rust functions which take ownership of an object provided via an argument require
7736 * this to be true and invalidate the object pointed to by inner.
7742 * The contents of CResult_ChannelConfigDecodeErrorZ
7744 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
7746 * A pointer to the contents in the success state.
7747 * Reading from this pointer when `result_ok` is not set is undefined.
7749 struct LDKChannelConfig *result;
7751 * A pointer to the contents in the error state.
7752 * Reading from this pointer when `result_ok` is set is undefined.
7754 struct LDKDecodeError *err;
7755 } LDKCResult_ChannelConfigDecodeErrorZPtr;
7758 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
7759 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
7760 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7762 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
7764 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
7765 * `err` or `result` depending on the state of `result_ok`.
7767 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
7769 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
7772 } LDKCResult_ChannelConfigDecodeErrorZ;
7775 * The contents of CResult_OutPointDecodeErrorZ
7777 typedef union LDKCResult_OutPointDecodeErrorZPtr {
7779 * A pointer to the contents in the success state.
7780 * Reading from this pointer when `result_ok` is not set is undefined.
7782 struct LDKOutPoint *result;
7784 * A pointer to the contents in the error state.
7785 * Reading from this pointer when `result_ok` is set is undefined.
7787 struct LDKDecodeError *err;
7788 } LDKCResult_OutPointDecodeErrorZPtr;
7791 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
7792 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
7793 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7795 typedef struct LDKCResult_OutPointDecodeErrorZ {
7797 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
7798 * `err` or `result` depending on the state of `result_ok`.
7800 union LDKCResult_OutPointDecodeErrorZPtr contents;
7802 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
7805 } LDKCResult_OutPointDecodeErrorZ;
7808 * Defines a type identifier for sending messages over the wire.
7810 * Messages implementing this trait specify a type and must be [`Writeable`].
7812 typedef struct LDKType {
7814 * An opaque pointer which is passed to your function implementations as an argument.
7815 * This has no meaning in the LDK, and can be NULL or any other value.
7819 * Returns the type identifying the message payload.
7821 uint16_t (*type_id)(const void *this_arg);
7823 * Return a human-readable "debug" string describing this object
7825 struct LDKStr (*debug_str)(const void *this_arg);
7827 * Serialize the object into a byte array
7829 struct LDKCVec_u8Z (*write)(const void *this_arg);
7831 * Frees any resources associated with this object given its this_arg pointer.
7832 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7834 void (*free)(void *this_arg);
7838 * An enum which can either contain a crate::lightning::ln::wire::Type or not
7840 typedef enum LDKCOption_TypeZ_Tag {
7842 * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
7844 LDKCOption_TypeZ_Some,
7846 * When we're in this state, this COption_TypeZ contains nothing
7848 LDKCOption_TypeZ_None,
7850 * Must be last for serialization purposes
7852 LDKCOption_TypeZ_Sentinel,
7853 } LDKCOption_TypeZ_Tag;
7855 typedef struct LDKCOption_TypeZ {
7856 LDKCOption_TypeZ_Tag tag;
7859 struct LDKType some;
7865 * The contents of CResult_COption_TypeZDecodeErrorZ
7867 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
7869 * A pointer to the contents in the success state.
7870 * Reading from this pointer when `result_ok` is not set is undefined.
7872 struct LDKCOption_TypeZ *result;
7874 * A pointer to the contents in the error state.
7875 * Reading from this pointer when `result_ok` is set is undefined.
7877 struct LDKDecodeError *err;
7878 } LDKCResult_COption_TypeZDecodeErrorZPtr;
7881 * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
7882 * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
7883 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7885 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
7887 * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
7888 * `err` or `result` depending on the state of `result_ok`.
7890 union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
7892 * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
7895 } LDKCResult_COption_TypeZDecodeErrorZ;
7898 * An error that may occur when making a payment.
7900 typedef enum LDKPaymentError_Tag {
7902 * An error resulting from the provided [`Invoice`] or payment hash.
7904 LDKPaymentError_Invoice,
7906 * An error occurring when finding a route.
7908 LDKPaymentError_Routing,
7910 * An error occurring when sending a payment.
7912 LDKPaymentError_Sending,
7914 * Must be last for serialization purposes
7916 LDKPaymentError_Sentinel,
7917 } LDKPaymentError_Tag;
7919 typedef struct MUST_USE_STRUCT LDKPaymentError {
7920 LDKPaymentError_Tag tag;
7923 struct LDKStr invoice;
7926 struct LDKLightningError routing;
7929 struct LDKPaymentSendFailure sending;
7935 * The contents of CResult_PaymentIdPaymentErrorZ
7937 typedef union LDKCResult_PaymentIdPaymentErrorZPtr {
7939 * A pointer to the contents in the success state.
7940 * Reading from this pointer when `result_ok` is not set is undefined.
7942 struct LDKThirtyTwoBytes *result;
7944 * A pointer to the contents in the error state.
7945 * Reading from this pointer when `result_ok` is set is undefined.
7947 struct LDKPaymentError *err;
7948 } LDKCResult_PaymentIdPaymentErrorZPtr;
7951 * A CResult_PaymentIdPaymentErrorZ represents the result of a fallible operation,
7952 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning_invoice::payment::PaymentError on failure.
7953 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7955 typedef struct LDKCResult_PaymentIdPaymentErrorZ {
7957 * The contents of this CResult_PaymentIdPaymentErrorZ, accessible via either
7958 * `err` or `result` depending on the state of `result_ok`.
7960 union LDKCResult_PaymentIdPaymentErrorZPtr contents;
7962 * Whether this CResult_PaymentIdPaymentErrorZ represents a success state.
7965 } LDKCResult_PaymentIdPaymentErrorZ;
7968 * Sub-errors which don't have specific information in them use this type.
7970 typedef struct LDKError {
7972 * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
7978 * Errors that indicate what is wrong with the invoice. They have some granularity for debug
7979 * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
7981 typedef enum LDKParseError_Tag {
7982 LDKParseError_Bech32Error,
7983 LDKParseError_ParseAmountError,
7984 LDKParseError_MalformedSignature,
7985 LDKParseError_BadPrefix,
7986 LDKParseError_UnknownCurrency,
7987 LDKParseError_UnknownSiPrefix,
7988 LDKParseError_MalformedHRP,
7989 LDKParseError_TooShortDataPart,
7990 LDKParseError_UnexpectedEndOfTaggedFields,
7991 LDKParseError_DescriptionDecodeError,
7992 LDKParseError_PaddingError,
7993 LDKParseError_IntegerOverflowError,
7994 LDKParseError_InvalidSegWitProgramLength,
7995 LDKParseError_InvalidPubKeyHashLength,
7996 LDKParseError_InvalidScriptHashLength,
7997 LDKParseError_InvalidRecoveryId,
7998 LDKParseError_InvalidSliceLength,
8000 * Not an error, but used internally to signal that a part of the invoice should be ignored
8001 * according to BOLT11
8005 * Must be last for serialization purposes
8007 LDKParseError_Sentinel,
8008 } LDKParseError_Tag;
8010 typedef struct MUST_USE_STRUCT LDKParseError {
8011 LDKParseError_Tag tag;
8014 struct LDKBech32Error bech32_error;
8017 struct LDKError parse_amount_error;
8020 enum LDKSecp256k1Error malformed_signature;
8023 struct LDKError description_decode_error;
8026 struct LDKStr invalid_slice_length;
8032 * The contents of CResult_SiPrefixParseErrorZ
8034 typedef union LDKCResult_SiPrefixParseErrorZPtr {
8036 * A pointer to the contents in the success state.
8037 * Reading from this pointer when `result_ok` is not set is undefined.
8039 enum LDKSiPrefix *result;
8041 * A pointer to the contents in the error state.
8042 * Reading from this pointer when `result_ok` is set is undefined.
8044 struct LDKParseError *err;
8045 } LDKCResult_SiPrefixParseErrorZPtr;
8048 * A CResult_SiPrefixParseErrorZ represents the result of a fallible operation,
8049 * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::ParseError on failure.
8050 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8052 typedef struct LDKCResult_SiPrefixParseErrorZ {
8054 * The contents of this CResult_SiPrefixParseErrorZ, accessible via either
8055 * `err` or `result` depending on the state of `result_ok`.
8057 union LDKCResult_SiPrefixParseErrorZPtr contents;
8059 * Whether this CResult_SiPrefixParseErrorZ represents a success state.
8062 } LDKCResult_SiPrefixParseErrorZ;
8067 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
8069 * There are three ways to construct an `Invoice`:
8070 * 1. using `InvoiceBuilder`
8071 * 2. using `Invoice::from_signed(SignedRawInvoice)`
8072 * 3. using `str::parse::<Invoice>(&str)`
8074 typedef struct MUST_USE_STRUCT LDKInvoice {
8076 * A pointer to the opaque Rust object.
8077 * Nearly everywhere, inner must be non-null, however in places where
8078 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8080 LDKnativeInvoice *inner;
8082 * Indicates that this is the only struct which contains the same pointer.
8083 * Rust functions which take ownership of an object provided via an argument require
8084 * this to be true and invalidate the object pointed to by inner.
8090 * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
8091 * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
8092 * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
8094 typedef enum LDKParseOrSemanticError_Tag {
8096 * The invoice couldn't be decoded
8098 LDKParseOrSemanticError_ParseError,
8100 * The invoice could be decoded but violates the BOLT11 standard
8102 LDKParseOrSemanticError_SemanticError,
8104 * Must be last for serialization purposes
8106 LDKParseOrSemanticError_Sentinel,
8107 } LDKParseOrSemanticError_Tag;
8109 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
8110 LDKParseOrSemanticError_Tag tag;
8113 struct LDKParseError parse_error;
8116 enum LDKSemanticError semantic_error;
8119 } LDKParseOrSemanticError;
8122 * The contents of CResult_InvoiceParseOrSemanticErrorZ
8124 typedef union LDKCResult_InvoiceParseOrSemanticErrorZPtr {
8126 * A pointer to the contents in the success state.
8127 * Reading from this pointer when `result_ok` is not set is undefined.
8129 struct LDKInvoice *result;
8131 * A pointer to the contents in the error state.
8132 * Reading from this pointer when `result_ok` is set is undefined.
8134 struct LDKParseOrSemanticError *err;
8135 } LDKCResult_InvoiceParseOrSemanticErrorZPtr;
8138 * A CResult_InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
8139 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
8140 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8142 typedef struct LDKCResult_InvoiceParseOrSemanticErrorZ {
8144 * The contents of this CResult_InvoiceParseOrSemanticErrorZ, accessible via either
8145 * `err` or `result` depending on the state of `result_ok`.
8147 union LDKCResult_InvoiceParseOrSemanticErrorZPtr contents;
8149 * Whether this CResult_InvoiceParseOrSemanticErrorZ represents a success state.
8152 } LDKCResult_InvoiceParseOrSemanticErrorZ;
8157 * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
8161 * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
8163 typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
8165 * A pointer to the opaque Rust object.
8166 * Nearly everywhere, inner must be non-null, however in places where
8167 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8169 LDKnativeSignedRawInvoice *inner;
8171 * Indicates that this is the only struct which contains the same pointer.
8172 * Rust functions which take ownership of an object provided via an argument require
8173 * this to be true and invalidate the object pointed to by inner.
8176 } LDKSignedRawInvoice;
8179 * The contents of CResult_SignedRawInvoiceParseErrorZ
8181 typedef union LDKCResult_SignedRawInvoiceParseErrorZPtr {
8183 * A pointer to the contents in the success state.
8184 * Reading from this pointer when `result_ok` is not set is undefined.
8186 struct LDKSignedRawInvoice *result;
8188 * A pointer to the contents in the error state.
8189 * Reading from this pointer when `result_ok` is set is undefined.
8191 struct LDKParseError *err;
8192 } LDKCResult_SignedRawInvoiceParseErrorZPtr;
8195 * A CResult_SignedRawInvoiceParseErrorZ represents the result of a fallible operation,
8196 * containing a crate::lightning_invoice::SignedRawInvoice on success and a crate::lightning_invoice::ParseError on failure.
8197 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8199 typedef struct LDKCResult_SignedRawInvoiceParseErrorZ {
8201 * The contents of this CResult_SignedRawInvoiceParseErrorZ, accessible via either
8202 * `err` or `result` depending on the state of `result_ok`.
8204 union LDKCResult_SignedRawInvoiceParseErrorZPtr contents;
8206 * Whether this CResult_SignedRawInvoiceParseErrorZ represents a success state.
8209 } LDKCResult_SignedRawInvoiceParseErrorZ;
8214 * Represents an syntactically correct Invoice for a payment on the lightning network,
8215 * but without the signature information.
8216 * De- and encoding should not lead to information loss but may lead to different hashes.
8218 * For methods without docs see the corresponding methods in `Invoice`.
8220 typedef struct MUST_USE_STRUCT LDKRawInvoice {
8222 * A pointer to the opaque Rust object.
8223 * Nearly everywhere, inner must be non-null, however in places where
8224 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8226 LDKnativeRawInvoice *inner;
8228 * Indicates that this is the only struct which contains the same pointer.
8229 * Rust functions which take ownership of an object provided via an argument require
8230 * this to be true and invalidate the object pointed to by inner.
8238 * Recoverable signature
8240 typedef struct MUST_USE_STRUCT LDKInvoiceSignature {
8242 * A pointer to the opaque Rust object.
8243 * Nearly everywhere, inner must be non-null, however in places where
8244 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8246 LDKnativeInvoiceSignature *inner;
8248 * Indicates that this is the only struct which contains the same pointer.
8249 * Rust functions which take ownership of an object provided via an argument require
8250 * this to be true and invalidate the object pointed to by inner.
8253 } LDKInvoiceSignature;
8256 * A tuple of 3 elements. See the individual fields for the types contained.
8258 typedef struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ {
8260 * The element at position 0
8262 struct LDKRawInvoice a;
8264 * The element at position 1
8266 struct LDKThirtyTwoBytes b;
8268 * The element at position 2
8270 struct LDKInvoiceSignature c;
8271 } LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ;
8278 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
8280 * A pointer to the opaque Rust object.
8281 * Nearly everywhere, inner must be non-null, however in places where
8282 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8284 LDKnativePayeePubKey *inner;
8286 * Indicates that this is the only struct which contains the same pointer.
8287 * Rust functions which take ownership of an object provided via an argument require
8288 * this to be true and invalidate the object pointed to by inner.
8294 * The contents of CResult_PayeePubKeyErrorZ
8296 typedef union LDKCResult_PayeePubKeyErrorZPtr {
8298 * A pointer to the contents in the success state.
8299 * Reading from this pointer when `result_ok` is not set is undefined.
8301 struct LDKPayeePubKey *result;
8303 * A pointer to the contents in the error state.
8304 * Reading from this pointer when `result_ok` is set is undefined.
8306 enum LDKSecp256k1Error *err;
8307 } LDKCResult_PayeePubKeyErrorZPtr;
8310 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
8311 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
8312 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8314 typedef struct LDKCResult_PayeePubKeyErrorZ {
8316 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
8317 * `err` or `result` depending on the state of `result_ok`.
8319 union LDKCResult_PayeePubKeyErrorZPtr contents;
8321 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
8324 } LDKCResult_PayeePubKeyErrorZ;
8329 * Private routing information
8332 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
8335 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
8337 * A pointer to the opaque Rust object.
8338 * Nearly everywhere, inner must be non-null, however in places where
8339 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8341 LDKnativePrivateRoute *inner;
8343 * Indicates that this is the only struct which contains the same pointer.
8344 * Rust functions which take ownership of an object provided via an argument require
8345 * this to be true and invalidate the object pointed to by inner.
8351 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
8352 * This corresponds to std::vector in C++
8354 typedef struct LDKCVec_PrivateRouteZ {
8356 * The elements in the array.
8357 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8359 struct LDKPrivateRoute *data;
8361 * The number of elements pointed to by `data`.
8364 } LDKCVec_PrivateRouteZ;
8369 * A timestamp that refers to a date after 1 January 1970.
8373 * The Unix timestamp representing the stored time has to be positive and no greater than
8374 * [`MAX_TIMESTAMP`].
8376 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
8378 * A pointer to the opaque Rust object.
8379 * Nearly everywhere, inner must be non-null, however in places where
8380 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8382 LDKnativePositiveTimestamp *inner;
8384 * Indicates that this is the only struct which contains the same pointer.
8385 * Rust functions which take ownership of an object provided via an argument require
8386 * this to be true and invalidate the object pointed to by inner.
8389 } LDKPositiveTimestamp;
8392 * The contents of CResult_PositiveTimestampCreationErrorZ
8394 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
8396 * A pointer to the contents in the success state.
8397 * Reading from this pointer when `result_ok` is not set is undefined.
8399 struct LDKPositiveTimestamp *result;
8401 * A pointer to the contents in the error state.
8402 * Reading from this pointer when `result_ok` is set is undefined.
8404 enum LDKCreationError *err;
8405 } LDKCResult_PositiveTimestampCreationErrorZPtr;
8408 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
8409 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
8410 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8412 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
8414 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
8415 * `err` or `result` depending on the state of `result_ok`.
8417 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
8419 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
8422 } LDKCResult_PositiveTimestampCreationErrorZ;
8425 * The contents of CResult_NoneSemanticErrorZ
8427 typedef union LDKCResult_NoneSemanticErrorZPtr {
8429 * Note that this value is always NULL, as there are no contents in the OK variant
8433 * A pointer to the contents in the error state.
8434 * Reading from this pointer when `result_ok` is set is undefined.
8436 enum LDKSemanticError *err;
8437 } LDKCResult_NoneSemanticErrorZPtr;
8440 * A CResult_NoneSemanticErrorZ represents the result of a fallible operation,
8441 * containing a () on success and a crate::lightning_invoice::SemanticError on failure.
8442 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8444 typedef struct LDKCResult_NoneSemanticErrorZ {
8446 * The contents of this CResult_NoneSemanticErrorZ, accessible via either
8447 * `err` or `result` depending on the state of `result_ok`.
8449 union LDKCResult_NoneSemanticErrorZPtr contents;
8451 * Whether this CResult_NoneSemanticErrorZ represents a success state.
8454 } LDKCResult_NoneSemanticErrorZ;
8457 * The contents of CResult_InvoiceSemanticErrorZ
8459 typedef union LDKCResult_InvoiceSemanticErrorZPtr {
8461 * A pointer to the contents in the success state.
8462 * Reading from this pointer when `result_ok` is not set is undefined.
8464 struct LDKInvoice *result;
8466 * A pointer to the contents in the error state.
8467 * Reading from this pointer when `result_ok` is set is undefined.
8469 enum LDKSemanticError *err;
8470 } LDKCResult_InvoiceSemanticErrorZPtr;
8473 * A CResult_InvoiceSemanticErrorZ represents the result of a fallible operation,
8474 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SemanticError on failure.
8475 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8477 typedef struct LDKCResult_InvoiceSemanticErrorZ {
8479 * The contents of this CResult_InvoiceSemanticErrorZ, accessible via either
8480 * `err` or `result` depending on the state of `result_ok`.
8482 union LDKCResult_InvoiceSemanticErrorZPtr contents;
8484 * Whether this CResult_InvoiceSemanticErrorZ represents a success state.
8487 } LDKCResult_InvoiceSemanticErrorZ;
8492 * Description string
8495 * The description can be at most 639 __bytes__ long
8497 typedef struct MUST_USE_STRUCT LDKDescription {
8499 * A pointer to the opaque Rust object.
8500 * Nearly everywhere, inner must be non-null, however in places where
8501 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8503 LDKnativeDescription *inner;
8505 * Indicates that this is the only struct which contains the same pointer.
8506 * Rust functions which take ownership of an object provided via an argument require
8507 * this to be true and invalidate the object pointed to by inner.
8513 * The contents of CResult_DescriptionCreationErrorZ
8515 typedef union LDKCResult_DescriptionCreationErrorZPtr {
8517 * A pointer to the contents in the success state.
8518 * Reading from this pointer when `result_ok` is not set is undefined.
8520 struct LDKDescription *result;
8522 * A pointer to the contents in the error state.
8523 * Reading from this pointer when `result_ok` is set is undefined.
8525 enum LDKCreationError *err;
8526 } LDKCResult_DescriptionCreationErrorZPtr;
8529 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
8530 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
8531 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8533 typedef struct LDKCResult_DescriptionCreationErrorZ {
8535 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
8536 * `err` or `result` depending on the state of `result_ok`.
8538 union LDKCResult_DescriptionCreationErrorZPtr contents;
8540 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
8543 } LDKCResult_DescriptionCreationErrorZ;
8546 * The contents of CResult_PrivateRouteCreationErrorZ
8548 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
8550 * A pointer to the contents in the success state.
8551 * Reading from this pointer when `result_ok` is not set is undefined.
8553 struct LDKPrivateRoute *result;
8555 * A pointer to the contents in the error state.
8556 * Reading from this pointer when `result_ok` is set is undefined.
8558 enum LDKCreationError *err;
8559 } LDKCResult_PrivateRouteCreationErrorZPtr;
8562 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
8563 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
8564 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8566 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
8568 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
8569 * `err` or `result` depending on the state of `result_ok`.
8571 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
8573 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
8576 } LDKCResult_PrivateRouteCreationErrorZ;
8579 * The contents of CResult_StringErrorZ
8581 typedef union LDKCResult_StringErrorZPtr {
8583 * A pointer to the contents in the success state.
8584 * Reading from this pointer when `result_ok` is not set is undefined.
8586 struct LDKStr *result;
8588 * A pointer to the contents in the error state.
8589 * Reading from this pointer when `result_ok` is set is undefined.
8591 enum LDKSecp256k1Error *err;
8592 } LDKCResult_StringErrorZPtr;
8595 * A CResult_StringErrorZ represents the result of a fallible operation,
8596 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
8597 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8599 typedef struct LDKCResult_StringErrorZ {
8601 * The contents of this CResult_StringErrorZ, accessible via either
8602 * `err` or `result` depending on the state of `result_ok`.
8604 union LDKCResult_StringErrorZPtr contents;
8606 * Whether this CResult_StringErrorZ represents a success state.
8609 } LDKCResult_StringErrorZ;
8612 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
8614 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
8616 * A pointer to the contents in the success state.
8617 * Reading from this pointer when `result_ok` is not set is undefined.
8619 struct LDKChannelMonitorUpdate *result;
8621 * A pointer to the contents in the error state.
8622 * Reading from this pointer when `result_ok` is set is undefined.
8624 struct LDKDecodeError *err;
8625 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
8628 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
8629 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
8630 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8632 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
8634 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
8635 * `err` or `result` depending on the state of `result_ok`.
8637 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
8639 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
8642 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
8645 * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
8647 typedef enum LDKCOption_MonitorEventZ_Tag {
8649 * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
8651 LDKCOption_MonitorEventZ_Some,
8653 * When we're in this state, this COption_MonitorEventZ contains nothing
8655 LDKCOption_MonitorEventZ_None,
8657 * Must be last for serialization purposes
8659 LDKCOption_MonitorEventZ_Sentinel,
8660 } LDKCOption_MonitorEventZ_Tag;
8662 typedef struct LDKCOption_MonitorEventZ {
8663 LDKCOption_MonitorEventZ_Tag tag;
8666 struct LDKMonitorEvent some;
8669 } LDKCOption_MonitorEventZ;
8672 * The contents of CResult_COption_MonitorEventZDecodeErrorZ
8674 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
8676 * A pointer to the contents in the success state.
8677 * Reading from this pointer when `result_ok` is not set is undefined.
8679 struct LDKCOption_MonitorEventZ *result;
8681 * A pointer to the contents in the error state.
8682 * Reading from this pointer when `result_ok` is set is undefined.
8684 struct LDKDecodeError *err;
8685 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
8688 * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
8689 * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
8690 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8692 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
8694 * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
8695 * `err` or `result` depending on the state of `result_ok`.
8697 union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
8699 * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
8702 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
8705 * The contents of CResult_HTLCUpdateDecodeErrorZ
8707 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
8709 * A pointer to the contents in the success state.
8710 * Reading from this pointer when `result_ok` is not set is undefined.
8712 struct LDKHTLCUpdate *result;
8714 * A pointer to the contents in the error state.
8715 * Reading from this pointer when `result_ok` is set is undefined.
8717 struct LDKDecodeError *err;
8718 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
8721 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
8722 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
8723 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8725 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
8727 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
8728 * `err` or `result` depending on the state of `result_ok`.
8730 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
8732 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
8735 } LDKCResult_HTLCUpdateDecodeErrorZ;
8738 * A tuple of 2 elements. See the individual fields for the types contained.
8740 typedef struct LDKC2Tuple_OutPointScriptZ {
8742 * The element at position 0
8744 struct LDKOutPoint a;
8746 * The element at position 1
8748 struct LDKCVec_u8Z b;
8749 } LDKC2Tuple_OutPointScriptZ;
8752 * A tuple of 2 elements. See the individual fields for the types contained.
8754 typedef struct LDKC2Tuple_u32ScriptZ {
8756 * The element at position 0
8760 * The element at position 1
8762 struct LDKCVec_u8Z b;
8763 } LDKC2Tuple_u32ScriptZ;
8766 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
8767 * This corresponds to std::vector in C++
8769 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
8771 * The elements in the array.
8772 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8774 struct LDKC2Tuple_u32ScriptZ *data;
8776 * The number of elements pointed to by `data`.
8779 } LDKCVec_C2Tuple_u32ScriptZZ;
8782 * A tuple of 2 elements. See the individual fields for the types contained.
8784 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
8786 * The element at position 0
8788 struct LDKThirtyTwoBytes a;
8790 * The element at position 1
8792 struct LDKCVec_C2Tuple_u32ScriptZZ b;
8793 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
8796 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
8797 * This corresponds to std::vector in C++
8799 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
8801 * The elements in the array.
8802 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8804 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
8806 * The number of elements pointed to by `data`.
8809 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
8812 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
8813 * This corresponds to std::vector in C++
8815 typedef struct LDKCVec_EventZ {
8817 * The elements in the array.
8818 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8820 struct LDKEvent *data;
8822 * The number of elements pointed to by `data`.
8828 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
8829 * This corresponds to std::vector in C++
8831 typedef struct LDKCVec_TransactionZ {
8833 * The elements in the array.
8834 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8836 struct LDKTransaction *data;
8838 * The number of elements pointed to by `data`.
8841 } LDKCVec_TransactionZ;
8844 * A tuple of 2 elements. See the individual fields for the types contained.
8846 typedef struct LDKC2Tuple_u32TxOutZ {
8848 * The element at position 0
8852 * The element at position 1
8855 } LDKC2Tuple_u32TxOutZ;
8858 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
8859 * This corresponds to std::vector in C++
8861 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
8863 * The elements in the array.
8864 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8866 struct LDKC2Tuple_u32TxOutZ *data;
8868 * The number of elements pointed to by `data`.
8871 } LDKCVec_C2Tuple_u32TxOutZZ;
8874 * A tuple of 2 elements. See the individual fields for the types contained.
8876 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
8878 * The element at position 0
8880 struct LDKThirtyTwoBytes a;
8882 * The element at position 1
8884 struct LDKCVec_C2Tuple_u32TxOutZZ b;
8885 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
8888 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
8889 * This corresponds to std::vector in C++
8891 typedef struct LDKCVec_TransactionOutputsZ {
8893 * The elements in the array.
8894 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8896 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
8898 * The number of elements pointed to by `data`.
8901 } LDKCVec_TransactionOutputsZ;
8904 * Details about the balance(s) available for spending once the channel appears on chain.
8906 * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
8909 typedef enum LDKBalance_Tag {
8911 * The channel is not yet closed (or the commitment or closing transaction has not yet
8912 * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
8915 LDKBalance_ClaimableOnChannelClose,
8917 * The channel has been closed, and the given balance is ours but awaiting confirmations until
8918 * we consider it spendable.
8920 LDKBalance_ClaimableAwaitingConfirmations,
8922 * The channel has been closed, and the given balance should be ours but awaiting spending
8923 * transaction confirmation. If the spending transaction does not confirm in time, it is
8924 * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
8926 * Once the spending transaction confirms, before it has reached enough confirmations to be
8927 * considered safe from chain reorganizations, the balance will instead be provided via
8928 * [`Balance::ClaimableAwaitingConfirmations`].
8930 LDKBalance_ContentiousClaimable,
8932 * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
8933 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
8934 * likely to be claimed by our counterparty before we do.
8936 LDKBalance_MaybeClaimableHTLCAwaitingTimeout,
8938 * Must be last for serialization purposes
8940 LDKBalance_Sentinel,
8943 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
8945 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
8946 * required to do so.
8948 uint64_t claimable_amount_satoshis;
8949 } LDKBalance_LDKClaimableOnChannelClose_Body;
8951 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
8953 * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
8954 * were spent in broadcasting the transaction.
8956 uint64_t claimable_amount_satoshis;
8958 * The height at which an [`Event::SpendableOutputs`] event will be generated for this
8961 uint32_t confirmation_height;
8962 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
8964 typedef struct LDKBalance_LDKContentiousClaimable_Body {
8966 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
8967 * required to do so.
8969 uint64_t claimable_amount_satoshis;
8971 * The height at which the counterparty may be able to claim the balance if we have not
8974 uint32_t timeout_height;
8975 } LDKBalance_LDKContentiousClaimable_Body;
8977 typedef struct LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body {
8979 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
8980 * required to do so.
8982 uint64_t claimable_amount_satoshis;
8984 * The height at which we will be able to claim the balance if our counterparty has not
8987 uint32_t claimable_height;
8988 } LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body;
8990 typedef struct MUST_USE_STRUCT LDKBalance {
8993 LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
8994 LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
8995 LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
8996 LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body maybe_claimable_htlc_awaiting_timeout;
9001 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
9002 * This corresponds to std::vector in C++
9004 typedef struct LDKCVec_BalanceZ {
9006 * The elements in the array.
9007 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9009 struct LDKBalance *data;
9011 * The number of elements pointed to by `data`.
9017 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
9019 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
9021 * A pointer to the contents in the success state.
9022 * Reading from this pointer when `result_ok` is not set is undefined.
9024 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
9026 * A pointer to the contents in the error state.
9027 * Reading from this pointer when `result_ok` is set is undefined.
9029 struct LDKDecodeError *err;
9030 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
9033 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
9034 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9035 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9037 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
9039 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
9040 * `err` or `result` depending on the state of `result_ok`.
9042 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
9044 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
9047 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
9050 * A tuple of 2 elements. See the individual fields for the types contained.
9052 typedef struct LDKC2Tuple_PublicKeyTypeZ {
9054 * The element at position 0
9056 struct LDKPublicKey a;
9058 * The element at position 1
9061 } LDKC2Tuple_PublicKeyTypeZ;
9064 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
9065 * This corresponds to std::vector in C++
9067 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
9069 * The elements in the array.
9070 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9072 struct LDKC2Tuple_PublicKeyTypeZ *data;
9074 * The number of elements pointed to by `data`.
9077 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
9080 * An enum which can either contain a crate::lightning::ln::msgs::NetAddress or not
9082 typedef enum LDKCOption_NetAddressZ_Tag {
9084 * When we're in this state, this COption_NetAddressZ contains a crate::lightning::ln::msgs::NetAddress
9086 LDKCOption_NetAddressZ_Some,
9088 * When we're in this state, this COption_NetAddressZ contains nothing
9090 LDKCOption_NetAddressZ_None,
9092 * Must be last for serialization purposes
9094 LDKCOption_NetAddressZ_Sentinel,
9095 } LDKCOption_NetAddressZ_Tag;
9097 typedef struct LDKCOption_NetAddressZ {
9098 LDKCOption_NetAddressZ_Tag tag;
9101 struct LDKNetAddress some;
9104 } LDKCOption_NetAddressZ;
9109 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
9110 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
9113 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
9115 * A pointer to the opaque Rust object.
9116 * Nearly everywhere, inner must be non-null, however in places where
9117 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9119 LDKnativePeerHandleError *inner;
9121 * Indicates that this is the only struct which contains the same pointer.
9122 * Rust functions which take ownership of an object provided via an argument require
9123 * this to be true and invalidate the object pointed to by inner.
9126 } LDKPeerHandleError;
9129 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
9131 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
9133 * A pointer to the contents in the success state.
9134 * Reading from this pointer when `result_ok` is not set is undefined.
9136 struct LDKCVec_u8Z *result;
9138 * A pointer to the contents in the error state.
9139 * Reading from this pointer when `result_ok` is set is undefined.
9141 struct LDKPeerHandleError *err;
9142 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
9145 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
9146 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9147 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9149 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
9151 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
9152 * `err` or `result` depending on the state of `result_ok`.
9154 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
9156 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
9159 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
9162 * The contents of CResult_NonePeerHandleErrorZ
9164 typedef union LDKCResult_NonePeerHandleErrorZPtr {
9166 * Note that this value is always NULL, as there are no contents in the OK variant
9170 * A pointer to the contents in the error state.
9171 * Reading from this pointer when `result_ok` is set is undefined.
9173 struct LDKPeerHandleError *err;
9174 } LDKCResult_NonePeerHandleErrorZPtr;
9177 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
9178 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9179 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9181 typedef struct LDKCResult_NonePeerHandleErrorZ {
9183 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
9184 * `err` or `result` depending on the state of `result_ok`.
9186 union LDKCResult_NonePeerHandleErrorZPtr contents;
9188 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
9191 } LDKCResult_NonePeerHandleErrorZ;
9194 * The contents of CResult_boolPeerHandleErrorZ
9196 typedef union LDKCResult_boolPeerHandleErrorZPtr {
9198 * A pointer to the contents in the success state.
9199 * Reading from this pointer when `result_ok` is not set is undefined.
9203 * A pointer to the contents in the error state.
9204 * Reading from this pointer when `result_ok` is set is undefined.
9206 struct LDKPeerHandleError *err;
9207 } LDKCResult_boolPeerHandleErrorZPtr;
9210 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
9211 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9212 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9214 typedef struct LDKCResult_boolPeerHandleErrorZ {
9216 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
9217 * `err` or `result` depending on the state of `result_ok`.
9219 union LDKCResult_boolPeerHandleErrorZPtr contents;
9221 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
9224 } LDKCResult_boolPeerHandleErrorZ;
9227 * All-encompassing standard error type that processing can return
9229 typedef enum LDKGraphSyncError_Tag {
9231 * Error trying to read the update data, typically due to an erroneous data length indication
9232 * that is greater than the actual amount of data provided
9234 LDKGraphSyncError_DecodeError,
9236 * Error applying the patch to the network graph, usually the result of updates that are too
9237 * old or missing prerequisite data to the application of updates out of order
9239 LDKGraphSyncError_LightningError,
9241 * Must be last for serialization purposes
9243 LDKGraphSyncError_Sentinel,
9244 } LDKGraphSyncError_Tag;
9246 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
9247 LDKGraphSyncError_Tag tag;
9250 struct LDKDecodeError decode_error;
9253 struct LDKLightningError lightning_error;
9256 } LDKGraphSyncError;
9259 * The contents of CResult_u32GraphSyncErrorZ
9261 typedef union LDKCResult_u32GraphSyncErrorZPtr {
9263 * A pointer to the contents in the success state.
9264 * Reading from this pointer when `result_ok` is not set is undefined.
9268 * A pointer to the contents in the error state.
9269 * Reading from this pointer when `result_ok` is set is undefined.
9271 struct LDKGraphSyncError *err;
9272 } LDKCResult_u32GraphSyncErrorZPtr;
9275 * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
9276 * containing a u32 on success and a crate::lightning_rapid_gossip_sync::error::GraphSyncError on failure.
9277 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9279 typedef struct LDKCResult_u32GraphSyncErrorZ {
9281 * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
9282 * `err` or `result` depending on the state of `result_ok`.
9284 union LDKCResult_u32GraphSyncErrorZPtr contents;
9286 * Whether this CResult_u32GraphSyncErrorZ represents a success state.
9289 } LDKCResult_u32GraphSyncErrorZ;
9292 * The contents of CResult_NetAddressDecodeErrorZ
9294 typedef union LDKCResult_NetAddressDecodeErrorZPtr {
9296 * A pointer to the contents in the success state.
9297 * Reading from this pointer when `result_ok` is not set is undefined.
9299 struct LDKNetAddress *result;
9301 * A pointer to the contents in the error state.
9302 * Reading from this pointer when `result_ok` is set is undefined.
9304 struct LDKDecodeError *err;
9305 } LDKCResult_NetAddressDecodeErrorZPtr;
9308 * A CResult_NetAddressDecodeErrorZ represents the result of a fallible operation,
9309 * containing a crate::lightning::ln::msgs::NetAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
9310 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9312 typedef struct LDKCResult_NetAddressDecodeErrorZ {
9314 * The contents of this CResult_NetAddressDecodeErrorZ, accessible via either
9315 * `err` or `result` depending on the state of `result_ok`.
9317 union LDKCResult_NetAddressDecodeErrorZPtr contents;
9319 * Whether this CResult_NetAddressDecodeErrorZ represents a success state.
9322 } LDKCResult_NetAddressDecodeErrorZ;
9327 * An update_add_htlc message to be sent or received from a peer
9329 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
9331 * A pointer to the opaque Rust object.
9332 * Nearly everywhere, inner must be non-null, however in places where
9333 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9335 LDKnativeUpdateAddHTLC *inner;
9337 * Indicates that this is the only struct which contains the same pointer.
9338 * Rust functions which take ownership of an object provided via an argument require
9339 * this to be true and invalidate the object pointed to by inner.
9345 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
9346 * This corresponds to std::vector in C++
9348 typedef struct LDKCVec_UpdateAddHTLCZ {
9350 * The elements in the array.
9351 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9353 struct LDKUpdateAddHTLC *data;
9355 * The number of elements pointed to by `data`.
9358 } LDKCVec_UpdateAddHTLCZ;
9363 * An update_fulfill_htlc message to be sent or received from a peer
9365 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
9367 * A pointer to the opaque Rust object.
9368 * Nearly everywhere, inner must be non-null, however in places where
9369 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9371 LDKnativeUpdateFulfillHTLC *inner;
9373 * Indicates that this is the only struct which contains the same pointer.
9374 * Rust functions which take ownership of an object provided via an argument require
9375 * this to be true and invalidate the object pointed to by inner.
9378 } LDKUpdateFulfillHTLC;
9381 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
9382 * This corresponds to std::vector in C++
9384 typedef struct LDKCVec_UpdateFulfillHTLCZ {
9386 * The elements in the array.
9387 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9389 struct LDKUpdateFulfillHTLC *data;
9391 * The number of elements pointed to by `data`.
9394 } LDKCVec_UpdateFulfillHTLCZ;
9399 * An update_fail_htlc message to be sent or received from a peer
9401 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
9403 * A pointer to the opaque Rust object.
9404 * Nearly everywhere, inner must be non-null, however in places where
9405 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9407 LDKnativeUpdateFailHTLC *inner;
9409 * Indicates that this is the only struct which contains the same pointer.
9410 * Rust functions which take ownership of an object provided via an argument require
9411 * this to be true and invalidate the object pointed to by inner.
9414 } LDKUpdateFailHTLC;
9417 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
9418 * This corresponds to std::vector in C++
9420 typedef struct LDKCVec_UpdateFailHTLCZ {
9422 * The elements in the array.
9423 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9425 struct LDKUpdateFailHTLC *data;
9427 * The number of elements pointed to by `data`.
9430 } LDKCVec_UpdateFailHTLCZ;
9435 * An update_fail_malformed_htlc message to be sent or received from a peer
9437 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
9439 * A pointer to the opaque Rust object.
9440 * Nearly everywhere, inner must be non-null, however in places where
9441 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9443 LDKnativeUpdateFailMalformedHTLC *inner;
9445 * Indicates that this is the only struct which contains the same pointer.
9446 * Rust functions which take ownership of an object provided via an argument require
9447 * this to be true and invalidate the object pointed to by inner.
9450 } LDKUpdateFailMalformedHTLC;
9453 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
9454 * This corresponds to std::vector in C++
9456 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
9458 * The elements in the array.
9459 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9461 struct LDKUpdateFailMalformedHTLC *data;
9463 * The number of elements pointed to by `data`.
9466 } LDKCVec_UpdateFailMalformedHTLCZ;
9469 * The contents of CResult_AcceptChannelDecodeErrorZ
9471 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
9473 * A pointer to the contents in the success state.
9474 * Reading from this pointer when `result_ok` is not set is undefined.
9476 struct LDKAcceptChannel *result;
9478 * A pointer to the contents in the error state.
9479 * Reading from this pointer when `result_ok` is set is undefined.
9481 struct LDKDecodeError *err;
9482 } LDKCResult_AcceptChannelDecodeErrorZPtr;
9485 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
9486 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
9487 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9489 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
9491 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
9492 * `err` or `result` depending on the state of `result_ok`.
9494 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
9496 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
9499 } LDKCResult_AcceptChannelDecodeErrorZ;
9502 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
9504 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
9506 * A pointer to the contents in the success state.
9507 * Reading from this pointer when `result_ok` is not set is undefined.
9509 struct LDKAnnouncementSignatures *result;
9511 * A pointer to the contents in the error state.
9512 * Reading from this pointer when `result_ok` is set is undefined.
9514 struct LDKDecodeError *err;
9515 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
9518 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
9519 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
9520 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9522 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
9524 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
9525 * `err` or `result` depending on the state of `result_ok`.
9527 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
9529 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
9532 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
9535 * The contents of CResult_ChannelReestablishDecodeErrorZ
9537 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
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 LDKChannelReestablish *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_ChannelReestablishDecodeErrorZPtr;
9551 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
9552 * containing a crate::lightning::ln::msgs::ChannelReestablish 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_ChannelReestablishDecodeErrorZ {
9557 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
9558 * `err` or `result` depending on the state of `result_ok`.
9560 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
9562 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
9565 } LDKCResult_ChannelReestablishDecodeErrorZ;
9568 * The contents of CResult_ClosingSignedDecodeErrorZ
9570 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
9572 * A pointer to the contents in the success state.
9573 * Reading from this pointer when `result_ok` is not set is undefined.
9575 struct LDKClosingSigned *result;
9577 * A pointer to the contents in the error state.
9578 * Reading from this pointer when `result_ok` is set is undefined.
9580 struct LDKDecodeError *err;
9581 } LDKCResult_ClosingSignedDecodeErrorZPtr;
9584 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
9585 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
9586 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9588 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
9590 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
9591 * `err` or `result` depending on the state of `result_ok`.
9593 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
9595 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
9598 } LDKCResult_ClosingSignedDecodeErrorZ;
9603 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
9604 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
9607 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
9609 * A pointer to the opaque Rust object.
9610 * Nearly everywhere, inner must be non-null, however in places where
9611 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9613 LDKnativeClosingSignedFeeRange *inner;
9615 * Indicates that this is the only struct which contains the same pointer.
9616 * Rust functions which take ownership of an object provided via an argument require
9617 * this to be true and invalidate the object pointed to by inner.
9620 } LDKClosingSignedFeeRange;
9623 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
9625 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
9627 * A pointer to the contents in the success state.
9628 * Reading from this pointer when `result_ok` is not set is undefined.
9630 struct LDKClosingSignedFeeRange *result;
9632 * A pointer to the contents in the error state.
9633 * Reading from this pointer when `result_ok` is set is undefined.
9635 struct LDKDecodeError *err;
9636 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
9639 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
9640 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
9641 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9643 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
9645 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
9646 * `err` or `result` depending on the state of `result_ok`.
9648 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
9650 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
9653 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
9658 * A commitment_signed message to be sent or received from a peer
9660 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
9662 * A pointer to the opaque Rust object.
9663 * Nearly everywhere, inner must be non-null, however in places where
9664 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9666 LDKnativeCommitmentSigned *inner;
9668 * Indicates that this is the only struct which contains the same pointer.
9669 * Rust functions which take ownership of an object provided via an argument require
9670 * this to be true and invalidate the object pointed to by inner.
9673 } LDKCommitmentSigned;
9676 * The contents of CResult_CommitmentSignedDecodeErrorZ
9678 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
9680 * A pointer to the contents in the success state.
9681 * Reading from this pointer when `result_ok` is not set is undefined.
9683 struct LDKCommitmentSigned *result;
9685 * A pointer to the contents in the error state.
9686 * Reading from this pointer when `result_ok` is set is undefined.
9688 struct LDKDecodeError *err;
9689 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
9692 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
9693 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
9694 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9696 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
9698 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
9699 * `err` or `result` depending on the state of `result_ok`.
9701 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
9703 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
9706 } LDKCResult_CommitmentSignedDecodeErrorZ;
9709 * The contents of CResult_FundingCreatedDecodeErrorZ
9711 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
9713 * A pointer to the contents in the success state.
9714 * Reading from this pointer when `result_ok` is not set is undefined.
9716 struct LDKFundingCreated *result;
9718 * A pointer to the contents in the error state.
9719 * Reading from this pointer when `result_ok` is set is undefined.
9721 struct LDKDecodeError *err;
9722 } LDKCResult_FundingCreatedDecodeErrorZPtr;
9725 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
9726 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
9727 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9729 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
9731 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
9732 * `err` or `result` depending on the state of `result_ok`.
9734 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
9736 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
9739 } LDKCResult_FundingCreatedDecodeErrorZ;
9742 * The contents of CResult_FundingSignedDecodeErrorZ
9744 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
9746 * A pointer to the contents in the success state.
9747 * Reading from this pointer when `result_ok` is not set is undefined.
9749 struct LDKFundingSigned *result;
9751 * A pointer to the contents in the error state.
9752 * Reading from this pointer when `result_ok` is set is undefined.
9754 struct LDKDecodeError *err;
9755 } LDKCResult_FundingSignedDecodeErrorZPtr;
9758 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
9759 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
9760 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9762 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
9764 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
9765 * `err` or `result` depending on the state of `result_ok`.
9767 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
9769 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
9772 } LDKCResult_FundingSignedDecodeErrorZ;
9775 * The contents of CResult_ChannelReadyDecodeErrorZ
9777 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
9779 * A pointer to the contents in the success state.
9780 * Reading from this pointer when `result_ok` is not set is undefined.
9782 struct LDKChannelReady *result;
9784 * A pointer to the contents in the error state.
9785 * Reading from this pointer when `result_ok` is set is undefined.
9787 struct LDKDecodeError *err;
9788 } LDKCResult_ChannelReadyDecodeErrorZPtr;
9791 * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
9792 * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
9793 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9795 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
9797 * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
9798 * `err` or `result` depending on the state of `result_ok`.
9800 union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
9802 * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
9805 } LDKCResult_ChannelReadyDecodeErrorZ;
9810 * An init message to be sent or received from a peer
9812 typedef struct MUST_USE_STRUCT LDKInit {
9814 * A pointer to the opaque Rust object.
9815 * Nearly everywhere, inner must be non-null, however in places where
9816 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9818 LDKnativeInit *inner;
9820 * Indicates that this is the only struct which contains the same pointer.
9821 * Rust functions which take ownership of an object provided via an argument require
9822 * this to be true and invalidate the object pointed to by inner.
9828 * The contents of CResult_InitDecodeErrorZ
9830 typedef union LDKCResult_InitDecodeErrorZPtr {
9832 * A pointer to the contents in the success state.
9833 * Reading from this pointer when `result_ok` is not set is undefined.
9835 struct LDKInit *result;
9837 * A pointer to the contents in the error state.
9838 * Reading from this pointer when `result_ok` is set is undefined.
9840 struct LDKDecodeError *err;
9841 } LDKCResult_InitDecodeErrorZPtr;
9844 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
9845 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
9846 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9848 typedef struct LDKCResult_InitDecodeErrorZ {
9850 * The contents of this CResult_InitDecodeErrorZ, accessible via either
9851 * `err` or `result` depending on the state of `result_ok`.
9853 union LDKCResult_InitDecodeErrorZPtr contents;
9855 * Whether this CResult_InitDecodeErrorZ represents a success state.
9858 } LDKCResult_InitDecodeErrorZ;
9861 * The contents of CResult_OpenChannelDecodeErrorZ
9863 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
9865 * A pointer to the contents in the success state.
9866 * Reading from this pointer when `result_ok` is not set is undefined.
9868 struct LDKOpenChannel *result;
9870 * A pointer to the contents in the error state.
9871 * Reading from this pointer when `result_ok` is set is undefined.
9873 struct LDKDecodeError *err;
9874 } LDKCResult_OpenChannelDecodeErrorZPtr;
9877 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
9878 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
9879 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9881 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
9883 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
9884 * `err` or `result` depending on the state of `result_ok`.
9886 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
9888 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
9891 } LDKCResult_OpenChannelDecodeErrorZ;
9894 * The contents of CResult_RevokeAndACKDecodeErrorZ
9896 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
9898 * A pointer to the contents in the success state.
9899 * Reading from this pointer when `result_ok` is not set is undefined.
9901 struct LDKRevokeAndACK *result;
9903 * A pointer to the contents in the error state.
9904 * Reading from this pointer when `result_ok` is set is undefined.
9906 struct LDKDecodeError *err;
9907 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
9910 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
9911 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
9912 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9914 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
9916 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
9917 * `err` or `result` depending on the state of `result_ok`.
9919 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
9921 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
9924 } LDKCResult_RevokeAndACKDecodeErrorZ;
9927 * The contents of CResult_ShutdownDecodeErrorZ
9929 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
9931 * A pointer to the contents in the success state.
9932 * Reading from this pointer when `result_ok` is not set is undefined.
9934 struct LDKShutdown *result;
9936 * A pointer to the contents in the error state.
9937 * Reading from this pointer when `result_ok` is set is undefined.
9939 struct LDKDecodeError *err;
9940 } LDKCResult_ShutdownDecodeErrorZPtr;
9943 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
9944 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
9945 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9947 typedef struct LDKCResult_ShutdownDecodeErrorZ {
9949 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
9950 * `err` or `result` depending on the state of `result_ok`.
9952 union LDKCResult_ShutdownDecodeErrorZPtr contents;
9954 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
9957 } LDKCResult_ShutdownDecodeErrorZ;
9960 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
9962 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
9964 * A pointer to the contents in the success state.
9965 * Reading from this pointer when `result_ok` is not set is undefined.
9967 struct LDKUpdateFailHTLC *result;
9969 * A pointer to the contents in the error state.
9970 * Reading from this pointer when `result_ok` is set is undefined.
9972 struct LDKDecodeError *err;
9973 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
9976 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
9977 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
9978 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9980 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
9982 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
9983 * `err` or `result` depending on the state of `result_ok`.
9985 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
9987 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
9990 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
9993 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
9995 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
9997 * A pointer to the contents in the success state.
9998 * Reading from this pointer when `result_ok` is not set is undefined.
10000 struct LDKUpdateFailMalformedHTLC *result;
10002 * A pointer to the contents in the error state.
10003 * Reading from this pointer when `result_ok` is set is undefined.
10005 struct LDKDecodeError *err;
10006 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
10009 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
10010 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
10011 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10013 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
10015 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
10016 * `err` or `result` depending on the state of `result_ok`.
10018 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
10020 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
10023 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
10028 * An update_fee message to be sent or received from a peer
10030 typedef struct MUST_USE_STRUCT LDKUpdateFee {
10032 * A pointer to the opaque Rust object.
10033 * Nearly everywhere, inner must be non-null, however in places where
10034 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10036 LDKnativeUpdateFee *inner;
10038 * Indicates that this is the only struct which contains the same pointer.
10039 * Rust functions which take ownership of an object provided via an argument require
10040 * this to be true and invalidate the object pointed to by inner.
10046 * The contents of CResult_UpdateFeeDecodeErrorZ
10048 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
10050 * A pointer to the contents in the success state.
10051 * Reading from this pointer when `result_ok` is not set is undefined.
10053 struct LDKUpdateFee *result;
10055 * A pointer to the contents in the error state.
10056 * Reading from this pointer when `result_ok` is set is undefined.
10058 struct LDKDecodeError *err;
10059 } LDKCResult_UpdateFeeDecodeErrorZPtr;
10062 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
10063 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
10064 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10066 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
10068 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
10069 * `err` or `result` depending on the state of `result_ok`.
10071 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
10073 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
10076 } LDKCResult_UpdateFeeDecodeErrorZ;
10079 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
10081 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
10083 * A pointer to the contents in the success state.
10084 * Reading from this pointer when `result_ok` is not set is undefined.
10086 struct LDKUpdateFulfillHTLC *result;
10088 * A pointer to the contents in the error state.
10089 * Reading from this pointer when `result_ok` is set is undefined.
10091 struct LDKDecodeError *err;
10092 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
10095 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
10096 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
10097 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10099 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
10101 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
10102 * `err` or `result` depending on the state of `result_ok`.
10104 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
10106 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
10109 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
10112 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
10114 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
10116 * A pointer to the contents in the success state.
10117 * Reading from this pointer when `result_ok` is not set is undefined.
10119 struct LDKUpdateAddHTLC *result;
10121 * A pointer to the contents in the error state.
10122 * Reading from this pointer when `result_ok` is set is undefined.
10124 struct LDKDecodeError *err;
10125 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
10128 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
10129 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
10130 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10132 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
10134 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
10135 * `err` or `result` depending on the state of `result_ok`.
10137 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
10139 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
10142 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
10147 * A ping message to be sent or received from a peer
10149 typedef struct MUST_USE_STRUCT LDKPing {
10151 * A pointer to the opaque Rust object.
10152 * Nearly everywhere, inner must be non-null, however in places where
10153 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10155 LDKnativePing *inner;
10157 * Indicates that this is the only struct which contains the same pointer.
10158 * Rust functions which take ownership of an object provided via an argument require
10159 * this to be true and invalidate the object pointed to by inner.
10165 * The contents of CResult_PingDecodeErrorZ
10167 typedef union LDKCResult_PingDecodeErrorZPtr {
10169 * A pointer to the contents in the success state.
10170 * Reading from this pointer when `result_ok` is not set is undefined.
10172 struct LDKPing *result;
10174 * A pointer to the contents in the error state.
10175 * Reading from this pointer when `result_ok` is set is undefined.
10177 struct LDKDecodeError *err;
10178 } LDKCResult_PingDecodeErrorZPtr;
10181 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
10182 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
10183 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10185 typedef struct LDKCResult_PingDecodeErrorZ {
10187 * The contents of this CResult_PingDecodeErrorZ, accessible via either
10188 * `err` or `result` depending on the state of `result_ok`.
10190 union LDKCResult_PingDecodeErrorZPtr contents;
10192 * Whether this CResult_PingDecodeErrorZ represents a success state.
10195 } LDKCResult_PingDecodeErrorZ;
10200 * A pong message to be sent or received from a peer
10202 typedef struct MUST_USE_STRUCT LDKPong {
10204 * A pointer to the opaque Rust object.
10205 * Nearly everywhere, inner must be non-null, however in places where
10206 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10208 LDKnativePong *inner;
10210 * Indicates that this is the only struct which contains the same pointer.
10211 * Rust functions which take ownership of an object provided via an argument require
10212 * this to be true and invalidate the object pointed to by inner.
10218 * The contents of CResult_PongDecodeErrorZ
10220 typedef union LDKCResult_PongDecodeErrorZPtr {
10222 * A pointer to the contents in the success state.
10223 * Reading from this pointer when `result_ok` is not set is undefined.
10225 struct LDKPong *result;
10227 * A pointer to the contents in the error state.
10228 * Reading from this pointer when `result_ok` is set is undefined.
10230 struct LDKDecodeError *err;
10231 } LDKCResult_PongDecodeErrorZPtr;
10234 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
10235 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
10236 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10238 typedef struct LDKCResult_PongDecodeErrorZ {
10240 * The contents of this CResult_PongDecodeErrorZ, accessible via either
10241 * `err` or `result` depending on the state of `result_ok`.
10243 union LDKCResult_PongDecodeErrorZPtr contents;
10245 * Whether this CResult_PongDecodeErrorZ represents a success state.
10248 } LDKCResult_PongDecodeErrorZ;
10251 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
10253 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
10255 * A pointer to the contents in the success state.
10256 * Reading from this pointer when `result_ok` is not set is undefined.
10258 struct LDKUnsignedChannelAnnouncement *result;
10260 * A pointer to the contents in the error state.
10261 * Reading from this pointer when `result_ok` is set is undefined.
10263 struct LDKDecodeError *err;
10264 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
10267 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
10268 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10269 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10271 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
10273 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
10274 * `err` or `result` depending on the state of `result_ok`.
10276 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
10278 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
10281 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
10284 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
10286 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
10288 * A pointer to the contents in the success state.
10289 * Reading from this pointer when `result_ok` is not set is undefined.
10291 struct LDKChannelAnnouncement *result;
10293 * A pointer to the contents in the error state.
10294 * Reading from this pointer when `result_ok` is set is undefined.
10296 struct LDKDecodeError *err;
10297 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
10300 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
10301 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10302 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10304 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
10306 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
10307 * `err` or `result` depending on the state of `result_ok`.
10309 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
10311 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
10314 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
10319 * The unsigned part of a channel_update
10321 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
10323 * A pointer to the opaque Rust object.
10324 * Nearly everywhere, inner must be non-null, however in places where
10325 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10327 LDKnativeUnsignedChannelUpdate *inner;
10329 * Indicates that this is the only struct which contains the same pointer.
10330 * Rust functions which take ownership of an object provided via an argument require
10331 * this to be true and invalidate the object pointed to by inner.
10334 } LDKUnsignedChannelUpdate;
10337 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
10339 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
10341 * A pointer to the contents in the success state.
10342 * Reading from this pointer when `result_ok` is not set is undefined.
10344 struct LDKUnsignedChannelUpdate *result;
10346 * A pointer to the contents in the error state.
10347 * Reading from this pointer when `result_ok` is set is undefined.
10349 struct LDKDecodeError *err;
10350 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
10353 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
10354 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
10355 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10357 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
10359 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
10360 * `err` or `result` depending on the state of `result_ok`.
10362 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
10364 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
10367 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
10370 * The contents of CResult_ChannelUpdateDecodeErrorZ
10372 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
10374 * A pointer to the contents in the success state.
10375 * Reading from this pointer when `result_ok` is not set is undefined.
10377 struct LDKChannelUpdate *result;
10379 * A pointer to the contents in the error state.
10380 * Reading from this pointer when `result_ok` is set is undefined.
10382 struct LDKDecodeError *err;
10383 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
10386 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
10387 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
10388 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10390 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
10392 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
10393 * `err` or `result` depending on the state of `result_ok`.
10395 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
10397 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
10400 } LDKCResult_ChannelUpdateDecodeErrorZ;
10403 * The contents of CResult_ErrorMessageDecodeErrorZ
10405 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
10407 * A pointer to the contents in the success state.
10408 * Reading from this pointer when `result_ok` is not set is undefined.
10410 struct LDKErrorMessage *result;
10412 * A pointer to the contents in the error state.
10413 * Reading from this pointer when `result_ok` is set is undefined.
10415 struct LDKDecodeError *err;
10416 } LDKCResult_ErrorMessageDecodeErrorZPtr;
10419 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
10420 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
10421 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10423 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
10425 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
10426 * `err` or `result` depending on the state of `result_ok`.
10428 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
10430 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
10433 } LDKCResult_ErrorMessageDecodeErrorZ;
10436 * The contents of CResult_WarningMessageDecodeErrorZ
10438 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
10440 * A pointer to the contents in the success state.
10441 * Reading from this pointer when `result_ok` is not set is undefined.
10443 struct LDKWarningMessage *result;
10445 * A pointer to the contents in the error state.
10446 * Reading from this pointer when `result_ok` is set is undefined.
10448 struct LDKDecodeError *err;
10449 } LDKCResult_WarningMessageDecodeErrorZPtr;
10452 * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
10453 * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
10454 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10456 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
10458 * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
10459 * `err` or `result` depending on the state of `result_ok`.
10461 union LDKCResult_WarningMessageDecodeErrorZPtr contents;
10463 * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
10466 } LDKCResult_WarningMessageDecodeErrorZ;
10471 * The unsigned part of a node_announcement
10473 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
10475 * A pointer to the opaque Rust object.
10476 * Nearly everywhere, inner must be non-null, however in places where
10477 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10479 LDKnativeUnsignedNodeAnnouncement *inner;
10481 * Indicates that this is the only struct which contains the same pointer.
10482 * Rust functions which take ownership of an object provided via an argument require
10483 * this to be true and invalidate the object pointed to by inner.
10486 } LDKUnsignedNodeAnnouncement;
10489 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
10491 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
10493 * A pointer to the contents in the success state.
10494 * Reading from this pointer when `result_ok` is not set is undefined.
10496 struct LDKUnsignedNodeAnnouncement *result;
10498 * A pointer to the contents in the error state.
10499 * Reading from this pointer when `result_ok` is set is undefined.
10501 struct LDKDecodeError *err;
10502 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
10505 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
10506 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10507 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10509 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
10511 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
10512 * `err` or `result` depending on the state of `result_ok`.
10514 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
10516 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
10519 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
10522 * The contents of CResult_NodeAnnouncementDecodeErrorZ
10524 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
10526 * A pointer to the contents in the success state.
10527 * Reading from this pointer when `result_ok` is not set is undefined.
10529 struct LDKNodeAnnouncement *result;
10531 * A pointer to the contents in the error state.
10532 * Reading from this pointer when `result_ok` is set is undefined.
10534 struct LDKDecodeError *err;
10535 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
10538 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
10539 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10540 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10542 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
10544 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
10545 * `err` or `result` depending on the state of `result_ok`.
10547 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
10549 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
10552 } LDKCResult_NodeAnnouncementDecodeErrorZ;
10555 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
10557 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
10559 * A pointer to the contents in the success state.
10560 * Reading from this pointer when `result_ok` is not set is undefined.
10562 struct LDKQueryShortChannelIds *result;
10564 * A pointer to the contents in the error state.
10565 * Reading from this pointer when `result_ok` is set is undefined.
10567 struct LDKDecodeError *err;
10568 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
10571 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
10572 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
10573 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10575 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
10577 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
10578 * `err` or `result` depending on the state of `result_ok`.
10580 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
10582 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
10585 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
10590 * A reply_short_channel_ids_end message is sent as a reply to a
10591 * query_short_channel_ids message. The query recipient makes a best
10592 * effort to respond based on their local network view which may not be
10593 * a perfect view of the network.
10595 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
10597 * A pointer to the opaque Rust object.
10598 * Nearly everywhere, inner must be non-null, however in places where
10599 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10601 LDKnativeReplyShortChannelIdsEnd *inner;
10603 * Indicates that this is the only struct which contains the same pointer.
10604 * Rust functions which take ownership of an object provided via an argument require
10605 * this to be true and invalidate the object pointed to by inner.
10608 } LDKReplyShortChannelIdsEnd;
10611 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
10613 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
10615 * A pointer to the contents in the success state.
10616 * Reading from this pointer when `result_ok` is not set is undefined.
10618 struct LDKReplyShortChannelIdsEnd *result;
10620 * A pointer to the contents in the error state.
10621 * Reading from this pointer when `result_ok` is set is undefined.
10623 struct LDKDecodeError *err;
10624 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
10627 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
10628 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
10629 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10631 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
10633 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
10634 * `err` or `result` depending on the state of `result_ok`.
10636 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
10638 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
10641 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
10644 * The contents of CResult_QueryChannelRangeDecodeErrorZ
10646 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
10648 * A pointer to the contents in the success state.
10649 * Reading from this pointer when `result_ok` is not set is undefined.
10651 struct LDKQueryChannelRange *result;
10653 * A pointer to the contents in the error state.
10654 * Reading from this pointer when `result_ok` is set is undefined.
10656 struct LDKDecodeError *err;
10657 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
10660 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
10661 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
10662 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10664 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
10666 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
10667 * `err` or `result` depending on the state of `result_ok`.
10669 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
10671 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
10674 } LDKCResult_QueryChannelRangeDecodeErrorZ;
10677 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
10679 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
10681 * A pointer to the contents in the success state.
10682 * Reading from this pointer when `result_ok` is not set is undefined.
10684 struct LDKReplyChannelRange *result;
10686 * A pointer to the contents in the error state.
10687 * Reading from this pointer when `result_ok` is set is undefined.
10689 struct LDKDecodeError *err;
10690 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
10693 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
10694 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
10695 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10697 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
10699 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
10700 * `err` or `result` depending on the state of `result_ok`.
10702 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
10704 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
10707 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
10710 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
10712 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
10714 * A pointer to the contents in the success state.
10715 * Reading from this pointer when `result_ok` is not set is undefined.
10717 struct LDKGossipTimestampFilter *result;
10719 * A pointer to the contents in the error state.
10720 * Reading from this pointer when `result_ok` is set is undefined.
10722 struct LDKDecodeError *err;
10723 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
10726 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
10727 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
10728 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10730 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
10732 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
10733 * `err` or `result` depending on the state of `result_ok`.
10735 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
10737 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
10740 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
10743 * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
10744 * This corresponds to std::vector in C++
10746 typedef struct LDKCVec_PhantomRouteHintsZ {
10748 * The elements in the array.
10749 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10751 struct LDKPhantomRouteHints *data;
10753 * The number of elements pointed to by `data`.
10756 } LDKCVec_PhantomRouteHintsZ;
10759 * When signing using a fallible method either an user-supplied `SignError` or a `CreationError`
10762 typedef enum LDKSignOrCreationError_Tag {
10764 * An error occurred during signing
10766 LDKSignOrCreationError_SignError,
10768 * An error occurred while building the transaction
10770 LDKSignOrCreationError_CreationError,
10772 * Must be last for serialization purposes
10774 LDKSignOrCreationError_Sentinel,
10775 } LDKSignOrCreationError_Tag;
10777 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
10778 LDKSignOrCreationError_Tag tag;
10781 enum LDKCreationError creation_error;
10784 } LDKSignOrCreationError;
10787 * The contents of CResult_InvoiceSignOrCreationErrorZ
10789 typedef union LDKCResult_InvoiceSignOrCreationErrorZPtr {
10791 * A pointer to the contents in the success state.
10792 * Reading from this pointer when `result_ok` is not set is undefined.
10794 struct LDKInvoice *result;
10796 * A pointer to the contents in the error state.
10797 * Reading from this pointer when `result_ok` is set is undefined.
10799 struct LDKSignOrCreationError *err;
10800 } LDKCResult_InvoiceSignOrCreationErrorZPtr;
10803 * A CResult_InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
10804 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
10805 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10807 typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
10809 * The contents of this CResult_InvoiceSignOrCreationErrorZ, accessible via either
10810 * `err` or `result` depending on the state of `result_ok`.
10812 union LDKCResult_InvoiceSignOrCreationErrorZPtr contents;
10814 * Whether this CResult_InvoiceSignOrCreationErrorZ represents a success state.
10817 } LDKCResult_InvoiceSignOrCreationErrorZ;
10822 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
10824 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
10825 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
10826 * the return value of [`Filter::register_output`].
10828 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
10829 * may have been spent there. See [`Filter::register_output`] for details.
10831 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
10832 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
10834 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
10836 * A pointer to the opaque Rust object.
10837 * Nearly everywhere, inner must be non-null, however in places where
10838 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10840 LDKnativeWatchedOutput *inner;
10842 * Indicates that this is the only struct which contains the same pointer.
10843 * Rust functions which take ownership of an object provided via an argument require
10844 * this to be true and invalidate the object pointed to by inner.
10847 } LDKWatchedOutput;
10850 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
10853 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
10854 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
10855 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
10856 * receiving full blocks from a chain source, any further filtering is unnecessary.
10858 * After an output has been registered, subsequent block retrievals from the chain source must not
10859 * exclude any transactions matching the new criteria nor any in-block descendants of such
10862 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
10863 * should not block on I/O. Implementations should instead queue the newly monitored data to be
10864 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
10865 * invocation that has called the `Filter` must return [`TemporaryFailure`].
10867 * [`TemporaryFailure`]: ChannelMonitorUpdateErr::TemporaryFailure
10868 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
10869 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
10871 typedef struct LDKFilter {
10873 * An opaque pointer which is passed to your function implementations as an argument.
10874 * This has no meaning in the LDK, and can be NULL or any other value.
10878 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
10879 * a spending condition.
10881 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
10883 * Registers interest in spends of a transaction output.
10885 * Optionally, when `output.block_hash` is set, should return any transaction spending the
10886 * output that is found in the corresponding block along with its index.
10888 * This return value is useful for Electrum clients in order to supply in-block descendant
10889 * transactions which otherwise were not included. This is not necessary for other clients if
10890 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
10893 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
10895 * Frees any resources associated with this object given its this_arg pointer.
10896 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10898 void (*free)(void *this_arg);
10902 * An enum which can either contain a crate::lightning::chain::Filter or not
10904 typedef enum LDKCOption_FilterZ_Tag {
10906 * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
10908 LDKCOption_FilterZ_Some,
10910 * When we're in this state, this COption_FilterZ contains nothing
10912 LDKCOption_FilterZ_None,
10914 * Must be last for serialization purposes
10916 LDKCOption_FilterZ_Sentinel,
10917 } LDKCOption_FilterZ_Tag;
10919 typedef struct LDKCOption_FilterZ {
10920 LDKCOption_FilterZ_Tag tag;
10923 struct LDKFilter some;
10926 } LDKCOption_FilterZ;
10931 * A read-only reference to a current ChannelMonitor.
10933 * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
10936 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
10938 * A pointer to the opaque Rust object.
10939 * Nearly everywhere, inner must be non-null, however in places where
10940 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10942 LDKnativeLockedChannelMonitor *inner;
10944 * Indicates that this is the only struct which contains the same pointer.
10945 * Rust functions which take ownership of an object provided via an argument require
10946 * this to be true and invalidate the object pointed to by inner.
10949 } LDKLockedChannelMonitor;
10952 * The contents of CResult_LockedChannelMonitorNoneZ
10954 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
10956 * A pointer to the contents in the success state.
10957 * Reading from this pointer when `result_ok` is not set is undefined.
10959 struct LDKLockedChannelMonitor *result;
10961 * Note that this value is always NULL, as there are no contents in the Err variant
10964 } LDKCResult_LockedChannelMonitorNoneZPtr;
10967 * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
10968 * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
10969 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10971 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
10973 * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
10974 * `err` or `result` depending on the state of `result_ok`.
10976 union LDKCResult_LockedChannelMonitorNoneZPtr contents;
10978 * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
10981 } LDKCResult_LockedChannelMonitorNoneZ;
10984 * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
10985 * This corresponds to std::vector in C++
10987 typedef struct LDKCVec_OutPointZ {
10989 * The elements in the array.
10990 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10992 struct LDKOutPoint *data;
10994 * The number of elements pointed to by `data`.
10997 } LDKCVec_OutPointZ;
11000 * A trait indicating an object may generate message send events
11002 typedef struct LDKMessageSendEventsProvider {
11004 * An opaque pointer which is passed to your function implementations as an argument.
11005 * This has no meaning in the LDK, and can be NULL or any other value.
11009 * Gets the list of pending events which were generated by previous actions, clearing the list
11012 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
11014 * Frees any resources associated with this object given its this_arg pointer.
11015 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11017 void (*free)(void *this_arg);
11018 } LDKMessageSendEventsProvider;
11021 * A trait implemented for objects handling events from [`EventsProvider`].
11023 typedef struct LDKEventHandler {
11025 * An opaque pointer which is passed to your function implementations as an argument.
11026 * This has no meaning in the LDK, and can be NULL or any other value.
11030 * Handles the given [`Event`].
11032 * See [`EventsProvider`] for details that must be considered when implementing this method.
11034 void (*handle_event)(const void *this_arg, const struct LDKEvent *NONNULL_PTR event);
11036 * Frees any resources associated with this object given its this_arg pointer.
11037 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11039 void (*free)(void *this_arg);
11043 * A trait indicating an object may generate events.
11045 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
11049 * See [`process_pending_events`] for requirements around event processing.
11051 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
11052 * event since the last invocation. The handler must either act upon the event immediately
11053 * or preserve it for later handling.
11055 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
11056 * consult the provider's documentation on the implication of processing events and how a handler
11057 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
11058 * [`ChainMonitor::process_pending_events`]).
11060 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
11063 * [`process_pending_events`]: Self::process_pending_events
11064 * [`handle_event`]: EventHandler::handle_event
11065 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
11066 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
11068 typedef struct LDKEventsProvider {
11070 * An opaque pointer which is passed to your function implementations as an argument.
11071 * This has no meaning in the LDK, and can be NULL or any other value.
11075 * Processes any events generated since the last call using the given event handler.
11077 * Subsequent calls must only process new events. However, handlers must be capable of handling
11078 * duplicate events across process restarts. This may occur if the provider was recovered from
11079 * an old state (i.e., it hadn't been successfully persisted after processing pending events).
11081 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
11083 * Frees any resources associated with this object given its this_arg pointer.
11084 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11086 void (*free)(void *this_arg);
11087 } LDKEventsProvider;
11092 * Lightning TLV uses a custom variable-length integer called BigSize. It is similar to Bitcoin's
11093 * variable-length integers except that it is serialized in big-endian instead of little-endian.
11095 * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
11096 * encoded in several different ways, which we must check for at deserialization-time. Thus, if
11097 * you're looking for an example of a variable-length integer to use for your own project, move
11098 * along, this is a rather poor design.
11100 typedef struct MUST_USE_STRUCT LDKBigSize {
11102 * A pointer to the opaque Rust object.
11103 * Nearly everywhere, inner must be non-null, however in places where
11104 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11106 LDKnativeBigSize *inner;
11108 * Indicates that this is the only struct which contains the same pointer.
11109 * Rust functions which take ownership of an object provided via an argument require
11110 * this to be true and invalidate the object pointed to by inner.
11116 * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
11118 typedef struct LDKPersister {
11120 * An opaque pointer which is passed to your function implementations as an argument.
11121 * This has no meaning in the LDK, and can be NULL or any other value.
11125 * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
11127 struct LDKCResult_NoneErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
11129 * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
11131 struct LDKCResult_NoneErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
11133 * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
11135 struct LDKCResult_NoneErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
11137 * Frees any resources associated with this object given its this_arg pointer.
11138 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11140 void (*free)(void *this_arg);
11146 * Configuration we set when applicable.
11148 * Default::default() provides sane defaults.
11150 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
11152 * A pointer to the opaque Rust object.
11153 * Nearly everywhere, inner must be non-null, however in places where
11154 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11156 LDKnativeChannelHandshakeConfig *inner;
11158 * Indicates that this is the only struct which contains the same pointer.
11159 * Rust functions which take ownership of an object provided via an argument require
11160 * this to be true and invalidate the object pointed to by inner.
11163 } LDKChannelHandshakeConfig;
11168 * Optional channel limits which are applied during channel creation.
11170 * These limits are only applied to our counterparty's limits, not our own.
11172 * Use 0/<type>::max_value() as appropriate to skip checking.
11174 * Provides sane defaults for most configurations.
11176 * Most additional limits are disabled except those with which specify a default in individual
11177 * field documentation. Note that this may result in barely-usable channels, but since they
11178 * are applied mostly only to incoming channels that's not much of a problem.
11180 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
11182 * A pointer to the opaque Rust object.
11183 * Nearly everywhere, inner must be non-null, however in places where
11184 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11186 LDKnativeChannelHandshakeLimits *inner;
11188 * Indicates that this is the only struct which contains the same pointer.
11189 * Rust functions which take ownership of an object provided via an argument require
11190 * this to be true and invalidate the object pointed to by inner.
11193 } LDKChannelHandshakeLimits;
11198 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
11200 * Default::default() provides sane defaults for most configurations
11201 * (but currently with 0 relay fees!)
11203 typedef struct MUST_USE_STRUCT LDKUserConfig {
11205 * A pointer to the opaque Rust object.
11206 * Nearly everywhere, inner must be non-null, however in places where
11207 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11209 LDKnativeUserConfig *inner;
11211 * Indicates that this is the only struct which contains the same pointer.
11212 * Rust functions which take ownership of an object provided via an argument require
11213 * this to be true and invalidate the object pointed to by inner.
11221 * The best known block as identified by its hash and height.
11223 typedef struct MUST_USE_STRUCT LDKBestBlock {
11225 * A pointer to the opaque Rust object.
11226 * Nearly everywhere, inner must be non-null, however in places where
11227 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11229 LDKnativeBestBlock *inner;
11231 * Indicates that this is the only struct which contains the same pointer.
11232 * Rust functions which take ownership of an object provided via an argument require
11233 * this to be true and invalidate the object pointed to by inner.
11239 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
11242 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
11243 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
11244 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
11247 * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
11248 * entire header chain and only blocks with matching transaction data using BIP 157 filters or
11249 * other similar filtering.
11251 typedef struct LDKListen {
11253 * An opaque pointer which is passed to your function implementations as an argument.
11254 * This has no meaning in the LDK, and can be NULL or any other value.
11258 * Notifies the listener that a block was added at the given height, with the transaction data
11259 * possibly filtered.
11261 void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
11263 * Notifies the listener that a block was added at the given height.
11265 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
11267 * Notifies the listener that a block was removed at the given height.
11269 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
11271 * Frees any resources associated with this object given its this_arg pointer.
11272 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11274 void (*free)(void *this_arg);
11278 * The `Confirm` trait is used to notify when transactions have been confirmed on chain or
11279 * unconfirmed during a chain reorganization.
11281 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
11282 * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity
11283 * related to registered transactions and outputs. Upon notification, it would pass along the
11284 * matching transactions using this interface.
11288 * The intended use is as follows:
11289 * - Call [`transactions_confirmed`] to process any on-chain activity of interest.
11290 * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`]
11291 * that has been reorganized out of the chain.
11292 * - Call [`best_block_updated`] whenever a new chain tip becomes available.
11296 * Clients must call these methods in chain order. Specifically:
11297 * - Transactions confirmed in a block must be given before transactions confirmed in a later
11299 * - Dependent transactions within the same block must be given in topological order, possibly in
11301 * - Unconfirmed transactions must be given after the original confirmations and before any
11304 * See individual method documentation for further details.
11306 * [`transactions_confirmed`]: Self::transactions_confirmed
11307 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
11308 * [`best_block_updated`]: Self::best_block_updated
11309 * [`get_relevant_txids`]: Self::get_relevant_txids
11311 typedef struct LDKConfirm {
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 transactions confirmed in a block with a given header and height.
11320 * Should be called for any transactions registered by [`Filter::register_tx`] or any
11321 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
11322 * appearing in the same block do not need to be included in the same call; instead, multiple
11323 * calls with additional transactions may be made so long as they are made in [chain order].
11325 * May be called before or after [`best_block_updated`] for the corresponding block. However,
11326 * in the event of a chain reorganization, it must not be called with a `header` that is no
11327 * longer in the chain as of the last call to [`best_block_updated`].
11329 * [chain order]: Confirm#Order
11330 * [`best_block_updated`]: Self::best_block_updated
11332 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
11334 * Processes a transaction that is no longer confirmed as result of a chain reorganization.
11336 * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
11337 * reorganized out of the best chain. Once called, the given transaction should not be returned
11338 * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`].
11340 * [`get_relevant_txids`]: Self::get_relevant_txids
11341 * [`transactions_confirmed`]: Self::transactions_confirmed
11343 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
11345 * Processes an update to the best header connected at the given height.
11347 * Should be called when a new header is available but may be skipped for intermediary blocks
11348 * if they become available at the same time.
11350 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
11352 * Returns transactions that should be monitored for reorganization out of the chain.
11354 * Should include any transactions passed to [`transactions_confirmed`] that have insufficient
11355 * confirmations to be safe from a chain reorganization. Should not include any transactions
11356 * passed to [`transaction_unconfirmed`] unless later reconfirmed.
11358 * May be called to determine the subset of transactions that must still be monitored for
11359 * reorganization. Will be idempotent between calls but may change as a result of calls to the
11360 * other interface methods. Thus, this is useful to determine which transactions may need to be
11361 * given to [`transaction_unconfirmed`].
11363 * [`transactions_confirmed`]: Self::transactions_confirmed
11364 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
11366 struct LDKCVec_TxidZ (*get_relevant_txids)(const void *this_arg);
11368 * Frees any resources associated with this object given its this_arg pointer.
11369 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11371 void (*free)(void *this_arg);
11377 * An opaque identifier describing a specific [`Persist`] method call.
11379 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
11381 * A pointer to the opaque Rust object.
11382 * Nearly everywhere, inner must be non-null, however in places where
11383 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11385 LDKnativeMonitorUpdateId *inner;
11387 * Indicates that this is the only struct which contains the same pointer.
11388 * Rust functions which take ownership of an object provided via an argument require
11389 * this to be true and invalidate the object pointed to by inner.
11392 } LDKMonitorUpdateId;
11395 * `Persist` defines behavior for persisting channel monitors: this could mean
11396 * writing once to disk, and/or uploading to one or more backup services.
11398 * Each method can return three possible values:
11399 * * If persistence (including any relevant `fsync()` calls) happens immediately, the
11400 * implementation should return `Ok(())`, indicating normal channel operation should continue.
11401 * * If persistence happens asynchronously, implementations should first ensure the
11402 * [`ChannelMonitor`] or [`ChannelMonitorUpdate`] are written durably to disk, and then return
11403 * `Err(ChannelMonitorUpdateErr::TemporaryFailure)` while the update continues in the
11404 * background. Once the update completes, [`ChainMonitor::channel_monitor_updated`] should be
11405 * called with the corresponding [`MonitorUpdateId`].
11407 * Note that unlike the direct [`chain::Watch`] interface,
11408 * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
11410 * * If persistence fails for some reason, implementations should return
11411 * `Err(ChannelMonitorUpdateErr::PermanentFailure)`, in which case the channel will likely be
11412 * closed without broadcasting the latest state. See
11413 * [`ChannelMonitorUpdateErr::PermanentFailure`] for more details.
11415 typedef struct LDKPersist {
11417 * An opaque pointer which is passed to your function implementations as an argument.
11418 * This has no meaning in the LDK, and can be NULL or any other value.
11422 * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
11423 * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
11425 * The data can be stored any way you want, but the identifier provided by LDK is the
11426 * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
11427 * and the stored channel data). Note that you **must** persist every new monitor to disk.
11429 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
11430 * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
11432 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
11433 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
11435 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11436 * [`Writeable::write`]: crate::util::ser::Writeable::write
11438 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
11440 * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
11443 * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
11444 * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
11447 * During blockchain synchronization operations, this may be called with no
11448 * [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
11449 * Note that after the full [`ChannelMonitor`] is persisted any previous
11450 * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
11451 * applied to the persisted [`ChannelMonitor`] as they were already applied.
11453 * If an implementer chooses to persist the updates only, they need to make
11454 * sure that all the updates are applied to the `ChannelMonitors` *before*
11455 * the set of channel monitors is given to the `ChannelManager`
11456 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
11457 * applying a monitor update to a monitor. If full `ChannelMonitors` are
11458 * persisted, then there is no need to persist individual updates.
11460 * Note that there could be a performance tradeoff between persisting complete
11461 * channel monitors on every update vs. persisting only updates and applying
11462 * them in batches. The size of each monitor grows `O(number of state updates)`
11463 * whereas updates are small and `O(1)`.
11465 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
11466 * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
11468 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
11469 * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
11470 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
11472 * [`Writeable::write`]: crate::util::ser::Writeable::write
11474 * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
11476 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);
11478 * Frees any resources associated with this object given its this_arg pointer.
11479 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11481 void (*free)(void *this_arg);
11487 * An implementation of [`chain::Watch`] for monitoring channels.
11489 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
11490 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
11491 * or used independently to monitor channels remotely. See the [module-level documentation] for
11494 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11495 * [module-level documentation]: crate::chain::chainmonitor
11497 typedef struct MUST_USE_STRUCT LDKChainMonitor {
11499 * A pointer to the opaque Rust object.
11500 * Nearly everywhere, inner must be non-null, however in places where
11501 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11503 LDKnativeChainMonitor *inner;
11505 * Indicates that this is the only struct which contains the same pointer.
11506 * Rust functions which take ownership of an object provided via an argument require
11507 * this to be true and invalidate the object pointed to by inner.
11515 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
11516 * and derives keys from that.
11518 * Your node_id is seed/0'
11519 * ChannelMonitor closes may use seed/1'
11520 * Cooperative closes may use seed/2'
11521 * The two close keys may be needed to claim on-chain funds!
11523 * This struct cannot be used for nodes that wish to support receiving phantom payments;
11524 * [`PhantomKeysManager`] must be used instead.
11526 * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
11527 * previously issued invoices and attempts to pay previous invoices will fail.
11529 typedef struct MUST_USE_STRUCT LDKKeysManager {
11531 * A pointer to the opaque Rust object.
11532 * Nearly everywhere, inner must be non-null, however in places where
11533 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11535 LDKnativeKeysManager *inner;
11537 * Indicates that this is the only struct which contains the same pointer.
11538 * Rust functions which take ownership of an object provided via an argument require
11539 * this to be true and invalidate the object pointed to by inner.
11547 * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
11550 * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
11551 * paid to one of multiple nodes. This works because we encode the invoice route hints such that
11552 * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
11553 * itself without ever needing to forward to this fake node.
11555 * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
11556 * provide some fault tolerance, because payers will automatically retry paying other provided
11557 * nodes in the case that one node goes down.
11559 * Note that multi-path payments are not supported in phantom invoices for security reasons.
11560 * Switching between this struct and [`KeysManager`] will invalidate any previously issued
11561 * invoices and attempts to pay previous invoices will fail.
11563 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
11565 * A pointer to the opaque Rust object.
11566 * Nearly everywhere, inner must be non-null, however in places where
11567 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11569 LDKnativePhantomKeysManager *inner;
11571 * Indicates that this is the only struct which contains the same pointer.
11572 * Rust functions which take ownership of an object provided via an argument require
11573 * this to be true and invalidate the object pointed to by inner.
11576 } LDKPhantomKeysManager;
11581 * Chain-related parameters used to construct a new `ChannelManager`.
11583 * Typically, the block-specific parameters are derived from the best block hash for the network,
11584 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
11585 * are not needed when deserializing a previously constructed `ChannelManager`.
11587 typedef struct MUST_USE_STRUCT LDKChainParameters {
11589 * A pointer to the opaque Rust object.
11590 * Nearly everywhere, inner must be non-null, however in places where
11591 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11593 LDKnativeChainParameters *inner;
11595 * Indicates that this is the only struct which contains the same pointer.
11596 * Rust functions which take ownership of an object provided via an argument require
11597 * this to be true and invalidate the object pointed to by inner.
11600 } LDKChainParameters;
11603 * A 3-byte byte array.
11605 typedef struct LDKThreeBytes {
11613 * A trait to describe an object which can receive channel messages.
11615 * Messages MAY be called in parallel when they originate from different their_node_ids, however
11616 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
11618 typedef struct LDKChannelMessageHandler {
11620 * An opaque pointer which is passed to your function implementations as an argument.
11621 * This has no meaning in the LDK, and can be NULL or any other value.
11625 * Handle an incoming open_channel message from the given peer.
11627 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
11629 * Handle an incoming accept_channel message from the given peer.
11631 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
11633 * Handle an incoming funding_created message from the given peer.
11635 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
11637 * Handle an incoming funding_signed message from the given peer.
11639 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
11641 * Handle an incoming channel_ready message from the given peer.
11643 void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
11645 * Handle an incoming shutdown message from the given peer.
11647 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);
11649 * Handle an incoming closing_signed message from the given peer.
11651 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
11653 * Handle an incoming update_add_htlc message from the given peer.
11655 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
11657 * Handle an incoming update_fulfill_htlc message from the given peer.
11659 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
11661 * Handle an incoming update_fail_htlc message from the given peer.
11663 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
11665 * Handle an incoming update_fail_malformed_htlc message from the given peer.
11667 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
11669 * Handle an incoming commitment_signed message from the given peer.
11671 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
11673 * Handle an incoming revoke_and_ack message from the given peer.
11675 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
11677 * Handle an incoming update_fee message from the given peer.
11679 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
11681 * Handle an incoming announcement_signatures message from the given peer.
11683 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
11685 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
11686 * is believed to be possible in the future (eg they're sending us messages we don't
11687 * understand or indicate they require unknown feature bits), no_connection_possible is set
11688 * and any outstanding channels should be failed.
11690 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
11692 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
11694 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
11696 * Handle an incoming channel_reestablish message from the given peer.
11698 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
11700 * Handle an incoming channel update from the given peer.
11702 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
11704 * Handle an incoming error message from the given peer.
11706 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
11708 * Implementation of MessageSendEventsProvider for this object.
11710 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
11712 * Frees any resources associated with this object given its this_arg pointer.
11713 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11715 void (*free)(void *this_arg);
11716 } LDKChannelMessageHandler;
11721 * Arguments for the creation of a ChannelManager that are not deserialized.
11723 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
11725 * 1) Deserialize all stored [`ChannelMonitor`]s.
11726 * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
11727 * `<(BlockHash, ChannelManager)>::read(reader, args)`
11728 * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
11729 * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
11730 * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
11731 * same way you would handle a [`chain::Filter`] call using
11732 * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
11733 * 4) Reconnect blocks on your [`ChannelMonitor`]s.
11734 * 5) Disconnect/connect blocks on the [`ChannelManager`].
11735 * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
11736 * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
11737 * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
11739 * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
11740 * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
11742 * Note that the ordering of #4-7 is not of importance, however all four must occur before you
11743 * call any other methods on the newly-deserialized [`ChannelManager`].
11745 * Note that because some channels may be closed during deserialization, it is critical that you
11746 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
11747 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
11748 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
11749 * not force-close the same channels but consider them live), you may end up revoking a state for
11750 * which you've already broadcasted the transaction.
11752 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
11754 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
11756 * A pointer to the opaque Rust object.
11757 * Nearly everywhere, inner must be non-null, however in places where
11758 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11760 LDKnativeChannelManagerReadArgs *inner;
11762 * Indicates that this is the only struct which contains the same pointer.
11763 * Rust functions which take ownership of an object provided via an argument require
11764 * this to be true and invalidate the object pointed to by inner.
11767 } LDKChannelManagerReadArgs;
11772 * A set of keys that were HKDF-expanded from an initial call to
11773 * [`KeysInterface::get_inbound_payment_key_material`].
11775 * [`KeysInterface::get_inbound_payment_key_material`]: crate::chain::keysinterface::KeysInterface::get_inbound_payment_key_material
11777 typedef struct MUST_USE_STRUCT LDKExpandedKey {
11779 * A pointer to the opaque Rust object.
11780 * Nearly everywhere, inner must be non-null, however in places where
11781 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11783 LDKnativeExpandedKey *inner;
11785 * Indicates that this is the only struct which contains the same pointer.
11786 * Rust functions which take ownership of an object provided via an argument require
11787 * this to be true and invalidate the object pointed to by inner.
11795 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
11796 * This is used to convince the recipient that the channel is at a certain commitment
11797 * number even if they lost that data due to a local failure. Of course, the peer may lie
11798 * and even later commitments may have been revoked.
11800 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
11802 * A pointer to the opaque Rust object.
11803 * Nearly everywhere, inner must be non-null, however in places where
11804 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11806 LDKnativeDataLossProtect *inner;
11808 * Indicates that this is the only struct which contains the same pointer.
11809 * Rust functions which take ownership of an object provided via an argument require
11810 * this to be true and invalidate the object pointed to by inner.
11813 } LDKDataLossProtect;
11816 * A trait to describe an object which can receive routing messages.
11818 * # Implementor DoS Warnings
11820 * For `gossip_queries` messages there are potential DoS vectors when handling
11821 * inbound queries. Implementors using an on-disk network graph should be aware of
11822 * repeated disk I/O for queries accessing different parts of the network graph.
11824 typedef struct LDKRoutingMessageHandler {
11826 * An opaque pointer which is passed to your function implementations as an argument.
11827 * This has no meaning in the LDK, and can be NULL or any other value.
11831 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
11832 * false or returning an Err otherwise.
11834 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
11836 * Handle a channel_announcement message, returning true if it should be forwarded on, false
11837 * or returning an Err otherwise.
11839 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
11841 * Handle an incoming channel_update message, returning true if it should be forwarded on,
11842 * false or returning an Err otherwise.
11844 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
11846 * Gets a subset of the channel announcements and updates required to dump our routing table
11847 * to a remote node, starting at the short_channel_id indicated by starting_point and
11848 * including the batch_amount entries immediately higher in numerical value than starting_point.
11850 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
11852 * Gets a subset of the node announcements required to dump our routing table to a remote node,
11853 * starting at the node *after* the provided publickey and including batch_amount entries
11854 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
11855 * If None is provided for starting_point, we start at the first node.
11857 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
11859 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
11861 * Called when a connection is established with a peer. This can be used to
11862 * perform routing table synchronization using a strategy defined by the
11865 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
11867 * Handles the reply of a query we initiated to learn about channels
11868 * for a given range of blocks. We can expect to receive one or more
11869 * replies to a single query.
11871 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
11873 * Handles the reply of a query we initiated asking for routing gossip
11874 * messages for a list of channels. We should receive this message when
11875 * a node has completed its best effort to send us the pertaining routing
11878 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
11880 * Handles when a peer asks us to send a list of short_channel_ids
11881 * for the requested range of blocks.
11883 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
11885 * Handles when a peer asks us to send routing gossip messages for a
11886 * list of short_channel_ids.
11888 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
11890 * Implementation of MessageSendEventsProvider for this object.
11892 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
11894 * Frees any resources associated with this object given its this_arg pointer.
11895 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11897 void (*free)(void *this_arg);
11898 } LDKRoutingMessageHandler;
11901 * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
11904 typedef struct LDKCustomMessageReader {
11906 * An opaque pointer which is passed to your function implementations as an argument.
11907 * This has no meaning in the LDK, and can be NULL or any other value.
11911 * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
11912 * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
11913 * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
11914 * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
11916 struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
11918 * Frees any resources associated with this object given its this_arg pointer.
11919 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11921 void (*free)(void *this_arg);
11922 } LDKCustomMessageReader;
11925 * Handler for BOLT1-compliant messages.
11927 typedef struct LDKCustomMessageHandler {
11929 * An opaque pointer which is passed to your function implementations as an argument.
11930 * This has no meaning in the LDK, and can be NULL or any other value.
11934 * Called with the message type that was received and the buffer to be read.
11935 * Can return a `MessageHandlingError` if the message could not be handled.
11937 struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
11939 * Gets the list of pending messages which were generated by the custom message
11940 * handler, clearing the list in the process. The first tuple element must
11941 * correspond to the intended recipients node ids. If no connection to one of the
11942 * specified node does not exist, the message is simply not sent to it.
11944 struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
11946 * Implementation of CustomMessageReader for this object.
11948 struct LDKCustomMessageReader CustomMessageReader;
11950 * Frees any resources associated with this object given its this_arg pointer.
11951 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11953 void (*free)(void *this_arg);
11954 } LDKCustomMessageHandler;
11959 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
11960 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
11962 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
11964 * A pointer to the opaque Rust object.
11965 * Nearly everywhere, inner must be non-null, however in places where
11966 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11968 LDKnativeIgnoringMessageHandler *inner;
11970 * Indicates that this is the only struct which contains the same pointer.
11971 * Rust functions which take ownership of an object provided via an argument require
11972 * this to be true and invalidate the object pointed to by inner.
11975 } LDKIgnoringMessageHandler;
11980 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
11981 * You can provide one of these as the route_handler in a MessageHandler.
11983 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
11985 * A pointer to the opaque Rust object.
11986 * Nearly everywhere, inner must be non-null, however in places where
11987 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11989 LDKnativeErroringMessageHandler *inner;
11991 * Indicates that this is the only struct which contains the same pointer.
11992 * Rust functions which take ownership of an object provided via an argument require
11993 * this to be true and invalidate the object pointed to by inner.
11996 } LDKErroringMessageHandler;
12001 * Provides references to trait impls which handle different types of messages.
12003 typedef struct MUST_USE_STRUCT LDKMessageHandler {
12005 * A pointer to the opaque Rust object.
12006 * Nearly everywhere, inner must be non-null, however in places where
12007 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12009 LDKnativeMessageHandler *inner;
12011 * Indicates that this is the only struct which contains the same pointer.
12012 * Rust functions which take ownership of an object provided via an argument require
12013 * this to be true and invalidate the object pointed to by inner.
12016 } LDKMessageHandler;
12019 * Provides an object which can be used to send data to and which uniquely identifies a connection
12020 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
12021 * implement Hash to meet the PeerManager API.
12023 * For efficiency, Clone should be relatively cheap for this type.
12025 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
12026 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
12027 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
12028 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
12029 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
12030 * to simply use another value which is guaranteed to be globally unique instead.
12032 typedef struct LDKSocketDescriptor {
12034 * An opaque pointer which is passed to your function implementations as an argument.
12035 * This has no meaning in the LDK, and can be NULL or any other value.
12039 * Attempts to send some data from the given slice to the peer.
12041 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
12042 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
12043 * called and further write attempts may occur until that time.
12045 * If the returned size is smaller than `data.len()`, a
12046 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
12047 * written. Additionally, until a `send_data` event completes fully, no further
12048 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
12049 * prevent denial-of-service issues, you should not read or buffer any data from the socket
12052 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
12053 * (indicating that read events should be paused to prevent DoS in the send buffer),
12054 * `resume_read` may be set indicating that read events on this descriptor should resume. A
12055 * `resume_read` of false carries no meaning, and should not cause any action.
12057 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
12059 * Disconnect the socket pointed to by this SocketDescriptor.
12061 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
12062 * call (doing so is a noop).
12064 void (*disconnect_socket)(void *this_arg);
12066 * Checks if two objects are equal given this object's this_arg pointer and another object.
12068 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
12070 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
12071 * This is used, for example, for inclusion of this object in a hash map.
12073 uint64_t (*hash)(const void *this_arg);
12075 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
12076 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
12077 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
12079 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
12081 * Frees any resources associated with this object given its this_arg pointer.
12082 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12084 void (*free)(void *this_arg);
12085 } LDKSocketDescriptor;
12090 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
12091 * socket events into messages which it passes on to its [`MessageHandler`].
12093 * Locks are taken internally, so you must never assume that reentrancy from a
12094 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
12096 * Calls to [`read_event`] will decode relevant messages and pass them to the
12097 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
12098 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
12099 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
12100 * calls only after previous ones have returned.
12102 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
12103 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
12104 * essentially you should default to using a SimpleRefPeerManager, and use a
12105 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
12106 * you're using lightning-net-tokio.
12108 * [`read_event`]: PeerManager::read_event
12110 typedef struct MUST_USE_STRUCT LDKPeerManager {
12112 * A pointer to the opaque Rust object.
12113 * Nearly everywhere, inner must be non-null, however in places where
12114 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12116 LDKnativePeerManager *inner;
12118 * Indicates that this is the only struct which contains the same pointer.
12119 * Rust functions which take ownership of an object provided via an argument require
12120 * this to be true and invalidate the object pointed to by inner.
12128 * Static channel fields used to build transactions given per-commitment fields, organized by
12129 * broadcaster/countersignatory.
12131 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
12132 * as_holder_broadcastable and as_counterparty_broadcastable functions.
12134 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
12136 * A pointer to the opaque Rust object.
12137 * Nearly everywhere, inner must be non-null, however in places where
12138 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12140 LDKnativeDirectedChannelTransactionParameters *inner;
12142 * Indicates that this is the only struct which contains the same pointer.
12143 * Rust functions which take ownership of an object provided via an argument require
12144 * this to be true and invalidate the object pointed to by inner.
12147 } LDKDirectedChannelTransactionParameters;
12150 * Integer in the range `0..=16`
12152 typedef struct LDKWitnessVersion {
12154 } LDKWitnessVersion;
12159 * A read-only view of [`NetworkGraph`].
12161 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
12163 * A pointer to the opaque Rust object.
12164 * Nearly everywhere, inner must be non-null, however in places where
12165 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12167 LDKnativeReadOnlyNetworkGraph *inner;
12169 * Indicates that this is the only struct which contains the same pointer.
12170 * Rust functions which take ownership of an object provided via an argument require
12171 * this to be true and invalidate the object pointed to by inner.
12174 } LDKReadOnlyNetworkGraph;
12179 * Receives and validates network updates from peers,
12180 * stores authentic and relevant data as a network graph.
12181 * This network graph is then used for routing payments.
12182 * Provides interface to help with initial routing sync by
12183 * serving historical announcements.
12185 * Serves as an [`EventHandler`] for applying updates from [`Event::PaymentPathFailed`] to the
12186 * [`NetworkGraph`].
12188 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
12190 * A pointer to the opaque Rust object.
12191 * Nearly everywhere, inner must be non-null, however in places where
12192 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12194 LDKnativeP2PGossipSync *inner;
12196 * Indicates that this is the only struct which contains the same pointer.
12197 * Rust functions which take ownership of an object provided via an argument require
12198 * this to be true and invalidate the object pointed to by inner.
12201 } LDKP2PGossipSync;
12206 * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
12207 * source node to a target node.
12209 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
12211 * A pointer to the opaque Rust object.
12212 * Nearly everywhere, inner must be non-null, however in places where
12213 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12215 LDKnativeDirectedChannelInfo *inner;
12217 * Indicates that this is the only struct which contains the same pointer.
12218 * Rust functions which take ownership of an object provided via an argument require
12219 * this to be true and invalidate the object pointed to by inner.
12222 } LDKDirectedChannelInfo;
12225 * The effective capacity of a channel for routing purposes.
12227 * While this may be smaller than the actual channel capacity, amounts greater than
12228 * [`Self::as_msat`] should not be routed through the channel.
12230 typedef enum LDKEffectiveCapacity_Tag {
12232 * The available liquidity in the channel known from being a channel counterparty, and thus a
12235 LDKEffectiveCapacity_ExactLiquidity,
12237 * The maximum HTLC amount in one direction as advertised on the gossip network.
12239 LDKEffectiveCapacity_MaximumHTLC,
12241 * The total capacity of the channel as determined by the funding transaction.
12243 LDKEffectiveCapacity_Total,
12245 * A capacity sufficient to route any payment, typically used for private channels provided by
12248 LDKEffectiveCapacity_Infinite,
12250 * A capacity that is unknown possibly because either the chain state is unavailable to know
12251 * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
12253 LDKEffectiveCapacity_Unknown,
12255 * Must be last for serialization purposes
12257 LDKEffectiveCapacity_Sentinel,
12258 } LDKEffectiveCapacity_Tag;
12260 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
12262 * Either the inbound or outbound liquidity depending on the direction, denominated in
12265 uint64_t liquidity_msat;
12266 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
12268 typedef struct LDKEffectiveCapacity_LDKMaximumHTLC_Body {
12270 * The maximum HTLC amount denominated in millisatoshi.
12272 uint64_t amount_msat;
12273 } LDKEffectiveCapacity_LDKMaximumHTLC_Body;
12275 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
12277 * The funding amount denominated in millisatoshi.
12279 uint64_t capacity_msat;
12280 } LDKEffectiveCapacity_LDKTotal_Body;
12282 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
12283 LDKEffectiveCapacity_Tag tag;
12285 LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
12286 LDKEffectiveCapacity_LDKMaximumHTLC_Body maximum_htlc;
12287 LDKEffectiveCapacity_LDKTotal_Body total;
12289 } LDKEffectiveCapacity;
12294 * A concrete implementation of [`LockableScore`] which supports multi-threading.
12296 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
12298 * A pointer to the opaque Rust object.
12299 * Nearly everywhere, inner must be non-null, however in places where
12300 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12302 LDKnativeMultiThreadedLockableScore *inner;
12304 * Indicates that this is the only struct which contains the same pointer.
12305 * Rust functions which take ownership of an object provided via an argument require
12306 * this to be true and invalidate the object pointed to by inner.
12309 } LDKMultiThreadedLockableScore;
12314 * Parameters for configuring [`ProbabilisticScorer`].
12316 * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
12317 * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
12319 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringParameters {
12321 * A pointer to the opaque Rust object.
12322 * Nearly everywhere, inner must be non-null, however in places where
12323 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12325 LDKnativeProbabilisticScoringParameters *inner;
12327 * Indicates that this is the only struct which contains the same pointer.
12328 * Rust functions which take ownership of an object provided via an argument require
12329 * this to be true and invalidate the object pointed to by inner.
12332 } LDKProbabilisticScoringParameters;
12337 * FilesystemPersister persists channel data on disk, where each channel's
12338 * data is stored in a file named after its funding outpoint.
12340 * Warning: this module does the best it can with calls to persist data, but it
12341 * can only guarantee that the data is passed to the drive. It is up to the
12342 * drive manufacturers to do the actual persistence properly, which they often
12343 * don't (especially on consumer-grade hardware). Therefore, it is up to the
12344 * user to validate their entire storage stack, to ensure the writes are
12346 * Corollary: especially when dealing with larger amounts of money, it is best
12347 * practice to have multiple channel data backups and not rely only on one
12348 * FilesystemPersister.
12350 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
12352 * A pointer to the opaque Rust object.
12353 * Nearly everywhere, inner must be non-null, however in places where
12354 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12356 LDKnativeFilesystemPersister *inner;
12358 * Indicates that this is the only struct which contains the same pointer.
12359 * Rust functions which take ownership of an object provided via an argument require
12360 * this to be true and invalidate the object pointed to by inner.
12363 } LDKFilesystemPersister;
12368 * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
12369 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
12370 * responsibilities are:
12371 * * Processing [`Event`]s with a user-provided [`EventHandler`].
12372 * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
12373 * writing it to disk/backups by invoking the callback given to it at startup.
12374 * [`ChannelManager`] persistence should be done in the background.
12375 * * Calling [`ChannelManager::timer_tick_occurred`] and [`PeerManager::timer_tick_occurred`]
12376 * at the appropriate intervals.
12377 * * Calling [`NetworkGraph::remove_stale_channels`] (if a [`GossipSync`] with a [`NetworkGraph`]
12378 * is provided to [`BackgroundProcessor::start`]).
12380 * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
12381 * upon as doing so may result in high latency.
12385 * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
12386 * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
12387 * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
12388 * unilateral chain closure fees are at risk.
12390 * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
12391 * [`Event`]: lightning::util::events::Event
12392 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
12394 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
12396 * A pointer to the opaque Rust object.
12397 * Nearly everywhere, inner must be non-null, however in places where
12398 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12400 LDKnativeBackgroundProcessor *inner;
12402 * Indicates that this is the only struct which contains the same pointer.
12403 * Rust functions which take ownership of an object provided via an argument require
12404 * this to be true and invalidate the object pointed to by inner.
12407 } LDKBackgroundProcessor;
12412 * Rapid Gossip Sync struct
12413 * See [crate-level documentation] for usage.
12415 * [crate-level documentation]: crate
12417 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
12419 * A pointer to the opaque Rust object.
12420 * Nearly everywhere, inner must be non-null, however in places where
12421 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12423 LDKnativeRapidGossipSync *inner;
12425 * Indicates that this is the only struct which contains the same pointer.
12426 * Rust functions which take ownership of an object provided via an argument require
12427 * this to be true and invalidate the object pointed to by inner.
12430 } LDKRapidGossipSync;
12433 * Either [`P2PGossipSync`] or [`RapidGossipSync`].
12435 typedef enum LDKGossipSync_Tag {
12437 * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
12441 * Rapid gossip sync from a trusted server.
12443 LDKGossipSync_Rapid,
12447 LDKGossipSync_None,
12449 * Must be last for serialization purposes
12451 LDKGossipSync_Sentinel,
12452 } LDKGossipSync_Tag;
12454 typedef struct MUST_USE_STRUCT LDKGossipSync {
12455 LDKGossipSync_Tag tag;
12458 struct LDKP2PGossipSync p2p;
12461 struct LDKRapidGossipSync rapid;
12469 * Data of the `RawInvoice` that is encoded in the data part
12471 typedef struct MUST_USE_STRUCT LDKRawDataPart {
12473 * A pointer to the opaque Rust object.
12474 * Nearly everywhere, inner must be non-null, however in places where
12475 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12477 LDKnativeRawDataPart *inner;
12479 * Indicates that this is the only struct which contains the same pointer.
12480 * Rust functions which take ownership of an object provided via an argument require
12481 * this to be true and invalidate the object pointed to by inner.
12491 typedef struct MUST_USE_STRUCT LDKSha256 {
12493 * A pointer to the opaque Rust object.
12494 * Nearly everywhere, inner must be non-null, however in places where
12495 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12497 LDKnativeSha256 *inner;
12499 * Indicates that this is the only struct which contains the same pointer.
12500 * Rust functions which take ownership of an object provided via an argument require
12501 * this to be true and invalidate the object pointed to by inner.
12509 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
12512 typedef struct MUST_USE_STRUCT LDKExpiryTime {
12514 * A pointer to the opaque Rust object.
12515 * Nearly everywhere, inner must be non-null, however in places where
12516 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12518 LDKnativeExpiryTime *inner;
12520 * Indicates that this is the only struct which contains the same pointer.
12521 * Rust functions which take ownership of an object provided via an argument require
12522 * this to be true and invalidate the object pointed to by inner.
12530 * `min_final_cltv_expiry` to use for the last HTLC in the route
12532 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiry {
12534 * A pointer to the opaque Rust object.
12535 * Nearly everywhere, inner must be non-null, however in places where
12536 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12538 LDKnativeMinFinalCltvExpiry *inner;
12540 * Indicates that this is the only struct which contains the same pointer.
12541 * Rust functions which take ownership of an object provided via an argument require
12542 * this to be true and invalidate the object pointed to by inner.
12545 } LDKMinFinalCltvExpiry;
12548 * A 20-byte byte array.
12550 typedef struct LDKTwentyBytes {
12558 * Fallback address in case no LN payment is possible
12560 typedef enum LDKFallback_Tag {
12561 LDKFallback_SegWitProgram,
12562 LDKFallback_PubKeyHash,
12563 LDKFallback_ScriptHash,
12565 * Must be last for serialization purposes
12567 LDKFallback_Sentinel,
12570 typedef struct LDKFallback_LDKSegWitProgram_Body {
12571 struct LDKu5 version;
12572 struct LDKCVec_u8Z program;
12573 } LDKFallback_LDKSegWitProgram_Body;
12575 typedef struct MUST_USE_STRUCT LDKFallback {
12576 LDKFallback_Tag tag;
12578 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
12580 struct LDKTwentyBytes pub_key_hash;
12583 struct LDKTwentyBytes script_hash;
12589 * A trait defining behavior of an [`Invoice`] payer.
12591 typedef struct LDKPayer {
12593 * An opaque pointer which is passed to your function implementations as an argument.
12594 * This has no meaning in the LDK, and can be NULL or any other value.
12598 * Returns the payer's node id.
12600 struct LDKPublicKey (*node_id)(const void *this_arg);
12602 * Returns the payer's channels.
12604 struct LDKCVec_ChannelDetailsZ (*first_hops)(const void *this_arg);
12606 * Sends a payment over the Lightning Network using the given [`Route`].
12608 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
12610 struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
12612 * Sends a spontaneous payment over the Lightning Network using the given [`Route`].
12614 struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_spontaneous_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage);
12616 * Retries a failed payment path for the [`PaymentId`] using the given [`Route`].
12618 struct LDKCResult_NonePaymentSendFailureZ (*retry_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id);
12620 * Signals that no further retries for the given payment will occur.
12622 void (*abandon_payment)(const void *this_arg, struct LDKThirtyTwoBytes payment_id);
12624 * Frees any resources associated with this object given its this_arg pointer.
12625 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12627 void (*free)(void *this_arg);
12631 * A trait defining behavior for routing an [`Invoice`] payment.
12633 typedef struct LDKRouter {
12635 * An opaque pointer which is passed to your function implementations as an argument.
12636 * This has no meaning in the LDK, and can be NULL or any other value.
12640 * Finds a [`Route`] between `payer` and `payee` for a payment with the given values.
12642 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
12644 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);
12646 * Frees any resources associated with this object given its this_arg pointer.
12647 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12649 void (*free)(void *this_arg);
12655 * A utility for paying [`Invoice`]s and sending spontaneous payments.
12657 * See [module-level documentation] for details.
12659 * [module-level documentation]: crate::payment
12661 typedef struct MUST_USE_STRUCT LDKInvoicePayer {
12663 * A pointer to the opaque Rust object.
12664 * Nearly everywhere, inner must be non-null, however in places where
12665 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12667 LDKnativeInvoicePayer *inner;
12669 * Indicates that this is the only struct which contains the same pointer.
12670 * Rust functions which take ownership of an object provided via an argument require
12671 * this to be true and invalidate the object pointed to by inner.
12677 * Strategies available to retry payment path failures for an [`Invoice`].
12680 typedef enum LDKRetry_Tag {
12682 * Max number of attempts to retry payment.
12684 * Note that this is the number of *path* failures, not full payment retries. For multi-path
12685 * payments, if this is less than the total number of paths, we will never even retry all of the
12690 * Time elapsed before abandoning retries for a payment.
12694 * Must be last for serialization purposes
12699 typedef struct MUST_USE_STRUCT LDKRetry {
12703 uintptr_t attempts;
12714 * A [`Router`] implemented using [`find_route`].
12716 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
12718 * A pointer to the opaque Rust object.
12719 * Nearly everywhere, inner must be non-null, however in places where
12720 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12722 LDKnativeDefaultRouter *inner;
12724 * Indicates that this is the only struct which contains the same pointer.
12725 * Rust functions which take ownership of an object provided via an argument require
12726 * this to be true and invalidate the object pointed to by inner.
12729 } LDKDefaultRouter;
12731 extern const uintptr_t MAX_BUF_SIZE;
12733 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
12735 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
12737 extern const uint32_t ANTI_REORG_DELAY;
12739 extern const uint16_t BREAKDOWN_TIMEOUT;
12741 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
12743 extern const uint32_t MIN_FINAL_CLTV_EXPIRY;
12745 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
12747 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
12749 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
12751 extern const uint64_t MAX_TIMESTAMP;
12753 extern const uint64_t DEFAULT_EXPIRY_TIME;
12755 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY;
12757 extern const uint8_t TAG_PAYMENT_HASH;
12759 extern const uint8_t TAG_DESCRIPTION;
12761 extern const uint8_t TAG_PAYEE_PUB_KEY;
12763 extern const uint8_t TAG_DESCRIPTION_HASH;
12765 extern const uint8_t TAG_EXPIRY_TIME;
12767 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
12769 extern const uint8_t TAG_FALLBACK;
12771 extern const uint8_t TAG_PRIVATE_ROUTE;
12773 extern const uint8_t TAG_PAYMENT_SECRET;
12775 extern const uint8_t TAG_FEATURES;
12777 struct LDKStr _ldk_get_compiled_version(void);
12779 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
12782 * Creates a new Bech32Error which has the same data as `orig`
12784 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
12787 * Releases any memory held by the given `Bech32Error` (which is currently none)
12789 void Bech32Error_free(struct LDKBech32Error o);
12792 * Frees the data buffer, if data_is_owned is set and datalen > 0.
12794 void Transaction_free(struct LDKTransaction _res);
12797 * Convenience function for constructing a new TxOut
12799 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
12802 * Frees the data pointed to by script_pubkey.
12804 void TxOut_free(struct LDKTxOut _res);
12807 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
12809 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
12812 * Frees the data buffer, if chars_is_owned is set and len > 0.
12814 void Str_free(struct LDKStr _res);
12816 #if defined(LDK_DEBUG_BUILD)
12818 * This function exists for memory safety testing purposes. It should never be used in production
12821 const void *__unmangle_inner_ptr(const void *ptr);
12825 * Creates a new CResult_NoneNoneZ in the success state.
12827 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
12830 * Creates a new CResult_NoneNoneZ in the error state.
12832 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
12835 * Checks if the given object is currently in the success state
12837 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
12840 * Frees any resources used by the CResult_NoneNoneZ.
12842 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
12845 * Creates a new CResult_NoneNoneZ which has the same data as `orig`
12846 * but with all dynamically-allocated buffers duplicated in new buffers.
12848 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
12851 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
12853 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
12856 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
12858 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
12861 * Checks if the given object is currently in the success state
12863 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
12866 * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
12868 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
12871 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
12872 * but with all dynamically-allocated buffers duplicated in new buffers.
12874 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
12877 * Creates a new CResult_SecretKeyErrorZ in the success state.
12879 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
12882 * Creates a new CResult_SecretKeyErrorZ in the error state.
12884 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
12887 * Checks if the given object is currently in the success state
12889 bool CResult_SecretKeyErrorZ_is_ok(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR o);
12892 * Frees any resources used by the CResult_SecretKeyErrorZ.
12894 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
12897 * Creates a new CResult_SecretKeyErrorZ which has the same data as `orig`
12898 * but with all dynamically-allocated buffers duplicated in new buffers.
12900 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_clone(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR orig);
12903 * Creates a new CResult_PublicKeyErrorZ in the success state.
12905 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
12908 * Creates a new CResult_PublicKeyErrorZ in the error state.
12910 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
12913 * Checks if the given object is currently in the success state
12915 bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o);
12918 * Frees any resources used by the CResult_PublicKeyErrorZ.
12920 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
12923 * Creates a new CResult_PublicKeyErrorZ which has the same data as `orig`
12924 * but with all dynamically-allocated buffers duplicated in new buffers.
12926 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig);
12929 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
12931 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
12934 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
12936 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
12939 * Checks if the given object is currently in the success state
12941 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
12944 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
12946 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
12949 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
12950 * but with all dynamically-allocated buffers duplicated in new buffers.
12952 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
12955 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
12957 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
12960 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
12962 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
12965 * Checks if the given object is currently in the success state
12967 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
12970 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
12972 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
12975 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
12976 * but with all dynamically-allocated buffers duplicated in new buffers.
12978 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
12981 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
12983 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
12986 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
12988 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
12991 * Checks if the given object is currently in the success state
12993 bool CResult_TxCreationKeysErrorZ_is_ok(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR o);
12996 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
12998 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
13001 * Creates a new CResult_TxCreationKeysErrorZ which has the same data as `orig`
13002 * but with all dynamically-allocated buffers duplicated in new buffers.
13004 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_clone(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR orig);
13007 * Constructs a new COption_u32Z containing a u32
13009 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
13012 * Constructs a new COption_u32Z containing nothing
13014 struct LDKCOption_u32Z COption_u32Z_none(void);
13017 * Frees any resources associated with the u32, if we are in the Some state
13019 void COption_u32Z_free(struct LDKCOption_u32Z _res);
13022 * Creates a new COption_u32Z which has the same data as `orig`
13023 * but with all dynamically-allocated buffers duplicated in new buffers.
13025 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
13028 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
13030 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
13033 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
13035 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
13038 * Checks if the given object is currently in the success state
13040 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
13043 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
13045 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
13048 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
13049 * but with all dynamically-allocated buffers duplicated in new buffers.
13051 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
13054 * Constructs a new COption_NoneZ containing a
13056 enum LDKCOption_NoneZ COption_NoneZ_some(void);
13059 * Constructs a new COption_NoneZ containing nothing
13061 enum LDKCOption_NoneZ COption_NoneZ_none(void);
13064 * Frees any resources associated with the , if we are in the Some state
13066 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
13069 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
13071 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
13074 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
13076 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
13079 * Checks if the given object is currently in the success state
13081 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
13084 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
13086 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
13089 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
13090 * but with all dynamically-allocated buffers duplicated in new buffers.
13092 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
13095 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
13097 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
13100 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
13102 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
13105 * Checks if the given object is currently in the success state
13107 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
13110 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
13112 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
13115 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
13116 * but with all dynamically-allocated buffers duplicated in new buffers.
13118 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
13121 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13123 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
13126 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
13128 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
13131 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
13133 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
13136 * Checks if the given object is currently in the success state
13138 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
13141 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
13143 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
13146 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
13147 * but with all dynamically-allocated buffers duplicated in new buffers.
13149 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
13152 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
13154 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
13157 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
13159 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
13162 * Checks if the given object is currently in the success state
13164 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
13167 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
13169 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
13172 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
13173 * but with all dynamically-allocated buffers duplicated in new buffers.
13175 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
13178 * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
13180 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
13183 * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
13185 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
13188 * Checks if the given object is currently in the success state
13190 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
13193 * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
13195 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
13198 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
13200 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
13203 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
13205 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
13208 * Checks if the given object is currently in the success state
13210 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
13213 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
13215 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
13218 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
13219 * but with all dynamically-allocated buffers duplicated in new buffers.
13221 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
13224 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
13226 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
13229 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
13231 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
13234 * Checks if the given object is currently in the success state
13236 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
13239 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
13241 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
13244 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
13246 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
13249 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
13251 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
13254 * Checks if the given object is currently in the success state
13256 bool CResult_CVec_SignatureZNoneZ_is_ok(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR o);
13259 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
13261 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
13264 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
13265 * but with all dynamically-allocated buffers duplicated in new buffers.
13267 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
13270 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
13272 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
13275 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
13277 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
13280 * Checks if the given object is currently in the success state
13282 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
13285 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
13287 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
13290 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
13291 * but with all dynamically-allocated buffers duplicated in new buffers.
13293 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
13296 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
13298 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
13301 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
13303 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
13306 * Checks if the given object is currently in the success state
13308 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
13311 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
13313 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
13316 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
13317 * but with all dynamically-allocated buffers duplicated in new buffers.
13319 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
13322 * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
13324 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o);
13327 * Constructs a new COption_WriteableScoreZ containing nothing
13329 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void);
13332 * Frees any resources associated with the crate::lightning::routing::scoring::WriteableScore, if we are in the Some state
13334 void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res);
13337 * Creates a new CResult_NoneErrorZ in the success state.
13339 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
13342 * Creates a new CResult_NoneErrorZ in the error state.
13344 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
13347 * Checks if the given object is currently in the success state
13349 bool CResult_NoneErrorZ_is_ok(const struct LDKCResult_NoneErrorZ *NONNULL_PTR o);
13352 * Frees any resources used by the CResult_NoneErrorZ.
13354 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
13357 * Creates a new CResult_NoneErrorZ which has the same data as `orig`
13358 * but with all dynamically-allocated buffers duplicated in new buffers.
13360 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig);
13363 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
13365 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
13368 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
13370 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
13373 * Checks if the given object is currently in the success state
13375 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
13378 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
13380 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
13383 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
13384 * but with all dynamically-allocated buffers duplicated in new buffers.
13386 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
13389 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13391 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
13394 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13396 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
13399 * Creates a new CResult_RouteDecodeErrorZ in the success state.
13401 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
13404 * Creates a new CResult_RouteDecodeErrorZ in the error state.
13406 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
13409 * Checks if the given object is currently in the success state
13411 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
13414 * Frees any resources used by the CResult_RouteDecodeErrorZ.
13416 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
13419 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
13420 * but with all dynamically-allocated buffers duplicated in new buffers.
13422 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
13425 * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
13427 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
13430 * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
13432 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
13435 * Checks if the given object is currently in the success state
13437 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
13440 * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
13442 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
13445 * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
13446 * but with all dynamically-allocated buffers duplicated in new buffers.
13448 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
13451 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13453 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
13456 * Constructs a new COption_u64Z containing a u64
13458 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
13461 * Constructs a new COption_u64Z containing nothing
13463 struct LDKCOption_u64Z COption_u64Z_none(void);
13466 * Frees any resources associated with the u64, if we are in the Some state
13468 void COption_u64Z_free(struct LDKCOption_u64Z _res);
13471 * Creates a new COption_u64Z which has the same data as `orig`
13472 * but with all dynamically-allocated buffers duplicated in new buffers.
13474 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
13477 * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
13479 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
13482 * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
13484 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
13487 * Checks if the given object is currently in the success state
13489 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
13492 * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
13494 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
13497 * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
13498 * but with all dynamically-allocated buffers duplicated in new buffers.
13500 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
13503 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13505 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
13508 * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
13510 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
13513 * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
13515 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
13518 * Checks if the given object is currently in the success state
13520 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
13523 * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
13525 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
13528 * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
13529 * but with all dynamically-allocated buffers duplicated in new buffers.
13531 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
13534 * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
13536 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
13539 * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
13541 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
13544 * Checks if the given object is currently in the success state
13546 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
13549 * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
13551 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
13554 * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
13555 * but with all dynamically-allocated buffers duplicated in new buffers.
13557 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
13560 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13562 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
13565 * Creates a new CResult_RouteLightningErrorZ in the success state.
13567 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
13570 * Creates a new CResult_RouteLightningErrorZ in the error state.
13572 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
13575 * Checks if the given object is currently in the success state
13577 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
13580 * Frees any resources used by the CResult_RouteLightningErrorZ.
13582 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
13585 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
13586 * but with all dynamically-allocated buffers duplicated in new buffers.
13588 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
13591 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13593 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
13596 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
13598 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
13601 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
13603 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
13606 * Checks if the given object is currently in the success state
13608 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
13611 * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
13613 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
13616 * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
13617 * but with all dynamically-allocated buffers duplicated in new buffers.
13619 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
13622 * Constructs a new COption_ClosureReasonZ containing a crate::lightning::util::events::ClosureReason
13624 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
13627 * Constructs a new COption_ClosureReasonZ containing nothing
13629 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
13632 * Frees any resources associated with the crate::lightning::util::events::ClosureReason, if we are in the Some state
13634 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
13637 * Creates a new COption_ClosureReasonZ which has the same data as `orig`
13638 * but with all dynamically-allocated buffers duplicated in new buffers.
13640 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
13643 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
13645 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
13648 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
13650 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
13653 * Checks if the given object is currently in the success state
13655 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
13658 * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
13660 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
13663 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
13664 * but with all dynamically-allocated buffers duplicated in new buffers.
13666 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
13669 * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
13671 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
13674 * Constructs a new COption_NetworkUpdateZ containing nothing
13676 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
13679 * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
13681 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
13684 * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
13685 * but with all dynamically-allocated buffers duplicated in new buffers.
13687 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
13690 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13692 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
13695 * Constructs a new COption_EventZ containing a crate::lightning::util::events::Event
13697 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
13700 * Constructs a new COption_EventZ containing nothing
13702 struct LDKCOption_EventZ COption_EventZ_none(void);
13705 * Frees any resources associated with the crate::lightning::util::events::Event, if we are in the Some state
13707 void COption_EventZ_free(struct LDKCOption_EventZ _res);
13710 * Creates a new COption_EventZ which has the same data as `orig`
13711 * but with all dynamically-allocated buffers duplicated in new buffers.
13713 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
13716 * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
13718 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
13721 * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
13723 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
13726 * Checks if the given object is currently in the success state
13728 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
13731 * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
13733 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
13736 * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
13737 * but with all dynamically-allocated buffers duplicated in new buffers.
13739 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
13742 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13744 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
13747 * Creates a new CResult_TxOutAccessErrorZ in the success state.
13749 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
13752 * Creates a new CResult_TxOutAccessErrorZ in the error state.
13754 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
13757 * Checks if the given object is currently in the success state
13759 bool CResult_TxOutAccessErrorZ_is_ok(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR o);
13762 * Frees any resources used by the CResult_TxOutAccessErrorZ.
13764 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
13767 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
13768 * but with all dynamically-allocated buffers duplicated in new buffers.
13770 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
13773 * Creates a new tuple which has the same data as `orig`
13774 * but with all dynamically-allocated buffers duplicated in new buffers.
13776 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
13779 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
13781 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
13784 * Frees any resources used by the C2Tuple_usizeTransactionZ.
13786 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
13789 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13791 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
13794 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13796 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
13799 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
13801 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
13804 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
13806 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
13809 * Checks if the given object is currently in the success state
13811 bool CResult_NoneChannelMonitorUpdateErrZ_is_ok(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR o);
13814 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
13816 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
13819 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
13820 * but with all dynamically-allocated buffers duplicated in new buffers.
13822 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
13825 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13827 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
13830 * Creates a new tuple which has the same data as `orig`
13831 * but with all dynamically-allocated buffers duplicated in new buffers.
13833 struct LDKC2Tuple_OutPointCVec_MonitorEventZZ C2Tuple_OutPointCVec_MonitorEventZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorEventZZ *NONNULL_PTR orig);
13836 * Creates a new C2Tuple_OutPointCVec_MonitorEventZZ from the contained elements.
13838 struct LDKC2Tuple_OutPointCVec_MonitorEventZZ C2Tuple_OutPointCVec_MonitorEventZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b);
13841 * Frees any resources used by the C2Tuple_OutPointCVec_MonitorEventZZ.
13843 void C2Tuple_OutPointCVec_MonitorEventZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorEventZZ _res);
13846 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13848 void CVec_C2Tuple_OutPointCVec_MonitorEventZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ _res);
13851 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
13853 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
13856 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
13858 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
13861 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
13863 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
13866 * Creates a new COption_C2Tuple_usizeTransactionZZ which has the same data as `orig`
13867 * but with all dynamically-allocated buffers duplicated in new buffers.
13869 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_clone(const struct LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR orig);
13872 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
13874 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
13877 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
13879 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
13882 * Checks if the given object is currently in the success state
13884 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
13887 * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
13889 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
13892 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
13893 * but with all dynamically-allocated buffers duplicated in new buffers.
13895 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
13898 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
13900 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
13903 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
13905 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
13908 * Checks if the given object is currently in the success state
13910 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
13913 * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
13915 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
13918 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
13920 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
13923 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
13925 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
13928 * Checks if the given object is currently in the success state
13930 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
13933 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
13935 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
13938 * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
13939 * but with all dynamically-allocated buffers duplicated in new buffers.
13941 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
13944 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
13946 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
13949 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
13951 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
13954 * Checks if the given object is currently in the success state
13956 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
13959 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
13961 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
13964 * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
13965 * but with all dynamically-allocated buffers duplicated in new buffers.
13967 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
13970 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
13972 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
13975 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
13977 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
13980 * Checks if the given object is currently in the success state
13982 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
13985 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
13987 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
13990 * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
13991 * but with all dynamically-allocated buffers duplicated in new buffers.
13993 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
13996 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
13998 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
14001 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
14003 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
14006 * Checks if the given object is currently in the success state
14008 bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
14011 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
14013 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
14016 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
14017 * but with all dynamically-allocated buffers duplicated in new buffers.
14019 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
14022 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
14024 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
14027 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
14029 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
14032 * Checks if the given object is currently in the success state
14034 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
14037 * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
14039 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
14042 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
14043 * but with all dynamically-allocated buffers duplicated in new buffers.
14045 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
14048 * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
14050 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
14053 * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
14055 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
14058 * Checks if the given object is currently in the success state
14060 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
14063 * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
14065 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
14068 * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
14069 * but with all dynamically-allocated buffers duplicated in new buffers.
14071 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
14074 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
14076 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
14079 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
14081 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
14084 * Checks if the given object is currently in the success state
14086 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
14089 * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
14091 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
14094 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
14095 * but with all dynamically-allocated buffers duplicated in new buffers.
14097 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
14100 * Constructs a new COption_AccessZ containing a crate::lightning::chain::Access
14102 struct LDKCOption_AccessZ COption_AccessZ_some(struct LDKAccess o);
14105 * Constructs a new COption_AccessZ containing nothing
14107 struct LDKCOption_AccessZ COption_AccessZ_none(void);
14110 * Frees any resources associated with the crate::lightning::chain::Access, if we are in the Some state
14112 void COption_AccessZ_free(struct LDKCOption_AccessZ _res);
14115 * Creates a new CResult_boolLightningErrorZ in the success state.
14117 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
14120 * Creates a new CResult_boolLightningErrorZ in the error state.
14122 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
14125 * Checks if the given object is currently in the success state
14127 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
14130 * Frees any resources used by the CResult_boolLightningErrorZ.
14132 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
14135 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
14136 * but with all dynamically-allocated buffers duplicated in new buffers.
14138 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
14141 * Creates a new tuple which has the same data as `orig`
14142 * but with all dynamically-allocated buffers duplicated in new buffers.
14144 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
14147 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
14149 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
14152 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
14154 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
14157 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14159 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
14162 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14164 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
14167 * Creates a new CResult_NoneLightningErrorZ in the success state.
14169 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
14172 * Creates a new CResult_NoneLightningErrorZ in the error state.
14174 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
14177 * Checks if the given object is currently in the success state
14179 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
14182 * Frees any resources used by the CResult_NoneLightningErrorZ.
14184 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
14187 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
14188 * but with all dynamically-allocated buffers duplicated in new buffers.
14190 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
14193 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
14195 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
14198 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
14200 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
14203 * Checks if the given object is currently in the success state
14205 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
14208 * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
14210 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
14213 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
14214 * but with all dynamically-allocated buffers duplicated in new buffers.
14216 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
14219 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
14221 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
14224 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
14226 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
14229 * Checks if the given object is currently in the success state
14231 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
14234 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
14236 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
14239 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
14240 * but with all dynamically-allocated buffers duplicated in new buffers.
14242 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
14245 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
14247 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
14250 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
14252 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
14255 * Checks if the given object is currently in the success state
14257 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
14260 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
14262 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
14265 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
14266 * but with all dynamically-allocated buffers duplicated in new buffers.
14268 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
14271 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14273 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
14276 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
14278 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
14281 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
14283 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
14286 * Checks if the given object is currently in the success state
14288 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
14291 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
14293 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
14296 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
14297 * but with all dynamically-allocated buffers duplicated in new buffers.
14299 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
14302 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14304 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
14307 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
14309 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
14312 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
14314 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
14317 * Checks if the given object is currently in the success state
14319 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
14322 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
14324 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
14327 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
14328 * but with all dynamically-allocated buffers duplicated in new buffers.
14330 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
14333 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
14335 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
14338 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
14340 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
14343 * Checks if the given object is currently in the success state
14345 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
14348 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
14350 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
14353 * Constructs a new COption_CVec_NetAddressZZ containing a crate::c_types::derived::CVec_NetAddressZ
14355 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o);
14358 * Constructs a new COption_CVec_NetAddressZZ containing nothing
14360 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void);
14363 * Frees any resources associated with the crate::c_types::derived::CVec_NetAddressZ, if we are in the Some state
14365 void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res);
14368 * Creates a new COption_CVec_NetAddressZZ which has the same data as `orig`
14369 * but with all dynamically-allocated buffers duplicated in new buffers.
14371 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig);
14374 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
14376 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
14379 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
14381 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
14384 * Checks if the given object is currently in the success state
14386 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
14389 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
14391 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
14394 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
14395 * but with all dynamically-allocated buffers duplicated in new buffers.
14397 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
14400 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
14402 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
14405 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
14407 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
14410 * Checks if the given object is currently in the success state
14412 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
14415 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
14417 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
14420 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
14421 * but with all dynamically-allocated buffers duplicated in new buffers.
14423 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
14426 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
14428 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
14431 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
14433 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
14436 * Checks if the given object is currently in the success state
14438 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
14441 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
14443 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
14446 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
14447 * but with all dynamically-allocated buffers duplicated in new buffers.
14449 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
14452 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14454 void CVec_PaymentPreimageZ_free(struct LDKCVec_PaymentPreimageZ _res);
14457 * Creates a new tuple which has the same data as `orig`
14458 * but with all dynamically-allocated buffers duplicated in new buffers.
14460 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
14463 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
14465 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
14468 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
14470 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
14473 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
14475 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
14478 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
14480 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
14483 * Checks if the given object is currently in the success state
14485 bool CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR o);
14488 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
14490 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
14493 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
14494 * but with all dynamically-allocated buffers duplicated in new buffers.
14496 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
14499 * Creates a new CResult_SignatureNoneZ in the success state.
14501 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
14504 * Creates a new CResult_SignatureNoneZ in the error state.
14506 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
14509 * Checks if the given object is currently in the success state
14511 bool CResult_SignatureNoneZ_is_ok(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR o);
14514 * Frees any resources used by the CResult_SignatureNoneZ.
14516 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
14519 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
14520 * but with all dynamically-allocated buffers duplicated in new buffers.
14522 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
14525 * Creates a new tuple which has the same data as `orig`
14526 * but with all dynamically-allocated buffers duplicated in new buffers.
14528 struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_clone(const struct LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR orig);
14531 * Creates a new C2Tuple_SignatureSignatureZ from the contained elements.
14533 struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_new(struct LDKSignature a, struct LDKSignature b);
14536 * Frees any resources used by the C2Tuple_SignatureSignatureZ.
14538 void C2Tuple_SignatureSignatureZ_free(struct LDKC2Tuple_SignatureSignatureZ _res);
14541 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the success state.
14543 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_ok(struct LDKC2Tuple_SignatureSignatureZ o);
14546 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the error state.
14548 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_err(void);
14551 * Checks if the given object is currently in the success state
14553 bool CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR o);
14556 * Frees any resources used by the CResult_C2Tuple_SignatureSignatureZNoneZ.
14558 void CResult_C2Tuple_SignatureSignatureZNoneZ_free(struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res);
14561 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ which has the same data as `orig`
14562 * but with all dynamically-allocated buffers duplicated in new buffers.
14564 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR orig);
14567 * Creates a new CResult_SecretKeyNoneZ in the success state.
14569 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_ok(struct LDKSecretKey o);
14572 * Creates a new CResult_SecretKeyNoneZ in the error state.
14574 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_err(void);
14577 * Checks if the given object is currently in the success state
14579 bool CResult_SecretKeyNoneZ_is_ok(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR o);
14582 * Frees any resources used by the CResult_SecretKeyNoneZ.
14584 void CResult_SecretKeyNoneZ_free(struct LDKCResult_SecretKeyNoneZ _res);
14587 * Creates a new CResult_SecretKeyNoneZ which has the same data as `orig`
14588 * but with all dynamically-allocated buffers duplicated in new buffers.
14590 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_clone(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR orig);
14593 * Creates a new CResult_SignDecodeErrorZ in the success state.
14595 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
14598 * Creates a new CResult_SignDecodeErrorZ in the error state.
14600 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
14603 * Checks if the given object is currently in the success state
14605 bool CResult_SignDecodeErrorZ_is_ok(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR o);
14608 * Frees any resources used by the CResult_SignDecodeErrorZ.
14610 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
14613 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
14614 * but with all dynamically-allocated buffers duplicated in new buffers.
14616 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
14619 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14621 void CVec_u5Z_free(struct LDKCVec_u5Z _res);
14624 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
14626 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
14629 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
14631 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
14634 * Checks if the given object is currently in the success state
14636 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
14639 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
14641 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
14644 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
14645 * but with all dynamically-allocated buffers duplicated in new buffers.
14647 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
14650 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14652 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
14655 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14657 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
14660 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
14662 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
14665 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
14667 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
14670 * Checks if the given object is currently in the success state
14672 bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o);
14675 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
14677 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
14680 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
14681 * but with all dynamically-allocated buffers duplicated in new buffers.
14683 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
14686 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
14688 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
14691 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
14693 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
14696 * Checks if the given object is currently in the success state
14698 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
14701 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
14703 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
14706 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
14707 * but with all dynamically-allocated buffers duplicated in new buffers.
14709 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
14712 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14714 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
14717 * Creates a new CResult_TransactionNoneZ in the success state.
14719 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
14722 * Creates a new CResult_TransactionNoneZ in the error state.
14724 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
14727 * Checks if the given object is currently in the success state
14729 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
14732 * Frees any resources used by the CResult_TransactionNoneZ.
14734 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
14737 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
14738 * but with all dynamically-allocated buffers duplicated in new buffers.
14740 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
14743 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
14745 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
14748 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
14750 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
14753 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14755 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
14758 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
14760 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
14763 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
14765 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
14768 * Checks if the given object is currently in the success state
14770 bool CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR o);
14773 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
14775 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
14778 * Constructs a new COption_u16Z containing a u16
14780 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
14783 * Constructs a new COption_u16Z containing nothing
14785 struct LDKCOption_u16Z COption_u16Z_none(void);
14788 * Frees any resources associated with the u16, if we are in the Some state
14790 void COption_u16Z_free(struct LDKCOption_u16Z _res);
14793 * Creates a new COption_u16Z which has the same data as `orig`
14794 * but with all dynamically-allocated buffers duplicated in new buffers.
14796 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
14799 * Creates a new CResult_NoneAPIErrorZ in the success state.
14801 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
14804 * Creates a new CResult_NoneAPIErrorZ in the error state.
14806 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
14809 * Checks if the given object is currently in the success state
14811 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
14814 * Frees any resources used by the CResult_NoneAPIErrorZ.
14816 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
14819 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
14820 * but with all dynamically-allocated buffers duplicated in new buffers.
14822 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
14825 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14827 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
14830 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14832 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
14835 * Creates a new CResult__u832APIErrorZ in the success state.
14837 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_ok(struct LDKThirtyTwoBytes o);
14840 * Creates a new CResult__u832APIErrorZ in the error state.
14842 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_err(struct LDKAPIError e);
14845 * Checks if the given object is currently in the success state
14847 bool CResult__u832APIErrorZ_is_ok(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR o);
14850 * Frees any resources used by the CResult__u832APIErrorZ.
14852 void CResult__u832APIErrorZ_free(struct LDKCResult__u832APIErrorZ _res);
14855 * Creates a new CResult__u832APIErrorZ which has the same data as `orig`
14856 * but with all dynamically-allocated buffers duplicated in new buffers.
14858 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig);
14861 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the success state.
14863 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
14866 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the error state.
14868 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
14871 * Checks if the given object is currently in the success state
14873 bool CResult_PaymentIdPaymentSendFailureZ_is_ok(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR o);
14876 * Frees any resources used by the CResult_PaymentIdPaymentSendFailureZ.
14878 void CResult_PaymentIdPaymentSendFailureZ_free(struct LDKCResult_PaymentIdPaymentSendFailureZ _res);
14881 * Creates a new CResult_PaymentIdPaymentSendFailureZ which has the same data as `orig`
14882 * but with all dynamically-allocated buffers duplicated in new buffers.
14884 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_clone(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR orig);
14887 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
14889 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
14892 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
14894 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
14897 * Checks if the given object is currently in the success state
14899 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
14902 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
14904 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
14907 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
14908 * but with all dynamically-allocated buffers duplicated in new buffers.
14910 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
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_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig);
14919 * Creates a new C2Tuple_PaymentHashPaymentIdZ from the contained elements.
14921 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
14924 * Frees any resources used by the C2Tuple_PaymentHashPaymentIdZ.
14926 void C2Tuple_PaymentHashPaymentIdZ_free(struct LDKC2Tuple_PaymentHashPaymentIdZ _res);
14929 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the success state.
14931 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(struct LDKC2Tuple_PaymentHashPaymentIdZ o);
14934 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the error state.
14936 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
14939 * Checks if the given object is currently in the success state
14941 bool CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR o);
14944 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.
14946 void CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res);
14949 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ which has the same data as `orig`
14950 * but with all dynamically-allocated buffers duplicated in new buffers.
14952 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig);
14955 * Creates a new tuple which has the same data as `orig`
14956 * but with all dynamically-allocated buffers duplicated in new buffers.
14958 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig);
14961 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
14963 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
14966 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
14968 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
14971 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the success state.
14973 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
14976 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the error state.
14978 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(void);
14981 * Checks if the given object is currently in the success state
14983 bool CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR o);
14986 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ.
14988 void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res);
14991 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ which has the same data as `orig`
14992 * but with all dynamically-allocated buffers duplicated in new buffers.
14994 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR orig);
14997 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the success state.
14999 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
15002 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the error state.
15004 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(struct LDKAPIError e);
15007 * Checks if the given object is currently in the success state
15009 bool CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR o);
15012 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.
15014 void CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res);
15017 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ which has the same data as `orig`
15018 * but with all dynamically-allocated buffers duplicated in new buffers.
15020 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR orig);
15023 * Creates a new CResult_PaymentSecretNoneZ in the success state.
15025 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
15028 * Creates a new CResult_PaymentSecretNoneZ in the error state.
15030 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_err(void);
15033 * Checks if the given object is currently in the success state
15035 bool CResult_PaymentSecretNoneZ_is_ok(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR o);
15038 * Frees any resources used by the CResult_PaymentSecretNoneZ.
15040 void CResult_PaymentSecretNoneZ_free(struct LDKCResult_PaymentSecretNoneZ _res);
15043 * Creates a new CResult_PaymentSecretNoneZ which has the same data as `orig`
15044 * but with all dynamically-allocated buffers duplicated in new buffers.
15046 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_clone(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR orig);
15049 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
15051 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
15054 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
15056 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
15059 * Checks if the given object is currently in the success state
15061 bool CResult_PaymentSecretAPIErrorZ_is_ok(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR o);
15064 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
15066 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
15069 * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig`
15070 * but with all dynamically-allocated buffers duplicated in new buffers.
15072 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig);
15075 * Creates a new CResult_PaymentPreimageAPIErrorZ in the success state.
15077 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
15080 * Creates a new CResult_PaymentPreimageAPIErrorZ in the error state.
15082 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_err(struct LDKAPIError e);
15085 * Checks if the given object is currently in the success state
15087 bool CResult_PaymentPreimageAPIErrorZ_is_ok(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR o);
15090 * Frees any resources used by the CResult_PaymentPreimageAPIErrorZ.
15092 void CResult_PaymentPreimageAPIErrorZ_free(struct LDKCResult_PaymentPreimageAPIErrorZ _res);
15095 * Creates a new CResult_PaymentPreimageAPIErrorZ which has the same data as `orig`
15096 * but with all dynamically-allocated buffers duplicated in new buffers.
15098 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_clone(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR orig);
15101 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
15103 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
15106 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
15108 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
15111 * Checks if the given object is currently in the success state
15113 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
15116 * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
15118 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
15121 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
15122 * but with all dynamically-allocated buffers duplicated in new buffers.
15124 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
15127 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
15129 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
15132 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
15134 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
15137 * Checks if the given object is currently in the success state
15139 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
15142 * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
15144 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
15147 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
15148 * but with all dynamically-allocated buffers duplicated in new buffers.
15150 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
15153 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
15155 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
15158 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
15160 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
15163 * Checks if the given object is currently in the success state
15165 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
15168 * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
15170 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
15173 * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
15174 * but with all dynamically-allocated buffers duplicated in new buffers.
15176 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
15179 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
15181 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
15184 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
15186 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
15189 * Checks if the given object is currently in the success state
15191 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
15194 * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
15196 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
15199 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
15200 * but with all dynamically-allocated buffers duplicated in new buffers.
15202 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
15205 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15207 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
15210 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
15212 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
15215 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
15217 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
15220 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
15222 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
15225 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
15227 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
15230 * Checks if the given object is currently in the success state
15232 bool CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR o);
15235 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
15237 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
15240 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
15242 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
15245 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
15247 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
15250 * Checks if the given object is currently in the success state
15252 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
15255 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
15257 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
15260 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
15261 * but with all dynamically-allocated buffers duplicated in new buffers.
15263 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
15266 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
15268 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
15271 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
15273 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
15276 * Checks if the given object is currently in the success state
15278 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
15281 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
15283 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
15286 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
15287 * but with all dynamically-allocated buffers duplicated in new buffers.
15289 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
15292 * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
15294 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
15297 * Constructs a new COption_TypeZ containing nothing
15299 struct LDKCOption_TypeZ COption_TypeZ_none(void);
15302 * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
15304 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
15307 * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
15309 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
15312 * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
15314 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
15317 * Checks if the given object is currently in the success state
15319 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
15322 * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
15324 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
15327 * Creates a new CResult_PaymentIdPaymentErrorZ in the success state.
15329 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
15332 * Creates a new CResult_PaymentIdPaymentErrorZ in the error state.
15334 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e);
15337 * Checks if the given object is currently in the success state
15339 bool CResult_PaymentIdPaymentErrorZ_is_ok(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR o);
15342 * Frees any resources used by the CResult_PaymentIdPaymentErrorZ.
15344 void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res);
15347 * Creates a new CResult_PaymentIdPaymentErrorZ which has the same data as `orig`
15348 * but with all dynamically-allocated buffers duplicated in new buffers.
15350 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig);
15353 * Creates a new CResult_SiPrefixParseErrorZ in the success state.
15355 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_ok(enum LDKSiPrefix o);
15358 * Creates a new CResult_SiPrefixParseErrorZ in the error state.
15360 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_err(struct LDKParseError e);
15363 * Checks if the given object is currently in the success state
15365 bool CResult_SiPrefixParseErrorZ_is_ok(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR o);
15368 * Frees any resources used by the CResult_SiPrefixParseErrorZ.
15370 void CResult_SiPrefixParseErrorZ_free(struct LDKCResult_SiPrefixParseErrorZ _res);
15373 * Creates a new CResult_SiPrefixParseErrorZ which has the same data as `orig`
15374 * but with all dynamically-allocated buffers duplicated in new buffers.
15376 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_clone(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR orig);
15379 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the success state.
15381 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_ok(struct LDKInvoice o);
15384 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the error state.
15386 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
15389 * Checks if the given object is currently in the success state
15391 bool CResult_InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
15394 * Frees any resources used by the CResult_InvoiceParseOrSemanticErrorZ.
15396 void CResult_InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_InvoiceParseOrSemanticErrorZ _res);
15399 * Creates a new CResult_InvoiceParseOrSemanticErrorZ which has the same data as `orig`
15400 * but with all dynamically-allocated buffers duplicated in new buffers.
15402 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
15405 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the success state.
15407 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_ok(struct LDKSignedRawInvoice o);
15410 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the error state.
15412 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_err(struct LDKParseError e);
15415 * Checks if the given object is currently in the success state
15417 bool CResult_SignedRawInvoiceParseErrorZ_is_ok(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR o);
15420 * Frees any resources used by the CResult_SignedRawInvoiceParseErrorZ.
15422 void CResult_SignedRawInvoiceParseErrorZ_free(struct LDKCResult_SignedRawInvoiceParseErrorZ _res);
15425 * Creates a new CResult_SignedRawInvoiceParseErrorZ which has the same data as `orig`
15426 * but with all dynamically-allocated buffers duplicated in new buffers.
15428 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_clone(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR orig);
15431 * Creates a new tuple which has the same data as `orig`
15432 * but with all dynamically-allocated buffers duplicated in new buffers.
15434 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig);
15437 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
15439 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
15442 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
15444 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
15447 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
15449 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
15452 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
15454 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
15457 * Checks if the given object is currently in the success state
15459 bool CResult_PayeePubKeyErrorZ_is_ok(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR o);
15462 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
15464 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
15467 * Creates a new CResult_PayeePubKeyErrorZ which has the same data as `orig`
15468 * but with all dynamically-allocated buffers duplicated in new buffers.
15470 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig);
15473 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15475 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
15478 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
15480 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
15483 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
15485 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
15488 * Checks if the given object is currently in the success state
15490 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
15493 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
15495 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
15498 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
15499 * but with all dynamically-allocated buffers duplicated in new buffers.
15501 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
15504 * Creates a new CResult_NoneSemanticErrorZ in the success state.
15506 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
15509 * Creates a new CResult_NoneSemanticErrorZ in the error state.
15511 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
15514 * Checks if the given object is currently in the success state
15516 bool CResult_NoneSemanticErrorZ_is_ok(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR o);
15519 * Frees any resources used by the CResult_NoneSemanticErrorZ.
15521 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
15524 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
15525 * but with all dynamically-allocated buffers duplicated in new buffers.
15527 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
15530 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
15532 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
15535 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
15537 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
15540 * Checks if the given object is currently in the success state
15542 bool CResult_InvoiceSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR o);
15545 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
15547 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
15550 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
15551 * but with all dynamically-allocated buffers duplicated in new buffers.
15553 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
15556 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
15558 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
15561 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
15563 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
15566 * Checks if the given object is currently in the success state
15568 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
15571 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
15573 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
15576 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
15577 * but with all dynamically-allocated buffers duplicated in new buffers.
15579 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
15582 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
15584 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
15587 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
15589 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
15592 * Checks if the given object is currently in the success state
15594 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
15597 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
15599 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
15602 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
15603 * but with all dynamically-allocated buffers duplicated in new buffers.
15605 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
15608 * Creates a new CResult_StringErrorZ in the success state.
15610 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
15613 * Creates a new CResult_StringErrorZ in the error state.
15615 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
15618 * Checks if the given object is currently in the success state
15620 bool CResult_StringErrorZ_is_ok(const struct LDKCResult_StringErrorZ *NONNULL_PTR o);
15623 * Frees any resources used by the CResult_StringErrorZ.
15625 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
15628 * Creates a new CResult_StringErrorZ which has the same data as `orig`
15629 * but with all dynamically-allocated buffers duplicated in new buffers.
15631 struct LDKCResult_StringErrorZ CResult_StringErrorZ_clone(const struct LDKCResult_StringErrorZ *NONNULL_PTR orig);
15634 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
15636 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
15639 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
15641 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
15644 * Checks if the given object is currently in the success state
15646 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
15649 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
15651 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
15654 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
15655 * but with all dynamically-allocated buffers duplicated in new buffers.
15657 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
15660 * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
15662 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
15665 * Constructs a new COption_MonitorEventZ containing nothing
15667 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
15670 * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
15672 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
15675 * Creates a new COption_MonitorEventZ which has the same data as `orig`
15676 * but with all dynamically-allocated buffers duplicated in new buffers.
15678 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
15681 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
15683 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
15686 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
15688 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
15691 * Checks if the given object is currently in the success state
15693 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
15696 * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
15698 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
15701 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
15702 * but with all dynamically-allocated buffers duplicated in new buffers.
15704 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
15707 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
15709 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
15712 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
15714 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
15717 * Checks if the given object is currently in the success state
15719 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
15722 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
15724 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
15727 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
15728 * but with all dynamically-allocated buffers duplicated in new buffers.
15730 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
15733 * Creates a new tuple which has the same data as `orig`
15734 * but with all dynamically-allocated buffers duplicated in new buffers.
15736 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
15739 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
15741 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
15744 * Frees any resources used by the C2Tuple_OutPointScriptZ.
15746 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
15749 * Creates a new tuple which has the same data as `orig`
15750 * but with all dynamically-allocated buffers duplicated in new buffers.
15752 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
15755 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
15757 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
15760 * Frees any resources used by the C2Tuple_u32ScriptZ.
15762 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
15765 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15767 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
15770 * Creates a new tuple which has the same data as `orig`
15771 * but with all dynamically-allocated buffers duplicated in new buffers.
15773 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig);
15776 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
15778 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
15781 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
15783 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
15786 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15788 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
15791 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15793 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
15796 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15798 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
15801 * Creates a new tuple which has the same data as `orig`
15802 * but with all dynamically-allocated buffers duplicated in new buffers.
15804 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
15807 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
15809 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
15812 * Frees any resources used by the C2Tuple_u32TxOutZ.
15814 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
15817 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15819 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
15822 * Creates a new tuple which has the same data as `orig`
15823 * but with all dynamically-allocated buffers duplicated in new buffers.
15825 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
15828 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
15830 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
15833 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
15835 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
15838 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15840 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
15843 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15845 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
15848 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
15850 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
15853 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
15855 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
15858 * Checks if the given object is currently in the success state
15860 bool CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
15863 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
15865 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
15868 * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
15870 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
15873 * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
15875 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
15878 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15880 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
15883 * Constructs a new COption_NetAddressZ containing a crate::lightning::ln::msgs::NetAddress
15885 struct LDKCOption_NetAddressZ COption_NetAddressZ_some(struct LDKNetAddress o);
15888 * Constructs a new COption_NetAddressZ containing nothing
15890 struct LDKCOption_NetAddressZ COption_NetAddressZ_none(void);
15893 * Frees any resources associated with the crate::lightning::ln::msgs::NetAddress, if we are in the Some state
15895 void COption_NetAddressZ_free(struct LDKCOption_NetAddressZ _res);
15898 * Creates a new COption_NetAddressZ which has the same data as `orig`
15899 * but with all dynamically-allocated buffers duplicated in new buffers.
15901 struct LDKCOption_NetAddressZ COption_NetAddressZ_clone(const struct LDKCOption_NetAddressZ *NONNULL_PTR orig);
15904 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
15906 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
15909 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
15911 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
15914 * Checks if the given object is currently in the success state
15916 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
15919 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
15921 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
15924 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
15925 * but with all dynamically-allocated buffers duplicated in new buffers.
15927 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
15930 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
15932 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
15935 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
15937 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
15940 * Checks if the given object is currently in the success state
15942 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
15945 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
15947 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
15950 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
15951 * but with all dynamically-allocated buffers duplicated in new buffers.
15953 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
15956 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
15958 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
15961 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
15963 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
15966 * Checks if the given object is currently in the success state
15968 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
15971 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
15973 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
15976 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
15977 * but with all dynamically-allocated buffers duplicated in new buffers.
15979 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
15982 * Creates a new CResult_u32GraphSyncErrorZ in the success state.
15984 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
15987 * Creates a new CResult_u32GraphSyncErrorZ in the error state.
15989 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
15992 * Checks if the given object is currently in the success state
15994 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
15997 * Frees any resources used by the CResult_u32GraphSyncErrorZ.
15999 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
16002 * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
16004 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
16007 * Creates a new CResult_NetAddressDecodeErrorZ in the error state.
16009 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
16012 * Checks if the given object is currently in the success state
16014 bool CResult_NetAddressDecodeErrorZ_is_ok(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR o);
16017 * Frees any resources used by the CResult_NetAddressDecodeErrorZ.
16019 void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
16022 * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig`
16023 * but with all dynamically-allocated buffers duplicated in new buffers.
16025 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
16028 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16030 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
16033 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16035 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
16038 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16040 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
16043 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16045 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
16048 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
16050 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
16053 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
16055 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
16058 * Checks if the given object is currently in the success state
16060 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
16063 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
16065 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
16068 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
16069 * but with all dynamically-allocated buffers duplicated in new buffers.
16071 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
16074 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
16076 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
16079 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
16081 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
16084 * Checks if the given object is currently in the success state
16086 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
16089 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
16091 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
16094 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
16095 * but with all dynamically-allocated buffers duplicated in new buffers.
16097 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
16100 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
16102 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
16105 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
16107 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
16110 * Checks if the given object is currently in the success state
16112 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
16115 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
16117 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
16120 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
16121 * but with all dynamically-allocated buffers duplicated in new buffers.
16123 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
16126 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
16128 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
16131 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
16133 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
16136 * Checks if the given object is currently in the success state
16138 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
16141 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
16143 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
16146 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
16147 * but with all dynamically-allocated buffers duplicated in new buffers.
16149 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
16152 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
16154 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
16157 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
16159 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
16162 * Checks if the given object is currently in the success state
16164 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
16167 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
16169 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
16172 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
16173 * but with all dynamically-allocated buffers duplicated in new buffers.
16175 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
16178 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
16180 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
16183 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
16185 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
16188 * Checks if the given object is currently in the success state
16190 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
16193 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
16195 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
16198 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
16199 * but with all dynamically-allocated buffers duplicated in new buffers.
16201 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
16204 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
16206 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
16209 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
16211 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
16214 * Checks if the given object is currently in the success state
16216 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
16219 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
16221 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
16224 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
16225 * but with all dynamically-allocated buffers duplicated in new buffers.
16227 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
16230 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
16232 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
16235 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
16237 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
16240 * Checks if the given object is currently in the success state
16242 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
16245 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
16247 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
16250 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
16251 * but with all dynamically-allocated buffers duplicated in new buffers.
16253 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
16256 * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
16258 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
16261 * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
16263 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
16266 * Checks if the given object is currently in the success state
16268 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
16271 * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
16273 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
16276 * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
16277 * but with all dynamically-allocated buffers duplicated in new buffers.
16279 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
16282 * Creates a new CResult_InitDecodeErrorZ in the success state.
16284 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
16287 * Creates a new CResult_InitDecodeErrorZ in the error state.
16289 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
16292 * Checks if the given object is currently in the success state
16294 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
16297 * Frees any resources used by the CResult_InitDecodeErrorZ.
16299 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
16302 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
16303 * but with all dynamically-allocated buffers duplicated in new buffers.
16305 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
16308 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
16310 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
16313 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
16315 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
16318 * Checks if the given object is currently in the success state
16320 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
16323 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
16325 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
16328 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
16329 * but with all dynamically-allocated buffers duplicated in new buffers.
16331 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
16334 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
16336 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
16339 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
16341 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
16344 * Checks if the given object is currently in the success state
16346 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
16349 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
16351 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
16354 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
16355 * but with all dynamically-allocated buffers duplicated in new buffers.
16357 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
16360 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
16362 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
16365 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
16367 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
16370 * Checks if the given object is currently in the success state
16372 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
16375 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
16377 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
16380 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
16381 * but with all dynamically-allocated buffers duplicated in new buffers.
16383 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
16386 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
16388 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
16391 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
16393 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16396 * Checks if the given object is currently in the success state
16398 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
16401 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
16403 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
16406 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
16407 * but with all dynamically-allocated buffers duplicated in new buffers.
16409 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
16412 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
16414 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
16417 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
16419 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16422 * Checks if the given object is currently in the success state
16424 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
16427 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
16429 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
16432 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
16433 * but with all dynamically-allocated buffers duplicated in new buffers.
16435 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
16438 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
16440 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
16443 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
16445 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
16448 * Checks if the given object is currently in the success state
16450 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
16453 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
16455 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
16458 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
16459 * but with all dynamically-allocated buffers duplicated in new buffers.
16461 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
16464 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
16466 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
16469 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
16471 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16474 * Checks if the given object is currently in the success state
16476 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
16479 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
16481 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
16484 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
16485 * but with all dynamically-allocated buffers duplicated in new buffers.
16487 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
16490 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
16492 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
16495 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
16497 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16500 * Checks if the given object is currently in the success state
16502 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
16505 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
16507 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
16510 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
16511 * but with all dynamically-allocated buffers duplicated in new buffers.
16513 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
16516 * Creates a new CResult_PingDecodeErrorZ in the success state.
16518 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
16521 * Creates a new CResult_PingDecodeErrorZ in the error state.
16523 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
16526 * Checks if the given object is currently in the success state
16528 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
16531 * Frees any resources used by the CResult_PingDecodeErrorZ.
16533 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
16536 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
16537 * but with all dynamically-allocated buffers duplicated in new buffers.
16539 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
16542 * Creates a new CResult_PongDecodeErrorZ in the success state.
16544 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
16547 * Creates a new CResult_PongDecodeErrorZ in the error state.
16549 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
16552 * Checks if the given object is currently in the success state
16554 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
16557 * Frees any resources used by the CResult_PongDecodeErrorZ.
16559 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
16562 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
16563 * but with all dynamically-allocated buffers duplicated in new buffers.
16565 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
16568 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
16570 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
16573 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
16575 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
16578 * Checks if the given object is currently in the success state
16580 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
16583 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
16585 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
16588 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
16589 * but with all dynamically-allocated buffers duplicated in new buffers.
16591 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
16594 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
16596 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
16599 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
16601 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
16604 * Checks if the given object is currently in the success state
16606 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
16609 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
16611 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
16614 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
16615 * but with all dynamically-allocated buffers duplicated in new buffers.
16617 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
16620 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
16622 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
16625 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
16627 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
16630 * Checks if the given object is currently in the success state
16632 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
16635 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
16637 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
16640 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
16641 * but with all dynamically-allocated buffers duplicated in new buffers.
16643 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
16646 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
16648 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
16651 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
16653 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
16656 * Checks if the given object is currently in the success state
16658 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
16661 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
16663 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
16666 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
16667 * but with all dynamically-allocated buffers duplicated in new buffers.
16669 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
16672 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
16674 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
16677 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
16679 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
16682 * Checks if the given object is currently in the success state
16684 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
16687 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
16689 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
16692 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
16693 * but with all dynamically-allocated buffers duplicated in new buffers.
16695 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
16698 * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
16700 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
16703 * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
16705 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
16708 * Checks if the given object is currently in the success state
16710 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
16713 * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
16715 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
16718 * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
16719 * but with all dynamically-allocated buffers duplicated in new buffers.
16721 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
16724 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
16726 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
16729 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
16731 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
16734 * Checks if the given object is currently in the success state
16736 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
16739 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
16741 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
16744 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
16745 * but with all dynamically-allocated buffers duplicated in new buffers.
16747 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
16750 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
16752 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
16755 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
16757 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
16760 * Checks if the given object is currently in the success state
16762 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
16765 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
16767 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
16770 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
16771 * but with all dynamically-allocated buffers duplicated in new buffers.
16773 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
16776 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
16778 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
16781 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
16783 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
16786 * Checks if the given object is currently in the success state
16788 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
16791 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
16793 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
16796 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
16797 * but with all dynamically-allocated buffers duplicated in new buffers.
16799 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
16802 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
16804 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
16807 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
16809 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
16812 * Checks if the given object is currently in the success state
16814 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
16817 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
16819 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
16822 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
16823 * but with all dynamically-allocated buffers duplicated in new buffers.
16825 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
16828 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
16830 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
16833 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
16835 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
16838 * Checks if the given object is currently in the success state
16840 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
16843 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
16845 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
16848 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
16849 * but with all dynamically-allocated buffers duplicated in new buffers.
16851 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
16854 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
16856 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
16859 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
16861 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
16864 * Checks if the given object is currently in the success state
16866 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
16869 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
16871 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
16874 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
16875 * but with all dynamically-allocated buffers duplicated in new buffers.
16877 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
16880 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
16882 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
16885 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
16887 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
16890 * Checks if the given object is currently in the success state
16892 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
16895 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
16897 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
16900 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
16901 * but with all dynamically-allocated buffers duplicated in new buffers.
16903 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
16906 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16908 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
16911 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state.
16913 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o);
16916 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state.
16918 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
16921 * Checks if the given object is currently in the success state
16923 bool CResult_InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
16926 * Frees any resources used by the CResult_InvoiceSignOrCreationErrorZ.
16928 void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res);
16931 * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig`
16932 * but with all dynamically-allocated buffers duplicated in new buffers.
16934 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
16937 * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
16939 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
16942 * Constructs a new COption_FilterZ containing nothing
16944 struct LDKCOption_FilterZ COption_FilterZ_none(void);
16947 * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
16949 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
16952 * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
16954 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
16957 * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
16959 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
16962 * Checks if the given object is currently in the success state
16964 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
16967 * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
16969 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
16972 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16974 void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
16977 * Frees any resources used by the PaymentPurpose
16979 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
16982 * Creates a copy of the PaymentPurpose
16984 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
16987 * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
16989 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret);
16992 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
16994 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
16997 * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
16999 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
17002 * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
17004 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
17007 * Frees any resources used by the ClosureReason
17009 void ClosureReason_free(struct LDKClosureReason this_ptr);
17012 * Creates a copy of the ClosureReason
17014 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
17017 * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
17019 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKStr peer_msg);
17022 * Utility method to constructs a new HolderForceClosed-variant ClosureReason
17024 struct LDKClosureReason ClosureReason_holder_force_closed(void);
17027 * Utility method to constructs a new CooperativeClosure-variant ClosureReason
17029 struct LDKClosureReason ClosureReason_cooperative_closure(void);
17032 * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
17034 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
17037 * Utility method to constructs a new FundingTimedOut-variant ClosureReason
17039 struct LDKClosureReason ClosureReason_funding_timed_out(void);
17042 * Utility method to constructs a new ProcessingError-variant ClosureReason
17044 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
17047 * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
17049 struct LDKClosureReason ClosureReason_disconnected_peer(void);
17052 * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
17054 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
17057 * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
17059 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
17062 * Read a ClosureReason from a byte array, created by ClosureReason_write
17064 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
17067 * Frees any resources used by the Event
17069 void Event_free(struct LDKEvent this_ptr);
17072 * Creates a copy of the Event
17074 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
17077 * Utility method to constructs a new FundingGenerationReady-variant Event
17079 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);
17082 * Utility method to constructs a new PaymentReceived-variant Event
17084 struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose);
17087 * Utility method to constructs a new PaymentClaimed-variant Event
17089 struct LDKEvent Event_payment_claimed(struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose);
17092 * Utility method to constructs a new PaymentSent-variant Event
17094 struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
17097 * Utility method to constructs a new PaymentFailed-variant Event
17099 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
17102 * Utility method to constructs a new PaymentPathSuccessful-variant Event
17104 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
17107 * Utility method to constructs a new PaymentPathFailed-variant Event
17109 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);
17112 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
17114 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
17117 * Utility method to constructs a new SpendableOutputs-variant Event
17119 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs);
17122 * Utility method to constructs a new PaymentForwarded-variant Event
17124 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);
17127 * Utility method to constructs a new ChannelClosed-variant Event
17129 struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, uint64_t user_channel_id, struct LDKClosureReason reason);
17132 * Utility method to constructs a new DiscardFunding-variant Event
17134 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
17137 * Utility method to constructs a new OpenChannelRequest-variant Event
17139 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);
17142 * Serialize the Event object into a byte array which can be read by Event_read
17144 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
17147 * Read a Event from a byte array, created by Event_write
17149 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
17152 * Frees any resources used by the MessageSendEvent
17154 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
17157 * Creates a copy of the MessageSendEvent
17159 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
17162 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
17164 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
17167 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
17169 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
17172 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
17174 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
17177 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
17179 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
17182 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
17184 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
17187 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
17189 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
17192 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
17194 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
17197 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
17199 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
17202 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
17204 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
17207 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
17209 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
17212 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
17214 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
17217 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
17219 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
17222 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
17224 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
17227 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
17229 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
17232 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
17234 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
17237 * Utility method to constructs a new HandleError-variant MessageSendEvent
17239 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
17242 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
17244 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
17247 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
17249 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
17252 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
17254 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
17257 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
17259 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
17262 * Calls the free function if one is set
17264 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
17267 * Calls the free function if one is set
17269 void EventsProvider_free(struct LDKEventsProvider this_ptr);
17272 * Calls the free function if one is set
17274 void EventHandler_free(struct LDKEventHandler this_ptr);
17277 * Frees any resources used by the APIError
17279 void APIError_free(struct LDKAPIError this_ptr);
17282 * Creates a copy of the APIError
17284 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
17287 * Utility method to constructs a new APIMisuseError-variant APIError
17289 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
17292 * Utility method to constructs a new FeeRateTooHigh-variant APIError
17294 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
17297 * Utility method to constructs a new RouteError-variant APIError
17299 struct LDKAPIError APIError_route_error(struct LDKStr err);
17302 * Utility method to constructs a new ChannelUnavailable-variant APIError
17304 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
17307 * Utility method to constructs a new MonitorUpdateFailed-variant APIError
17309 struct LDKAPIError APIError_monitor_update_failed(void);
17312 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
17314 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
17317 * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
17319 void BigSize_free(struct LDKBigSize this_obj);
17321 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
17323 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
17326 * Constructs a new BigSize given each field
17328 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
17331 * Creates a digital signature of a message given a SecretKey, like the node's secret.
17332 * 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.
17333 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
17335 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
17338 * Recovers the PublicKey of the signer of the message given the message and the signature.
17340 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
17343 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
17344 * and the PublicKey.
17346 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
17349 * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
17351 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z data_without_signature);
17354 * Calls the free function if one is set
17356 void Persister_free(struct LDKPersister this_ptr);
17359 * Creates a copy of the Level
17361 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
17364 * Utility method to constructs a new Gossip-variant Level
17366 enum LDKLevel Level_gossip(void);
17369 * Utility method to constructs a new Trace-variant Level
17371 enum LDKLevel Level_trace(void);
17374 * Utility method to constructs a new Debug-variant Level
17376 enum LDKLevel Level_debug(void);
17379 * Utility method to constructs a new Info-variant Level
17381 enum LDKLevel Level_info(void);
17384 * Utility method to constructs a new Warn-variant Level
17386 enum LDKLevel Level_warn(void);
17389 * Utility method to constructs a new Error-variant Level
17391 enum LDKLevel Level_error(void);
17394 * Checks if two Levels contain equal inner contents.
17395 * This ignores pointers and is_owned flags and looks at the values in fields.
17397 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
17400 * Checks if two Levels contain equal inner contents.
17402 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
17405 * Returns the most verbose logging level.
17407 MUST_USE_RES enum LDKLevel Level_max(void);
17410 * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
17412 void Record_free(struct LDKRecord this_obj);
17415 * The verbosity level of the message.
17417 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
17420 * The verbosity level of the message.
17422 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
17425 * The message body.
17427 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
17430 * The message body.
17432 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
17435 * The module path of the message.
17437 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
17440 * The module path of the message.
17442 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
17445 * The source file containing the message.
17447 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
17450 * The source file containing the message.
17452 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
17455 * The line containing the message.
17457 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
17460 * The line containing the message.
17462 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
17465 * Creates a copy of the Record
17467 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
17470 * Calls the free function if one is set
17472 void Logger_free(struct LDKLogger this_ptr);
17475 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
17477 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
17480 * Confirmations we will wait for before considering the channel locked in.
17481 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
17482 * equivalent limit applied to outbound channels).
17484 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
17485 * transaction before operation. If you wish to accept channels with zero confirmations, see
17486 * [`UserConfig::manually_accept_inbound_channels`] and
17487 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
17489 * Default value: 6.
17491 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
17492 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
17494 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17497 * Confirmations we will wait for before considering the channel locked in.
17498 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
17499 * equivalent limit applied to outbound channels).
17501 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
17502 * transaction before operation. If you wish to accept channels with zero confirmations, see
17503 * [`UserConfig::manually_accept_inbound_channels`] and
17504 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
17506 * Default value: 6.
17508 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
17509 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
17511 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
17514 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
17515 * the number of blocks we have to punish our counterparty if they broadcast a revoked
17518 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
17519 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
17520 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
17521 * possibly with time in between to RBF the spending transaction).
17523 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
17524 * case of an honest unilateral channel close, which implicitly decrease the economic value of
17527 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
17528 * can tweak config to ask for more security, not less.
17530 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17533 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
17534 * the number of blocks we have to punish our counterparty if they broadcast a revoked
17537 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
17538 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
17539 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
17540 * possibly with time in between to RBF the spending transaction).
17542 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
17543 * case of an honest unilateral channel close, which implicitly decrease the economic value of
17546 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
17547 * can tweak config to ask for more security, not less.
17549 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
17552 * Set to the smallest value HTLC we will accept to process.
17554 * This value is sent to our counterparty on channel-open and we close the channel any time
17555 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
17557 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
17560 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17563 * Set to the smallest value HTLC we will accept to process.
17565 * This value is sent to our counterparty on channel-open and we close the channel any time
17566 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
17568 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
17571 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
17574 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
17577 * This can be set to a value between 1-100, where the value corresponds to the percent of the
17578 * channel value in whole percentages.
17581 * * If configured to another value than the default value 10, any new channels created with
17582 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
17583 * `ChannelManager`.
17585 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
17586 * no way to configure the cap for the total value of outbound HTLCs in-flight.
17588 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
17589 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
17590 * restrict exposure to loss due to being offline for too long.
17591 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
17592 * for more information.
17594 * Default value: 10.
17595 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
17596 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
17598 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17601 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
17604 * This can be set to a value between 1-100, where the value corresponds to the percent of the
17605 * channel value in whole percentages.
17608 * * If configured to another value than the default value 10, any new channels created with
17609 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
17610 * `ChannelManager`.
17612 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
17613 * no way to configure the cap for the total value of outbound HTLCs in-flight.
17615 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
17616 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
17617 * restrict exposure to loss due to being offline for too long.
17618 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
17619 * for more information.
17621 * Default value: 10.
17622 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
17623 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
17625 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
17628 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
17629 * BOLTs) option for outbound private channels. This provides better privacy by not including
17630 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
17631 * relay HTLCs to us using the channel's SCID alias.
17633 * If this option is set, channels may be created that will not be readable by LDK versions
17634 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
17635 * [`DecodeError:InvalidValue`].
17637 * Note that setting this to true does *not* prevent us from opening channels with
17638 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
17639 * private channel without that option.
17641 * Ignored if the channel is negotiated to be announced, see
17642 * [`ChannelConfig::announced_channel`] and
17643 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
17645 * Default value: false. This value is likely to change to true in the future.
17647 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17648 * [`DecodeError:InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
17650 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17653 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
17654 * BOLTs) option for outbound private channels. This provides better privacy by not including
17655 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
17656 * relay HTLCs to us using the channel's SCID alias.
17658 * If this option is set, channels may be created that will not be readable by LDK versions
17659 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
17660 * [`DecodeError:InvalidValue`].
17662 * Note that setting this to true does *not* prevent us from opening channels with
17663 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
17664 * private channel without that option.
17666 * Ignored if the channel is negotiated to be announced, see
17667 * [`ChannelConfig::announced_channel`] and
17668 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
17670 * Default value: false. This value is likely to change to true in the future.
17672 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17673 * [`DecodeError:InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
17675 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
17678 * Constructs a new ChannelHandshakeConfig given each field
17680 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);
17683 * Creates a copy of the ChannelHandshakeConfig
17685 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
17688 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
17690 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
17693 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
17695 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
17698 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
17699 * only applies to inbound channels.
17701 * Default value: 0.
17703 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17706 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
17707 * only applies to inbound channels.
17709 * Default value: 0.
17711 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17714 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
17715 * only applies to inbound channels.
17717 * Default value: 2^24 - 1.
17719 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17722 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
17723 * only applies to inbound channels.
17725 * Default value: 2^24 - 1.
17727 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17730 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
17731 * you to limit the maximum minimum-size they can require.
17733 * Default value: u64::max_value.
17735 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17738 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
17739 * you to limit the maximum minimum-size they can require.
17741 * Default value: u64::max_value.
17743 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17746 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
17747 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
17749 * Default value: 0.
17751 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17754 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
17755 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
17757 * Default value: 0.
17759 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17762 * The remote node will require we keep a certain amount in direct payment to ourselves at all
17763 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
17764 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
17766 * Default value: u64::max_value.
17768 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17771 * The remote node will require we keep a certain amount in direct payment to ourselves at all
17772 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
17773 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
17775 * Default value: u64::max_value.
17777 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17780 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
17781 * time. This allows you to set a minimum such value.
17783 * Default value: 0.
17785 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17788 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
17789 * time. This allows you to set a minimum such value.
17791 * Default value: 0.
17793 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
17796 * Before a channel is usable the funding transaction will need to be confirmed by at least a
17797 * certain number of blocks, specified by the node which is not the funder (as the funder can
17798 * assume they aren't going to double-spend themselves).
17799 * This config allows you to set a limit on the maximum amount of time to wait.
17801 * Default value: 144, or roughly one day and only applies to outbound channels.
17803 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17806 * Before a channel is usable the funding transaction will need to be confirmed by at least a
17807 * certain number of blocks, specified by the node which is not the funder (as the funder can
17808 * assume they aren't going to double-spend themselves).
17809 * This config allows you to set a limit on the maximum amount of time to wait.
17811 * Default value: 144, or roughly one day and only applies to outbound channels.
17813 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
17816 * Whether we implicitly trust funding transactions generated by us for our own outbound
17817 * channels to not be double-spent.
17819 * If this is set, we assume that our own funding transactions are *never* double-spent, and
17820 * thus we can trust them without any confirmations. This is generally a reasonable
17821 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
17822 * control of the signing keys).
17824 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
17825 * double-spend the funding transaction to RBF with an alternative channel open.
17827 * This only applies if our counterparty set their confirmations-required value to 0, and we
17828 * always trust our own funding transaction at 1 confirmation irrespective of this value.
17829 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
17830 * `true` (0) and `false` (1).
17832 * Default value: true
17834 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17837 * Whether we implicitly trust funding transactions generated by us for our own outbound
17838 * channels to not be double-spent.
17840 * If this is set, we assume that our own funding transactions are *never* double-spent, and
17841 * thus we can trust them without any confirmations. This is generally a reasonable
17842 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
17843 * control of the signing keys).
17845 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
17846 * double-spend the funding transaction to RBF with an alternative channel open.
17848 * This only applies if our counterparty set their confirmations-required value to 0, and we
17849 * always trust our own funding transaction at 1 confirmation irrespective of this value.
17850 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
17851 * `true` (0) and `false` (1).
17853 * Default value: true
17855 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
17858 * Set to force an incoming channel to match our announced channel preference in
17859 * [`ChannelConfig::announced_channel`].
17861 * For a node which is not online reliably, this should be set to true and
17862 * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
17863 * channels will ever be opened.
17865 * Default value: true.
17867 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17870 * Set to force an incoming channel to match our announced channel preference in
17871 * [`ChannelConfig::announced_channel`].
17873 * For a node which is not online reliably, this should be set to true and
17874 * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
17875 * channels will ever be opened.
17877 * Default value: true.
17879 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
17882 * Set to the amount of time we're willing to wait to claim money back to us.
17884 * Not checking this value would be a security issue, as our peer would be able to set it to
17885 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
17887 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
17888 * reduce the loss of having useless locked funds (if your peer accepts)
17890 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17893 * Set to the amount of time we're willing to wait to claim money back to us.
17895 * Not checking this value would be a security issue, as our peer would be able to set it to
17896 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
17898 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
17899 * reduce the loss of having useless locked funds (if your peer accepts)
17901 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
17904 * Constructs a new ChannelHandshakeLimits given each field
17906 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);
17909 * Creates a copy of the ChannelHandshakeLimits
17911 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
17914 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
17916 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
17919 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
17921 void ChannelConfig_free(struct LDKChannelConfig this_obj);
17924 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
17925 * over the channel.
17926 * This may be allowed to change at runtime in a later update, however doing so must result in
17927 * update messages sent to notify all nodes of our updated relay fee.
17929 * Default value: 0.
17931 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17934 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
17935 * over the channel.
17936 * This may be allowed to change at runtime in a later update, however doing so must result in
17937 * update messages sent to notify all nodes of our updated relay fee.
17939 * Default value: 0.
17941 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
17944 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
17945 * excess of [`forwarding_fee_proportional_millionths`].
17946 * This may be allowed to change at runtime in a later update, however doing so must result in
17947 * update messages sent to notify all nodes of our updated relay fee.
17949 * The default value of a single satoshi roughly matches the market rate on many routing nodes
17950 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
17953 * Default value: 1000.
17955 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
17957 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17960 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
17961 * excess of [`forwarding_fee_proportional_millionths`].
17962 * This may be allowed to change at runtime in a later update, however doing so must result in
17963 * update messages sent to notify all nodes of our updated relay fee.
17965 * The default value of a single satoshi roughly matches the market rate on many routing nodes
17966 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
17969 * Default value: 1000.
17971 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
17973 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
17976 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
17977 * the channel this config applies to.
17979 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
17980 * HTLC balance when a channel appears on-chain whereas
17981 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
17982 * (non-HTLC-encumbered) balance.
17984 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
17985 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
17986 * commitment transaction at least once per this many blocks (minus some margin to allow us
17987 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
17988 * the spending transaction).
17990 * Default value: 72 (12 hours at an average of 6 blocks/hour).
17991 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
17992 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
17994 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
17996 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17999 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
18000 * the channel this config applies to.
18002 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
18003 * HTLC balance when a channel appears on-chain whereas
18004 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
18005 * (non-HTLC-encumbered) balance.
18007 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
18008 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
18009 * commitment transaction at least once per this many blocks (minus some margin to allow us
18010 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
18011 * the spending transaction).
18013 * Default value: 72 (12 hours at an average of 6 blocks/hour).
18014 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
18015 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
18017 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
18019 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
18022 * Set to announce the channel publicly and notify all nodes that they can route via this
18025 * This should only be set to true for nodes which expect to be online reliably.
18027 * As the node which funds a channel picks this value this will only apply for new outbound
18028 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
18030 * This cannot be changed after the initial channel handshake.
18032 * Default value: false.
18034 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18037 * Set to announce the channel publicly and notify all nodes that they can route via this
18040 * This should only be set to true for nodes which expect to be online reliably.
18042 * As the node which funds a channel picks this value this will only apply for new outbound
18043 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
18045 * This cannot be changed after the initial channel handshake.
18047 * Default value: false.
18049 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
18052 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
18053 * supports it, they will then enforce the mutual-close output to us matches what we provided
18054 * at intialization, preventing us from closing to an alternate pubkey.
18056 * This is set to true by default to provide a slight increase in security, though ultimately
18057 * any attacker who is able to take control of a channel can just as easily send the funds via
18058 * lightning payments, so we never require that our counterparties support this option.
18060 * This cannot be changed after a channel has been initialized.
18062 * Default value: true.
18064 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18067 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
18068 * supports it, they will then enforce the mutual-close output to us matches what we provided
18069 * at intialization, preventing us from closing to an alternate pubkey.
18071 * This is set to true by default to provide a slight increase in security, though ultimately
18072 * any attacker who is able to take control of a channel can just as easily send the funds via
18073 * lightning payments, so we never require that our counterparties support this option.
18075 * This cannot be changed after a channel has been initialized.
18077 * Default value: true.
18079 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
18082 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
18083 * small to claim on-chain.
18085 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
18086 * not be claimable on-chain, instead being turned into additional miner fees if either
18087 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
18088 * to such payments may be sustantial if there are many dust HTLCs present when the
18089 * channel is force-closed.
18091 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
18092 * exposure across all three types per-channel. Setting this too low may prevent the
18093 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
18094 * important to prevent stealing of dust HTLCs by miners.
18096 * Default value: 5_000_000 msat.
18098 uint64_t ChannelConfig_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18101 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
18102 * small to claim on-chain.
18104 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
18105 * not be claimable on-chain, instead being turned into additional miner fees if either
18106 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
18107 * to such payments may be sustantial if there are many dust HTLCs present when the
18108 * channel is force-closed.
18110 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
18111 * exposure across all three types per-channel. Setting this too low may prevent the
18112 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
18113 * important to prevent stealing of dust HTLCs by miners.
18115 * Default value: 5_000_000 msat.
18117 void ChannelConfig_set_max_dust_htlc_exposure_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
18120 * The additional fee we're willing to pay to avoid waiting for the counterparty's
18121 * `to_self_delay` to reclaim funds.
18123 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
18124 * closing transaction which both sides find acceptable, ultimately paid by the channel
18125 * funder/initiator.
18127 * When we are the funder, because we have to pay the channel closing fee, we bound the
18128 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
18129 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
18130 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
18131 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
18134 * When we are not the funder, we require the closing transaction fee pay at least our
18135 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
18136 * Thus, this value is ignored when we are not the funder.
18138 * Default value: 1000 satoshis.
18140 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
18141 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
18143 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18146 * The additional fee we're willing to pay to avoid waiting for the counterparty's
18147 * `to_self_delay` to reclaim funds.
18149 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
18150 * closing transaction which both sides find acceptable, ultimately paid by the channel
18151 * funder/initiator.
18153 * When we are the funder, because we have to pay the channel closing fee, we bound the
18154 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
18155 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
18156 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
18157 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
18160 * When we are not the funder, we require the closing transaction fee pay at least our
18161 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
18162 * Thus, this value is ignored when we are not the funder.
18164 * Default value: 1000 satoshis.
18166 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
18167 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
18169 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
18172 * Constructs a new ChannelConfig given each field
18174 MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t forwarding_fee_proportional_millionths_arg, uint32_t forwarding_fee_base_msat_arg, uint16_t cltv_expiry_delta_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg, uint64_t max_dust_htlc_exposure_msat_arg, uint64_t force_close_avoidance_max_fee_satoshis_arg);
18177 * Creates a copy of the ChannelConfig
18179 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
18182 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
18184 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
18187 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
18189 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
18192 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
18194 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
18197 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
18199 void UserConfig_free(struct LDKUserConfig this_obj);
18202 * Channel config that we propose to our counterparty.
18204 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18207 * Channel config that we propose to our counterparty.
18209 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
18212 * Limits applied to our counterparty's proposed channel config settings.
18214 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18217 * Limits applied to our counterparty's proposed channel config settings.
18219 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
18222 * Channel config which affects behavior during channel lifetime.
18224 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18227 * Channel config which affects behavior during channel lifetime.
18229 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
18232 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
18233 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
18234 * node which is not online reliably.
18236 * For nodes which are not online reliably, you should set all channels to *not* be announced
18237 * (using [`ChannelConfig::announced_channel`] and
18238 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
18239 * ensure you are not exposed to any forwarding risk.
18241 * Note that because you cannot change a channel's announced state after creation, there is no
18242 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
18243 * from a publicly-announced forwarding node to a private non-forwarding node you must close
18244 * all your channels and open new ones. For privacy, you should also change your node_id
18245 * (swapping all private and public key material for new ones) at that time.
18247 * Default value: false.
18249 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18252 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
18253 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
18254 * node which is not online reliably.
18256 * For nodes which are not online reliably, you should set all channels to *not* be announced
18257 * (using [`ChannelConfig::announced_channel`] and
18258 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
18259 * ensure you are not exposed to any forwarding risk.
18261 * Note that because you cannot change a channel's announced state after creation, there is no
18262 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
18263 * from a publicly-announced forwarding node to a private non-forwarding node you must close
18264 * all your channels and open new ones. For privacy, you should also change your node_id
18265 * (swapping all private and public key material for new ones) at that time.
18267 * Default value: false.
18269 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
18272 * If this is set to false, we do not accept inbound requests to open a new channel.
18273 * Default value: true.
18275 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18278 * If this is set to false, we do not accept inbound requests to open a new channel.
18279 * Default value: true.
18281 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
18284 * If this is set to true, the user needs to manually accept inbound requests to open a new
18287 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
18288 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
18289 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
18290 * user explicitly chooses to accept the request.
18292 * Default value: false.
18294 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
18295 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
18296 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
18298 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18301 * If this is set to true, the user needs to manually accept inbound requests to open a new
18304 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
18305 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
18306 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
18307 * user explicitly chooses to accept the request.
18309 * Default value: false.
18311 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
18312 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
18313 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
18315 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
18318 * Constructs a new UserConfig given each field
18320 MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig own_channel_config_arg, struct LDKChannelHandshakeLimits peer_channel_config_limits_arg, struct LDKChannelConfig channel_options_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg, bool manually_accept_inbound_channels_arg);
18323 * Creates a copy of the UserConfig
18325 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
18328 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
18330 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
18333 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
18335 void BestBlock_free(struct LDKBestBlock this_obj);
18338 * Creates a copy of the BestBlock
18340 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
18343 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
18346 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
18349 * Returns a `BestBlock` as identified by the given block hash and height.
18351 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
18354 * Returns the best block hash.
18356 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
18359 * Returns the best block height.
18361 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
18364 * Creates a copy of the AccessError
18366 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
18369 * Utility method to constructs a new UnknownChain-variant AccessError
18371 enum LDKAccessError AccessError_unknown_chain(void);
18374 * Utility method to constructs a new UnknownTx-variant AccessError
18376 enum LDKAccessError AccessError_unknown_tx(void);
18379 * Calls the free function if one is set
18381 void Access_free(struct LDKAccess this_ptr);
18384 * Calls the free function if one is set
18386 void Listen_free(struct LDKListen this_ptr);
18389 * Calls the free function if one is set
18391 void Confirm_free(struct LDKConfirm this_ptr);
18394 * Creates a copy of the ChannelMonitorUpdateErr
18396 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
18399 * Utility method to constructs a new TemporaryFailure-variant ChannelMonitorUpdateErr
18401 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_temporary_failure(void);
18404 * Utility method to constructs a new PermanentFailure-variant ChannelMonitorUpdateErr
18406 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_permanent_failure(void);
18409 * Calls the free function if one is set
18411 void Watch_free(struct LDKWatch this_ptr);
18414 * Calls the free function if one is set
18416 void Filter_free(struct LDKFilter this_ptr);
18419 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
18421 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
18424 * First block where the transaction output may have been spent.
18426 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18428 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
18431 * First block where the transaction output may have been spent.
18433 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
18435 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18438 * Outpoint identifying the transaction output.
18440 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
18443 * Outpoint identifying the transaction output.
18445 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
18448 * Spending condition of the transaction output.
18450 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
18453 * Spending condition of the transaction output.
18455 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
18458 * Constructs a new WatchedOutput given each field
18460 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
18463 * Creates a copy of the WatchedOutput
18465 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
18468 * Checks if two WatchedOutputs contain equal inner contents.
18470 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
18473 * Calls the free function if one is set
18475 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
18478 * Creates a copy of the ConfirmationTarget
18480 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
18483 * Utility method to constructs a new Background-variant ConfirmationTarget
18485 enum LDKConfirmationTarget ConfirmationTarget_background(void);
18488 * Utility method to constructs a new Normal-variant ConfirmationTarget
18490 enum LDKConfirmationTarget ConfirmationTarget_normal(void);
18493 * Utility method to constructs a new HighPriority-variant ConfirmationTarget
18495 enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
18498 * Checks if two ConfirmationTargets contain equal inner contents.
18499 * This ignores pointers and is_owned flags and looks at the values in fields.
18501 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
18504 * Calls the free function if one is set
18506 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
18509 * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
18511 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
18514 * Creates a copy of the MonitorUpdateId
18516 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
18519 * Checks if two MonitorUpdateIds contain equal inner contents.
18521 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
18524 * Checks if two MonitorUpdateIds contain equal inner contents.
18525 * This ignores pointers and is_owned flags and looks at the values in fields.
18526 * Two objects with NULL inner values will be considered "equal" here.
18528 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
18531 * Calls the free function if one is set
18533 void Persist_free(struct LDKPersist this_ptr);
18536 * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
18538 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
18541 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
18543 void ChainMonitor_free(struct LDKChainMonitor this_obj);
18546 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
18548 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
18549 * will call back to it indicating transactions and outputs of interest. This allows clients to
18550 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
18551 * always need to fetch full blocks absent another means for determining which blocks contain
18552 * transactions relevant to the watched channels.
18554 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
18557 * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
18558 * claims which are awaiting confirmation.
18560 * Includes the balances from each [`ChannelMonitor`] *except* those included in
18561 * `ignored_channels`, allowing you to filter out balances from channels which are still open
18562 * (and whose balance should likely be pulled from the [`ChannelDetails`]).
18564 * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
18565 * inclusion in the return value.
18567 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
18570 * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
18571 * such [`ChannelMonitor`] is currently being monitored for.
18573 * Note that the result holds a mutex over our monitor set, and should not be held
18576 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
18579 * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
18581 * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
18582 * monitoring for on-chain state resolutions.
18584 MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
18587 * Indicates the persistence of a [`ChannelMonitor`] has completed after
18588 * [`ChannelMonitorUpdateErr::TemporaryFailure`] was returned from an update operation.
18590 * Thus, the anticipated use is, at a high level:
18591 * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
18592 * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
18593 * returning [`ChannelMonitorUpdateErr::TemporaryFailure`],
18594 * 2) once all remote copies are updated, you call this function with the
18595 * `completed_update_id` that completed, and once all pending updates have completed the
18596 * channel will be re-enabled.
18598 * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
18599 * registered [`ChannelMonitor`]s.
18601 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);
18604 * Constructs a new Listen which calls the relevant methods on this_arg.
18605 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
18607 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
18610 * Constructs a new Confirm which calls the relevant methods on this_arg.
18611 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
18613 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
18616 * Constructs a new Watch which calls the relevant methods on this_arg.
18617 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
18619 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
18622 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
18623 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
18625 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
18628 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
18630 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
18633 * The sequence number of this update. Updates *must* be replayed in-order according to this
18634 * sequence number (and updates may panic if they are not). The update_id values are strictly
18635 * increasing and increase by one for each new update, with one exception specified below.
18637 * This sequence number is also used to track up to which points updates which returned
18638 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
18639 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
18641 * The only instance where update_id values are not strictly increasing is the case where we
18642 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
18643 * its docs for more details.
18645 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
18648 * The sequence number of this update. Updates *must* be replayed in-order according to this
18649 * sequence number (and updates may panic if they are not). The update_id values are strictly
18650 * increasing and increase by one for each new update, with one exception specified below.
18652 * This sequence number is also used to track up to which points updates which returned
18653 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
18654 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
18656 * The only instance where update_id values are not strictly increasing is the case where we
18657 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
18658 * its docs for more details.
18660 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
18663 * Creates a copy of the ChannelMonitorUpdate
18665 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
18668 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
18670 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
18673 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
18675 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
18678 * Frees any resources used by the MonitorEvent
18680 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
18683 * Creates a copy of the MonitorEvent
18685 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
18688 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
18690 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
18693 * Utility method to constructs a new CommitmentTxConfirmed-variant MonitorEvent
18695 struct LDKMonitorEvent MonitorEvent_commitment_tx_confirmed(struct LDKOutPoint a);
18698 * Utility method to constructs a new UpdateCompleted-variant MonitorEvent
18700 struct LDKMonitorEvent MonitorEvent_update_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
18703 * Utility method to constructs a new UpdateFailed-variant MonitorEvent
18705 struct LDKMonitorEvent MonitorEvent_update_failed(struct LDKOutPoint a);
18708 * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
18710 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
18713 * Read a MonitorEvent from a byte array, created by MonitorEvent_write
18715 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
18718 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
18720 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
18723 * Creates a copy of the HTLCUpdate
18725 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
18728 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
18730 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
18733 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
18735 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
18738 * Frees any resources used by the Balance
18740 void Balance_free(struct LDKBalance this_ptr);
18743 * Creates a copy of the Balance
18745 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
18748 * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
18750 struct LDKBalance Balance_claimable_on_channel_close(uint64_t claimable_amount_satoshis);
18753 * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
18755 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t claimable_amount_satoshis, uint32_t confirmation_height);
18758 * Utility method to constructs a new ContentiousClaimable-variant Balance
18760 struct LDKBalance Balance_contentious_claimable(uint64_t claimable_amount_satoshis, uint32_t timeout_height);
18763 * Utility method to constructs a new MaybeClaimableHTLCAwaitingTimeout-variant Balance
18765 struct LDKBalance Balance_maybe_claimable_htlcawaiting_timeout(uint64_t claimable_amount_satoshis, uint32_t claimable_height);
18768 * Checks if two Balances contain equal inner contents.
18769 * This ignores pointers and is_owned flags and looks at the values in fields.
18771 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
18774 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
18776 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
18779 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
18781 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
18784 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
18787 * panics if the given update is not the next update by update_id.
18789 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelMonitor_update_monitor(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR updates, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
18792 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
18795 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18798 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
18800 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18803 * Gets a list of txids, with their output scripts (in the order they appear in the
18804 * transaction), which we must learn about spends of via block_connected().
18806 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18809 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
18810 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
18811 * have been registered.
18813 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
18816 * Get the list of HTLCs who's status has been updated on chain. This should be called by
18817 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
18819 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18822 * Gets the list of pending events which were generated by previous actions, clearing the list
18825 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
18826 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
18827 * no internal locking in ChannelMonitors.
18829 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18832 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
18833 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
18834 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
18835 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
18836 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
18837 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
18838 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
18839 * out-of-band the other node operator to coordinate with him if option is available to you.
18840 * In any-case, choice is up to the user.
18842 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);
18845 * Processes transactions in a newly connected block, which may result in any of the following:
18846 * - update the monitor's state against resolved HTLCs
18847 * - punish the counterparty in the case of seeing a revoked commitment transaction
18848 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
18849 * - detect settled outputs for later spending
18850 * - schedule and bump any in-flight claims
18852 * Returns any new outputs to watch from `txdata`; after called, these are also included in
18853 * [`get_outputs_to_watch`].
18855 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
18857 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);
18860 * Determines if the disconnected block contained any transactions of interest and updates
18863 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);
18866 * Processes transactions confirmed in a block with the given header and height, returning new
18867 * outputs to watch. See [`block_connected`] for details.
18869 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
18870 * blocks. See [`chain::Confirm`] for calling expectations.
18872 * [`block_connected`]: Self::block_connected
18874 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);
18877 * Processes a transaction that was reorganized out of the chain.
18879 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
18880 * than blocks. See [`chain::Confirm`] for calling expectations.
18882 * [`block_disconnected`]: Self::block_disconnected
18884 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);
18887 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
18888 * [`block_connected`] for details.
18890 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
18891 * blocks. See [`chain::Confirm`] for calling expectations.
18893 * [`block_connected`]: Self::block_connected
18895 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);
18898 * Returns the set of txids that should be monitored for re-organization out of the chain.
18900 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18903 * Gets the latest best block which was connected either via the [`chain::Listen`] or
18904 * [`chain::Confirm`] interfaces.
18906 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18909 * Gets the balances in this channel which are either claimable by us if we were to
18910 * force-close the channel now or which are claimable on-chain (possibly awaiting
18913 * Any balances in the channel which are available on-chain (excluding on-chain fees) are
18914 * included here until an [`Event::SpendableOutputs`] event has been generated for the
18915 * balance, or until our counterparty has claimed the balance and accrued several
18916 * confirmations on the claim transaction.
18918 * Note that the balances available when you or your counterparty have broadcasted revoked
18919 * state(s) may not be fully captured here.
18921 * See [`Balance`] for additional details on the types of claimable balances which
18922 * may be returned here and their meanings.
18924 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18927 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
18929 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
18932 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
18934 void OutPoint_free(struct LDKOutPoint this_obj);
18937 * The referenced transaction's txid.
18939 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
18942 * The referenced transaction's txid.
18944 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18947 * The index of the referenced output in its transaction's vout.
18949 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
18952 * The index of the referenced output in its transaction's vout.
18954 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
18957 * Constructs a new OutPoint given each field
18959 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
18962 * Creates a copy of the OutPoint
18964 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
18967 * Checks if two OutPoints contain equal inner contents.
18968 * This ignores pointers and is_owned flags and looks at the values in fields.
18969 * Two objects with NULL inner values will be considered "equal" here.
18971 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
18974 * Checks if two OutPoints contain equal inner contents.
18976 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
18979 * Convert an `OutPoint` to a lightning channel id.
18981 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
18984 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
18986 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
18989 * Read a OutPoint from a byte array, created by OutPoint_write
18991 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
18994 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
18996 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
18999 * The outpoint which is spendable
19001 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19004 * The outpoint which is spendable
19006 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
19009 * Per commitment point to derive delayed_payment_key by key holder
19011 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19014 * Per commitment point to derive delayed_payment_key by key holder
19016 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19019 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
19020 * the witness_script.
19022 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19025 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
19026 * the witness_script.
19028 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
19031 * The output which is referenced by the given outpoint
19033 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
19036 * The revocation point specific to the commitment transaction which was broadcast. Used to
19037 * derive the witnessScript for this output.
19039 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19042 * The revocation point specific to the commitment transaction which was broadcast. Used to
19043 * derive the witnessScript for this output.
19045 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19048 * Arbitrary identification information returned by a call to
19049 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
19050 * the channel to spend the output.
19052 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
19055 * Arbitrary identification information returned by a call to
19056 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
19057 * the channel to spend the output.
19059 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19062 * The value of the channel which this output originated from, possibly indirectly.
19064 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19067 * The value of the channel which this output originated from, possibly indirectly.
19069 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
19072 * Constructs a new DelayedPaymentOutputDescriptor given each field
19074 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);
19077 * Creates a copy of the DelayedPaymentOutputDescriptor
19079 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
19082 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
19084 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
19087 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
19089 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
19092 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
19094 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
19097 * The outpoint which is spendable
19099 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19102 * The outpoint which is spendable
19104 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
19107 * The output which is referenced by the given outpoint
19109 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
19112 * Arbitrary identification information returned by a call to
19113 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
19114 * the channel to spend the output.
19116 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
19119 * Arbitrary identification information returned by a call to
19120 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
19121 * the channel to spend the output.
19123 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19126 * The value of the channel which this transactions spends.
19128 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19131 * The value of the channel which this transactions spends.
19133 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
19136 * Constructs a new StaticPaymentOutputDescriptor given each field
19138 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);
19141 * Creates a copy of the StaticPaymentOutputDescriptor
19143 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
19146 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
19148 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
19151 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
19153 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
19156 * Frees any resources used by the SpendableOutputDescriptor
19158 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
19161 * Creates a copy of the SpendableOutputDescriptor
19163 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
19166 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
19168 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
19171 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
19173 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
19176 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
19178 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
19181 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
19183 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
19186 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
19188 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
19191 * Calls the free function if one is set
19193 void BaseSign_free(struct LDKBaseSign this_ptr);
19196 * Creates a copy of a Sign
19198 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
19201 * Calls the free function if one is set
19203 void Sign_free(struct LDKSign this_ptr);
19206 * Creates a copy of the Recipient
19208 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
19211 * Utility method to constructs a new Node-variant Recipient
19213 enum LDKRecipient Recipient_node(void);
19216 * Utility method to constructs a new PhantomNode-variant Recipient
19218 enum LDKRecipient Recipient_phantom_node(void);
19221 * Calls the free function if one is set
19223 void KeysInterface_free(struct LDKKeysInterface this_ptr);
19226 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
19228 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
19231 * Private key of anchor tx
19233 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19236 * Private key of anchor tx
19238 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19241 * Holder secret key for blinded revocation pubkey
19243 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19246 * Holder secret key for blinded revocation pubkey
19248 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19251 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
19253 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19256 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
19258 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19261 * Holder secret key used in HTLC tx
19263 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19266 * Holder secret key used in HTLC tx
19268 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19271 * Holder htlc secret key used in commitment tx htlc outputs
19273 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19276 * Holder htlc secret key used in commitment tx htlc outputs
19278 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19283 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19288 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19291 * Creates a copy of the InMemorySigner
19293 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
19296 * Create a new InMemorySigner
19298 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);
19301 * Counterparty pubkeys.
19302 * Will panic if ready_channel wasn't called.
19304 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19307 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
19308 * transactions, ie the amount of time that we have to wait to recover our funds if we
19309 * broadcast a transaction.
19310 * Will panic if ready_channel wasn't called.
19312 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19315 * The contest_delay value specified by us and applied on transactions broadcastable
19316 * by our counterparty, ie the amount of time that they have to wait to recover their funds
19317 * if they broadcast a transaction.
19318 * Will panic if ready_channel wasn't called.
19320 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19323 * Whether the holder is the initiator
19324 * Will panic if ready_channel wasn't called.
19326 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19330 * Will panic if ready_channel wasn't called.
19332 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19335 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
19336 * building transactions.
19338 * Will panic if ready_channel wasn't called.
19340 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19343 * Whether anchors should be used.
19344 * Will panic if ready_channel wasn't called.
19346 MUST_USE_RES bool InMemorySigner_opt_anchors(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19349 * Sign the single input of spend_tx at index `input_idx` which spends the output
19350 * described by descriptor, returning the witness stack for the input.
19352 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
19353 * is not spending the outpoint described by `descriptor.outpoint`,
19354 * or if an output descriptor script_pubkey does not match the one we can spend.
19356 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);
19359 * Sign the single input of spend_tx at index `input_idx` which spends the output
19360 * described by descriptor, returning the witness stack for the input.
19362 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
19363 * is not spending the outpoint described by `descriptor.outpoint`, does not have a
19364 * sequence set to `descriptor.to_self_delay`, or if an output descriptor
19365 * script_pubkey does not match the one we can spend.
19367 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);
19370 * Constructs a new BaseSign which calls the relevant methods on this_arg.
19371 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
19373 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19376 * Constructs a new Sign which calls the relevant methods on this_arg.
19377 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
19379 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19382 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
19384 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
19387 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
19389 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKSecretKey arg);
19392 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
19394 void KeysManager_free(struct LDKKeysManager this_obj);
19397 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
19398 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
19399 * starting_time isn't strictly required to actually be a time, but it must absolutely,
19400 * without a doubt, be unique to this instance. ie if you start multiple times with the same
19401 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
19402 * simply use the current time (with very high precision).
19404 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
19405 * obviously, starting_time should be unique every time you reload the library - it is only
19406 * used to generate new ephemeral key data (which will be stored by the individual channel if
19409 * Note that the seed is required to recover certain on-chain funds independent of
19410 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
19411 * channel, and some on-chain during-closing funds.
19413 * Note that until the 0.1 release there is no guarantee of backward compatibility between
19414 * versions. Once the library is more fully supported, the docs will be updated to include a
19415 * detailed description of the guarantee.
19417 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
19420 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
19422 * Key derivation parameters are accessible through a per-channel secrets
19423 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
19424 * onchain output detection for which a corresponding delayed_payment_key must be derived.
19426 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]);
19429 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
19430 * output to the given change destination (if sufficient change value remains). The
19431 * transaction will have a feerate, at least, of the given value.
19433 * Returns `Err(())` if the output value is greater than the input value minus required fee,
19434 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
19435 * does not match the one we can spend.
19437 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
19439 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
19440 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
19442 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);
19445 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
19446 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
19448 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
19451 * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
19453 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
19456 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
19457 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
19459 struct LDKKeysInterface PhantomKeysManager_as_KeysInterface(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
19462 * Constructs a `PhantomKeysManager` given a 32-byte seed and an additional `cross_node_seed`
19463 * that is shared across all nodes that intend to participate in [phantom node payments] together.
19465 * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
19466 * `starting_time_nanos`.
19468 * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
19469 * same across restarts, or else inbound payments may fail.
19471 * [phantom node payments]: PhantomKeysManager
19473 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]);
19476 * See [`KeysManager::spend_spendable_outputs`] for documentation on this method.
19478 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);
19481 * See [`KeysManager::derive_channel_keys`] for documentation on this method.
19483 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]);
19486 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
19488 void ChannelManager_free(struct LDKChannelManager this_obj);
19491 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
19493 void ChainParameters_free(struct LDKChainParameters this_obj);
19496 * The network for determining the `chain_hash` in Lightning messages.
19498 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
19501 * The network for determining the `chain_hash` in Lightning messages.
19503 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
19506 * The hash and height of the latest block successfully connected.
19508 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
19510 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
19513 * The hash and height of the latest block successfully connected.
19515 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
19517 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
19520 * Constructs a new ChainParameters given each field
19522 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
19525 * Creates a copy of the ChainParameters
19527 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
19530 * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
19532 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
19535 * Base routing fee in millisatoshis.
19537 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
19540 * Base routing fee in millisatoshis.
19542 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
19545 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
19547 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
19550 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
19552 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
19555 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
19556 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
19557 * `cltv_expiry_delta` for more details.
19559 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
19562 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
19563 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
19564 * `cltv_expiry_delta` for more details.
19566 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
19569 * Constructs a new CounterpartyForwardingInfo given each field
19571 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);
19574 * Creates a copy of the CounterpartyForwardingInfo
19576 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
19579 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
19581 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
19584 * The node_id of our counterparty
19586 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19589 * The node_id of our counterparty
19591 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19594 * The Features the channel counterparty provided upon last connection.
19595 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
19596 * many routing-relevant features are present in the init context.
19598 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19601 * The Features the channel counterparty provided upon last connection.
19602 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
19603 * many routing-relevant features are present in the init context.
19605 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
19608 * The value, in satoshis, that must always be held in the channel for our counterparty. This
19609 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
19610 * claiming at least this value on chain.
19612 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
19614 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
19616 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19619 * The value, in satoshis, that must always be held in the channel for our counterparty. This
19620 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
19621 * claiming at least this value on chain.
19623 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
19625 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
19627 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
19630 * Information on the fees and requirements that the counterparty requires when forwarding
19631 * payments to us through this channel.
19633 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19635 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19638 * Information on the fees and requirements that the counterparty requires when forwarding
19639 * payments to us through this channel.
19641 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
19643 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
19646 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
19647 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
19648 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
19650 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19653 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
19654 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
19655 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
19657 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
19660 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
19662 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19665 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
19667 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
19670 * Constructs a new ChannelCounterparty given each field
19672 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);
19675 * Creates a copy of the ChannelCounterparty
19677 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
19680 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
19682 void ChannelDetails_free(struct LDKChannelDetails this_obj);
19685 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
19686 * thereafter this is the txid of the funding transaction xor the funding transaction output).
19687 * Note that this means this value is *not* persistent - it can change once during the
19688 * lifetime of the channel.
19690 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
19693 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
19694 * thereafter this is the txid of the funding transaction xor the funding transaction output).
19695 * Note that this means this value is *not* persistent - it can change once during the
19696 * lifetime of the channel.
19698 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19701 * Parameters which apply to our counterparty. See individual fields for more information.
19703 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19706 * Parameters which apply to our counterparty. See individual fields for more information.
19708 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
19711 * The Channel's funding transaction output, if we've negotiated the funding transaction with
19712 * our counterparty already.
19714 * Note that, if this has been set, `channel_id` will be equivalent to
19715 * `funding_txo.unwrap().to_channel_id()`.
19717 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19719 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19722 * The Channel's funding transaction output, if we've negotiated the funding transaction with
19723 * our counterparty already.
19725 * Note that, if this has been set, `channel_id` will be equivalent to
19726 * `funding_txo.unwrap().to_channel_id()`.
19728 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
19730 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
19733 * The features which this channel operates with. See individual features for more info.
19735 * `None` until negotiation completes and the channel type is finalized.
19737 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19739 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19742 * The features which this channel operates with. See individual features for more info.
19744 * `None` until negotiation completes and the channel type is finalized.
19746 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
19748 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
19751 * The position of the funding transaction in the chain. None if the funding transaction has
19752 * not yet been confirmed and the channel fully opened.
19754 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
19755 * payments instead of this. See [`get_inbound_payment_scid`].
19757 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
19758 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
19760 * [`inbound_scid_alias`]: Self::inbound_scid_alias
19761 * [`outbound_scid_alias`]: Self::outbound_scid_alias
19762 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
19763 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
19764 * [`confirmations_required`]: Self::confirmations_required
19766 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19769 * The position of the funding transaction in the chain. None if the funding transaction has
19770 * not yet been confirmed and the channel fully opened.
19772 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
19773 * payments instead of this. See [`get_inbound_payment_scid`].
19775 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
19776 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
19778 * [`inbound_scid_alias`]: Self::inbound_scid_alias
19779 * [`outbound_scid_alias`]: Self::outbound_scid_alias
19780 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
19781 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
19782 * [`confirmations_required`]: Self::confirmations_required
19784 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
19787 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
19788 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
19789 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
19792 * This will be `None` as long as the channel is not available for routing outbound payments.
19794 * [`short_channel_id`]: Self::short_channel_id
19795 * [`confirmations_required`]: Self::confirmations_required
19797 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19800 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
19801 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
19802 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
19805 * This will be `None` as long as the channel is not available for routing outbound payments.
19807 * [`short_channel_id`]: Self::short_channel_id
19808 * [`confirmations_required`]: Self::confirmations_required
19810 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
19813 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
19814 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
19815 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
19816 * when they see a payment to be routed to us.
19818 * Our counterparty may choose to rotate this value at any time, though will always recognize
19819 * previous values for inbound payment forwarding.
19821 * [`short_channel_id`]: Self::short_channel_id
19823 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19826 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
19827 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
19828 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
19829 * when they see a payment to be routed to us.
19831 * Our counterparty may choose to rotate this value at any time, though will always recognize
19832 * previous values for inbound payment forwarding.
19834 * [`short_channel_id`]: Self::short_channel_id
19836 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
19839 * The value, in satoshis, of this channel as appears in the funding output
19841 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19844 * The value, in satoshis, of this channel as appears in the funding output
19846 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19849 * The value, in satoshis, that must always be held in the channel for us. This value ensures
19850 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
19851 * this value on chain.
19853 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
19855 * This value will be `None` for outbound channels until the counterparty accepts the channel.
19857 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
19859 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19862 * The value, in satoshis, that must always be held in the channel for us. This value ensures
19863 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
19864 * this value on chain.
19866 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
19868 * This value will be `None` for outbound channels until the counterparty accepts the channel.
19870 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
19872 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
19875 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
19877 uint64_t ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19880 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
19882 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19885 * Our total balance. This is the amount we would get if we close the channel.
19886 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
19887 * amount is not likely to be recoverable on close.
19889 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
19890 * balance is not available for inclusion in new outbound HTLCs). This further does not include
19891 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
19892 * This does not consider any on-chain fees.
19894 * See also [`ChannelDetails::outbound_capacity_msat`]
19896 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19899 * Our total balance. This is the amount we would get if we close the channel.
19900 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
19901 * amount is not likely to be recoverable on close.
19903 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
19904 * balance is not available for inclusion in new outbound HTLCs). This further does not include
19905 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
19906 * This does not consider any on-chain fees.
19908 * See also [`ChannelDetails::outbound_capacity_msat`]
19910 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19913 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
19914 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
19915 * available for inclusion in new outbound HTLCs). This further does not include any pending
19916 * outgoing HTLCs which are awaiting some other resolution to be sent.
19918 * See also [`ChannelDetails::balance_msat`]
19920 * This value is not exact. Due to various in-flight changes, feerate changes, and our
19921 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
19922 * should be able to spend nearly this amount.
19924 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19927 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
19928 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
19929 * available for inclusion in new outbound HTLCs). This further does not include any pending
19930 * outgoing HTLCs which are awaiting some other resolution to be sent.
19932 * See also [`ChannelDetails::balance_msat`]
19934 * This value is not exact. Due to various in-flight changes, feerate changes, and our
19935 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
19936 * should be able to spend nearly this amount.
19938 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19941 * The available outbound capacity for sending a single HTLC to the remote peer. This is
19942 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
19943 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
19944 * to use a limit as close as possible to the HTLC limit we can currently send.
19946 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
19948 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19951 * The available outbound capacity for sending a single HTLC to the remote peer. This is
19952 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
19953 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
19954 * to use a limit as close as possible to the HTLC limit we can currently send.
19956 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
19958 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19961 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
19962 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
19963 * available for inclusion in new inbound HTLCs).
19964 * Note that there are some corner cases not fully handled here, so the actual available
19965 * inbound capacity may be slightly higher than this.
19967 * This value is not exact. Due to various in-flight changes, feerate changes, and our
19968 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
19969 * However, our counterparty should be able to spend nearly this amount.
19971 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19974 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
19975 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
19976 * available for inclusion in new inbound HTLCs).
19977 * Note that there are some corner cases not fully handled here, so the actual available
19978 * inbound capacity may be slightly higher than this.
19980 * This value is not exact. Due to various in-flight changes, feerate changes, and our
19981 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
19982 * However, our counterparty should be able to spend nearly this amount.
19984 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19987 * The number of required confirmations on the funding transaction before the funding will be
19988 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
19989 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
19990 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
19991 * [`ChannelHandshakeLimits::max_minimum_depth`].
19993 * This value will be `None` for outbound channels until the counterparty accepts the channel.
19995 * [`is_outbound`]: ChannelDetails::is_outbound
19996 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
19997 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
19999 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20002 * The number of required confirmations on the funding transaction before the funding will be
20003 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
20004 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
20005 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
20006 * [`ChannelHandshakeLimits::max_minimum_depth`].
20008 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20010 * [`is_outbound`]: ChannelDetails::is_outbound
20011 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
20012 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
20014 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
20017 * The number of blocks (after our commitment transaction confirms) that we will need to wait
20018 * until we can claim our funds after we force-close the channel. During this time our
20019 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
20020 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
20021 * time to claim our non-HTLC-encumbered funds.
20023 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20025 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20028 * The number of blocks (after our commitment transaction confirms) that we will need to wait
20029 * until we can claim our funds after we force-close the channel. During this time our
20030 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
20031 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
20032 * time to claim our non-HTLC-encumbered funds.
20034 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20036 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
20039 * True if the channel was initiated (and thus funded) by us.
20041 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20044 * True if the channel was initiated (and thus funded) by us.
20046 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
20049 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
20050 * channel is not currently being shut down. `channel_ready` message exchange implies the
20051 * required confirmation count has been reached (and we were connected to the peer at some
20052 * point after the funding transaction received enough confirmations). The required
20053 * confirmation count is provided in [`confirmations_required`].
20055 * [`confirmations_required`]: ChannelDetails::confirmations_required
20057 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20060 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
20061 * channel is not currently being shut down. `channel_ready` message exchange implies the
20062 * required confirmation count has been reached (and we were connected to the peer at some
20063 * point after the funding transaction received enough confirmations). The required
20064 * confirmation count is provided in [`confirmations_required`].
20066 * [`confirmations_required`]: ChannelDetails::confirmations_required
20068 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
20071 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
20072 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
20074 * This is a strict superset of `is_channel_ready`.
20076 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20079 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
20080 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
20082 * This is a strict superset of `is_channel_ready`.
20084 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
20087 * True if this channel is (or will be) publicly-announced.
20089 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20092 * True if this channel is (or will be) publicly-announced.
20094 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
20097 * The smallest value HTLC (in msat) we will accept, for this channel. This field
20098 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
20100 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20103 * The smallest value HTLC (in msat) we will accept, for this channel. This field
20104 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
20106 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20109 * The largest value HTLC (in msat) we currently will accept, for this channel.
20111 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20114 * The largest value HTLC (in msat) we currently will accept, for this channel.
20116 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20119 * Constructs a new ChannelDetails given each field
20121 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);
20124 * Creates a copy of the ChannelDetails
20126 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
20129 * Gets the current SCID which should be used to identify this channel for inbound payments.
20130 * This should be used for providing invoice hints or in any other context where our
20131 * counterparty will forward a payment to us.
20133 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
20134 * [`ChannelDetails::short_channel_id`]. See those for more information.
20136 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
20139 * Gets the current SCID which should be used to identify this channel for outbound payments.
20140 * This should be used in [`Route`]s to describe the first hop or in other contexts where
20141 * we're sending or forwarding a payment outbound over this channel.
20143 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
20144 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
20146 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
20149 * Frees any resources used by the PaymentSendFailure
20151 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
20154 * Creates a copy of the PaymentSendFailure
20156 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
20159 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
20161 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
20164 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
20166 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
20169 * Utility method to constructs a new AllFailedRetrySafe-variant PaymentSendFailure
20171 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_retry_safe(struct LDKCVec_APIErrorZ a);
20174 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
20176 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
20179 * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
20181 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
20184 * The list of channels to be included in the invoice route hints.
20186 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
20189 * The list of channels to be included in the invoice route hints.
20191 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
20194 * A fake scid used for representing the phantom node's fake channel in generating the invoice
20197 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
20200 * A fake scid used for representing the phantom node's fake channel in generating the invoice
20203 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
20206 * The pubkey of the real backing node that would ultimately receive the payment.
20208 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
20211 * The pubkey of the real backing node that would ultimately receive the payment.
20213 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20216 * Constructs a new PhantomRouteHints given each field
20218 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
20221 * Creates a copy of the PhantomRouteHints
20223 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
20226 * Constructs a new ChannelManager to hold several channels and route between them.
20228 * This is the main \"logic hub\" for all channel-related actions, and implements
20229 * ChannelMessageHandler.
20231 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
20233 * Users need to notify the new ChannelManager when a new block is connected or
20234 * disconnected using its `block_connected` and `block_disconnected` methods, starting
20235 * from after `params.latest_hash`.
20237 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);
20240 * Gets the current configuration applied to all new channels, as
20242 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
20245 * Creates a new outbound channel to the given remote node and with the given value.
20247 * `user_channel_id` will be provided back as in
20248 * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
20249 * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to 0
20250 * for inbound channels, so you may wish to avoid using 0 for `user_channel_id` here.
20251 * `user_channel_id` has no meaning inside of LDK, it is simply copied to events and otherwise
20254 * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
20255 * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
20257 * Note that we do not check if you are currently connected to the given peer. If no
20258 * connection is available, the outbound `open_channel` message may fail to send, resulting in
20259 * the channel eventually being silently forgotten (dropped on reload).
20261 * Returns the new Channel's temporary `channel_id`. This ID will appear as
20262 * [`Event::FundingGenerationReady::temporary_channel_id`] and in
20263 * [`ChannelDetails::channel_id`] until after
20264 * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
20265 * one derived from the funding transaction's TXID. If the counterparty rejects the channel
20266 * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
20268 * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
20269 * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
20270 * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
20272 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
20274 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);
20277 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
20278 * more information.
20280 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
20283 * Gets the list of usable channels, in random order. Useful as an argument to [`find_route`]
20284 * to ensure non-announced channels are used.
20286 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
20287 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
20290 * [`find_route`]: crate::routing::router::find_route
20292 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
20295 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
20296 * will be accepted on the given channel, and after additional timeout/the closing of all
20297 * pending HTLCs, the channel will be closed on chain.
20299 * * If we are the channel initiator, we will pay between our [`Background`] and
20300 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
20302 * * If our counterparty is the channel initiator, we will require a channel closing
20303 * transaction feerate of at least our [`Background`] feerate or the feerate which
20304 * would appear on a force-closure transaction, whichever is lower. We will allow our
20305 * counterparty to pay as much fee as they'd like, however.
20307 * May generate a SendShutdown message event on success, which should be relayed.
20309 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
20310 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
20311 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
20313 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);
20316 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
20317 * will be accepted on the given channel, and after additional timeout/the closing of all
20318 * pending HTLCs, the channel will be closed on chain.
20320 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
20321 * the channel being closed or not:
20322 * * If we are the channel initiator, we will pay at least this feerate on the closing
20323 * transaction. The upper-bound is set by
20324 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
20325 * estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
20326 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
20327 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
20328 * will appear on a force-closure transaction, whichever is lower).
20330 * May generate a SendShutdown message event on success, which should be relayed.
20332 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
20333 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
20334 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
20336 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);
20339 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
20340 * the chain and rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
20341 * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
20344 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id);
20347 * Force close all channels, immediately broadcasting the latest local commitment transaction
20348 * for each to the chain and rejecting new HTLCs on each.
20350 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
20353 * Sends a payment along a given route.
20355 * Value parameters are provided via the last hop in route, see documentation for RouteHop
20356 * fields for more info.
20358 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
20359 * payment), we don't do anything to stop you! We always try to ensure that if the provided
20360 * next hop knows the preimage to payment_hash they can claim an additional amount as
20361 * specified in the last hop in the route! Thus, you should probably do your own
20362 * payment_preimage tracking (which you should already be doing as they represent \"proof of
20363 * payment\") and prevent double-sends yourself.
20365 * May generate SendHTLCs message(s) event on success, which should be relayed.
20367 * Each path may have a different return value, and PaymentSendValue may return a Vec with
20368 * each entry matching the corresponding-index entry in the route paths, see
20369 * PaymentSendFailure for more info.
20371 * In general, a path may raise:
20372 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
20373 * node public key) is specified.
20374 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
20375 * (including due to previous monitor update failure or new permanent monitor update
20377 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
20378 * relevant updates.
20380 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
20381 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
20382 * different route unless you intend to pay twice!
20384 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
20385 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
20386 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
20387 * must not contain multiple paths as multi-path payments require a recipient-provided
20389 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
20390 * bit set (either as required or as available). If multiple paths are present in the Route,
20391 * we assume the invoice had the basic_mpp feature set.
20393 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
20395 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);
20398 * Retries a payment along the given [`Route`].
20400 * Errors returned are a superset of those returned from [`send_payment`], so see
20401 * [`send_payment`] documentation for more details on errors. This method will also error if the
20402 * retry amount puts the payment more than 10% over the payment's total amount, if the payment
20403 * for the given `payment_id` cannot be found (likely due to timeout or success), or if
20404 * further retries have been disabled with [`abandon_payment`].
20406 * [`send_payment`]: [`ChannelManager::send_payment`]
20407 * [`abandon_payment`]: [`ChannelManager::abandon_payment`]
20409 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);
20412 * Signals that no further retries for the given payment will occur.
20414 * After this method returns, any future calls to [`retry_payment`] for the given `payment_id`
20415 * will fail with [`PaymentSendFailure::ParameterError`]. If no such event has been generated,
20416 * an [`Event::PaymentFailed`] event will be generated as soon as there are no remaining
20417 * pending HTLCs for this payment.
20419 * Note that calling this method does *not* prevent a payment from succeeding. You must still
20420 * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
20421 * determine the ultimate status of a payment.
20423 * [`retry_payment`]: Self::retry_payment
20424 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
20425 * [`Event::PaymentSent`]: events::Event::PaymentSent
20427 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
20430 * Send a spontaneous payment, which is a payment that does not require the recipient to have
20431 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
20432 * the preimage, it must be a cryptographically secure random value that no intermediate node
20433 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
20434 * never reach the recipient.
20436 * See [`send_payment`] documentation for more details on the return value of this function.
20438 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
20439 * [`send_payment`] for more information about the risks of duplicate preimage usage.
20441 * Note that `route` must have exactly one path.
20443 * [`send_payment`]: Self::send_payment
20445 * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
20447 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);
20450 * Call this upon creation of a funding transaction for the given channel.
20452 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
20453 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
20455 * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
20456 * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
20458 * May panic if the output found in the funding transaction is duplicative with some other
20459 * channel (note that this should be trivially prevented by using unique funding transaction
20460 * keys per-channel).
20462 * Do NOT broadcast the funding transaction yourself. When we have safely received our
20463 * counterparty's signature the funding transaction will automatically be broadcast via the
20464 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
20466 * Note that this includes RBF or similar transaction replacement strategies - lightning does
20467 * not currently support replacing a funding transaction on an existing channel. Instead,
20468 * create a new channel with a conflicting funding transaction.
20470 * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
20471 * [`Event::ChannelClosed`]: crate::util::events::Event::ChannelClosed
20473 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);
20476 * Regenerates channel_announcements and generates a signed node_announcement from the given
20477 * arguments, providing them in corresponding events via
20478 * [`get_and_clear_pending_msg_events`], if at least one public channel has been confirmed
20479 * on-chain. This effectively re-broadcasts all channel announcements and sends our node
20480 * announcement to ensure that the lightning P2P network is aware of the channels we have and
20481 * our network addresses.
20483 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
20484 * node to humans. They carry no in-protocol meaning.
20486 * `addresses` represent the set (possibly empty) of socket addresses on which this node
20487 * accepts incoming connections. These will be included in the node_announcement, publicly
20488 * tying these addresses together and to this node. If you wish to preserve user privacy,
20489 * addresses should likely contain only Tor Onion addresses.
20491 * Panics if `addresses` is absurdly large (more than 500).
20493 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
20495 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
20498 * Processes HTLCs which are pending waiting on random forward delay.
20500 * Should only really ever be called in response to a PendingHTLCsForwardable event.
20501 * Will likely generate further events.
20503 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
20506 * Performs actions which should happen on startup and roughly once per minute thereafter.
20508 * This currently includes:
20509 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
20510 * * Broadcasting `ChannelUpdate` messages if we've been disconnected from our peer for more
20511 * than a minute, informing the network that they should no longer attempt to route over
20514 * Note that this may cause reentrancy through `chain::Watch::update_channel` calls or feerate
20515 * estimate fetches.
20517 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
20520 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
20521 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
20522 * along the path (including in our own channel on which we received it).
20524 * Note that in some cases around unclean shutdown, it is possible the payment may have
20525 * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
20526 * second copy of) the [`events::Event::PaymentReceived`] event. Alternatively, the payment
20527 * may have already been failed automatically by LDK if it was nearing its expiration time.
20529 * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
20530 * [`ChannelManager::claim_funds`]), you should still monitor for
20531 * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
20532 * startup during which time claims that were in-progress at shutdown may be replayed.
20534 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
20537 * Provides a payment preimage in response to [`Event::PaymentReceived`], generating any
20538 * [`MessageSendEvent`]s needed to claim the payment.
20540 * Note that calling this method does *not* guarantee that the payment has been claimed. You
20541 * *must* wait for an [`Event::PaymentClaimed`] event which upon a successful claim will be
20542 * provided to your [`EventHandler`] when [`process_pending_events`] is next called.
20544 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
20545 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
20546 * event matches your expectation. If you fail to do so and call this method, you may provide
20547 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
20549 * [`Event::PaymentReceived`]: crate::util::events::Event::PaymentReceived
20550 * [`Event::PaymentClaimed`]: crate::util::events::Event::PaymentClaimed
20551 * [`process_pending_events`]: EventsProvider::process_pending_events
20552 * [`create_inbound_payment`]: Self::create_inbound_payment
20553 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
20554 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
20556 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
20559 * Gets the node_id held by this ChannelManager
20561 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
20564 * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
20566 * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
20567 * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
20570 * The `user_channel_id` parameter will be provided back in
20571 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
20572 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
20574 * Note that this method will return an error and reject the channel, if it requires support
20575 * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
20576 * used to accept such channels.
20578 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
20579 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
20581 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);
20584 * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
20585 * it as confirmed immediately.
20587 * The `user_channel_id` parameter will be provided back in
20588 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
20589 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
20591 * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
20592 * and (if the counterparty agrees), enables forwarding of payments immediately.
20594 * This fully trusts that the counterparty has honestly and correctly constructed the funding
20595 * transaction and blindly assumes that it will eventually confirm.
20597 * If it does not confirm before we decide to close the channel, or if the funding transaction
20598 * does not pay to the correct script the correct amount, *you will lose funds*.
20600 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
20601 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
20603 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);
20606 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
20609 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
20610 * [`PaymentHash`] and [`PaymentPreimage`] for you.
20612 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
20613 * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
20614 * passed directly to [`claim_funds`].
20616 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
20618 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
20619 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
20623 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
20624 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
20626 * Errors if `min_value_msat` is greater than total bitcoin supply.
20628 * [`claim_funds`]: Self::claim_funds
20629 * [`PaymentReceived`]: events::Event::PaymentReceived
20630 * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
20631 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
20633 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);
20636 * Legacy version of [`create_inbound_payment`]. Use this method if you wish to share
20637 * serialized state with LDK node(s) running 0.0.103 and earlier.
20639 * May panic if `invoice_expiry_delta_secs` is greater than one year.
20642 * This method is deprecated and will be removed soon.
20644 * [`create_inbound_payment`]: Self::create_inbound_payment
20646 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);
20649 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
20650 * stored external to LDK.
20652 * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a
20653 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
20654 * the `min_value_msat` provided here, if one is provided.
20656 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
20657 * note that LDK will not stop you from registering duplicate payment hashes for inbound
20660 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
20661 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
20662 * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the
20663 * sender \"proof-of-payment\" unless they have paid the required amount.
20665 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
20666 * in excess of the current time. This should roughly match the expiry time set in the invoice.
20667 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
20668 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
20669 * invoices when no timeout is set.
20671 * Note that we use block header time to time-out pending inbound payments (with some margin
20672 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
20673 * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry.
20674 * If you need exact expiry semantics, you should enforce them upon receipt of
20675 * [`PaymentReceived`].
20677 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
20678 * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
20680 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
20681 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
20685 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
20686 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
20688 * Errors if `min_value_msat` is greater than total bitcoin supply.
20690 * [`create_inbound_payment`]: Self::create_inbound_payment
20691 * [`PaymentReceived`]: events::Event::PaymentReceived
20693 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);
20696 * Legacy version of [`create_inbound_payment_for_hash`]. Use this method if you wish to share
20697 * serialized state with LDK node(s) running 0.0.103 and earlier.
20699 * May panic if `invoice_expiry_delta_secs` is greater than one year.
20702 * This method is deprecated and will be removed soon.
20704 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
20706 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);
20709 * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
20710 * previously returned from [`create_inbound_payment`].
20712 * [`create_inbound_payment`]: Self::create_inbound_payment
20714 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);
20717 * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
20718 * are used when constructing the phantom invoice's route hints.
20720 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
20722 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
20725 * Gets route hints for use in receiving [phantom node payments].
20727 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
20729 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
20732 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
20733 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
20735 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
20738 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
20739 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
20741 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
20744 * Constructs a new Listen which calls the relevant methods on this_arg.
20745 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
20747 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
20750 * Constructs a new Confirm which calls the relevant methods on this_arg.
20751 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
20753 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
20756 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
20757 * indicating whether persistence is necessary. Only one listener on
20758 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
20761 * Note that this method is not available with the `no-std` feature.
20763 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
20766 * Blocks until ChannelManager needs to be persisted. Only one listener on
20767 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
20770 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
20773 * Gets the latest best block which was connected either via the [`chain::Listen`] or
20774 * [`chain::Confirm`] interfaces.
20776 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
20779 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
20780 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
20782 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
20785 * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
20787 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
20790 * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
20792 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
20795 * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
20797 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
20800 * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
20802 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
20805 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
20807 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
20810 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
20812 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
20815 * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
20817 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
20820 * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
20822 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
20825 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
20827 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
20830 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
20832 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
20835 * The keys provider which will give us relevant keys. Some keys will be loaded during
20836 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
20839 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
20842 * The keys provider which will give us relevant keys. Some keys will be loaded during
20843 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
20846 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
20849 * The fee_estimator for use in the ChannelManager in the future.
20851 * No calls to the FeeEstimator will be made during deserialization.
20853 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
20856 * The fee_estimator for use in the ChannelManager in the future.
20858 * No calls to the FeeEstimator will be made during deserialization.
20860 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
20863 * The chain::Watch for use in the ChannelManager in the future.
20865 * No calls to the chain::Watch will be made during deserialization. It is assumed that
20866 * you have deserialized ChannelMonitors separately and will add them to your
20867 * chain::Watch after deserializing this ChannelManager.
20869 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
20872 * The chain::Watch for use in the ChannelManager in the future.
20874 * No calls to the chain::Watch will be made during deserialization. It is assumed that
20875 * you have deserialized ChannelMonitors separately and will add them to your
20876 * chain::Watch after deserializing this ChannelManager.
20878 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
20881 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
20882 * used to broadcast the latest local commitment transactions of channels which must be
20883 * force-closed during deserialization.
20885 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
20888 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
20889 * used to broadcast the latest local commitment transactions of channels which must be
20890 * force-closed during deserialization.
20892 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
20895 * The Logger for use in the ChannelManager and which may be used to log information during
20898 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
20901 * The Logger for use in the ChannelManager and which may be used to log information during
20904 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
20907 * Default settings used for new channels. Any existing channels will continue to use the
20908 * runtime settings which were stored when the ChannelManager was serialized.
20910 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
20913 * Default settings used for new channels. Any existing channels will continue to use the
20914 * runtime settings which were stored when the ChannelManager was serialized.
20916 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
20919 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
20920 * HashMap for you. This is primarily useful for C bindings where it is not practical to
20921 * populate a HashMap directly from C.
20923 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);
20926 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
20928 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
20931 * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
20933 void ExpandedKey_free(struct LDKExpandedKey this_obj);
20936 * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret.
20938 * It is recommended to cache this value and not regenerate it for each new inbound payment.
20940 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
20943 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
20944 * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
20945 * a `ChannelManager`.
20947 * `keys` is generated by calling [`KeysInterface::get_inbound_payment_key_material`] and then
20948 * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
20949 * regenerate it for each new inbound payment.
20951 * `current_time` is a Unix timestamp representing the current time.
20953 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
20955 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);
20958 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
20959 * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
20960 * without a `ChannelManager`.
20962 * See [`create`] for information on the `keys` and `current_time` parameters.
20964 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
20966 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);
20969 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
20971 void DecodeError_free(struct LDKDecodeError this_obj);
20974 * Creates a copy of the DecodeError
20976 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
20979 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
20981 void Init_free(struct LDKInit this_obj);
20984 * The relevant features which the sender supports
20986 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
20989 * The relevant features which the sender supports
20991 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
20994 * The receipient's network address. This adds the option to report a remote IP address
20995 * back to a connecting peer using the init message. A node can decide to use that information
20996 * to discover a potential update to its public IPv4 address (NAT) and use
20997 * that for a node_announcement update message containing the new address.
20999 struct LDKCOption_NetAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
21002 * The receipient's network address. This adds the option to report a remote IP address
21003 * back to a connecting peer using the init message. A node can decide to use that information
21004 * to discover a potential update to its public IPv4 address (NAT) and use
21005 * that for a node_announcement update message containing the new address.
21007 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_NetAddressZ val);
21010 * Constructs a new Init given each field
21012 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_NetAddressZ remote_network_address_arg);
21015 * Creates a copy of the Init
21017 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
21020 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
21022 void ErrorMessage_free(struct LDKErrorMessage this_obj);
21025 * The channel ID involved in the error.
21027 * All-0s indicates a general error unrelated to a specific channel, after which all channels
21028 * with the sending peer should be closed.
21030 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
21033 * The channel ID involved in the error.
21035 * All-0s indicates a general error unrelated to a specific channel, after which all channels
21036 * with the sending peer should be closed.
21038 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21041 * A possibly human-readable error description.
21042 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
21043 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
21044 * the terminal emulator or the logging subsystem.
21046 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
21049 * A possibly human-readable error description.
21050 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
21051 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
21052 * the terminal emulator or the logging subsystem.
21054 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
21057 * Constructs a new ErrorMessage given each field
21059 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
21062 * Creates a copy of the ErrorMessage
21064 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
21067 * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
21069 void WarningMessage_free(struct LDKWarningMessage this_obj);
21072 * The channel ID involved in the warning.
21074 * All-0s indicates a warning unrelated to a specific channel.
21076 const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32];
21079 * The channel ID involved in the warning.
21081 * All-0s indicates a warning unrelated to a specific channel.
21083 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21086 * A possibly human-readable warning description.
21087 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
21088 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
21089 * the terminal emulator or the logging subsystem.
21091 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
21094 * A possibly human-readable warning description.
21095 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
21096 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
21097 * the terminal emulator or the logging subsystem.
21099 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
21102 * Constructs a new WarningMessage given each field
21104 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
21107 * Creates a copy of the WarningMessage
21109 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
21112 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
21114 void Ping_free(struct LDKPing this_obj);
21117 * The desired response length
21119 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
21122 * The desired response length
21124 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
21127 * The ping packet size.
21128 * This field is not sent on the wire. byteslen zeros are sent.
21130 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
21133 * The ping packet size.
21134 * This field is not sent on the wire. byteslen zeros are sent.
21136 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
21139 * Constructs a new Ping given each field
21141 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
21144 * Creates a copy of the Ping
21146 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
21149 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
21151 void Pong_free(struct LDKPong this_obj);
21154 * The pong packet size.
21155 * This field is not sent on the wire. byteslen zeros are sent.
21157 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
21160 * The pong packet size.
21161 * This field is not sent on the wire. byteslen zeros are sent.
21163 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
21166 * Constructs a new Pong given each field
21168 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
21171 * Creates a copy of the Pong
21173 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
21176 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
21178 void OpenChannel_free(struct LDKOpenChannel this_obj);
21181 * The genesis hash of the blockchain where the channel is to be opened
21183 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
21186 * The genesis hash of the blockchain where the channel is to be opened
21188 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21191 * A temporary channel ID, until the funding outpoint is announced
21193 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
21196 * A temporary channel ID, until the funding outpoint is announced
21198 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21201 * The channel value
21203 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21206 * The channel value
21208 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21211 * The amount to push to the counterparty as part of the open, in milli-satoshi
21213 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21216 * The amount to push to the counterparty as part of the open, in milli-satoshi
21218 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21221 * The threshold below which outputs on transactions broadcast by sender will be omitted
21223 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21226 * The threshold below which outputs on transactions broadcast by sender will be omitted
21228 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21231 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
21233 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21236 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
21238 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21241 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
21243 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21246 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
21248 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21251 * The minimum HTLC size incoming to sender, in milli-satoshi
21253 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21256 * The minimum HTLC size incoming to sender, in milli-satoshi
21258 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21261 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
21263 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21266 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
21268 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
21271 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
21273 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21276 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
21278 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
21281 * The maximum number of inbound HTLCs towards sender
21283 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21286 * The maximum number of inbound HTLCs towards sender
21288 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
21291 * The sender's key controlling the funding transaction
21293 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21296 * The sender's key controlling the funding transaction
21298 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21301 * Used to derive a revocation key for transactions broadcast by counterparty
21303 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21306 * Used to derive a revocation key for transactions broadcast by counterparty
21308 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21311 * A payment key to sender for transactions broadcast by counterparty
21313 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21316 * A payment key to sender for transactions broadcast by counterparty
21318 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21321 * Used to derive a payment key to sender for transactions broadcast by sender
21323 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21326 * Used to derive a payment key to sender for transactions broadcast by sender
21328 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21331 * Used to derive an HTLC payment key to sender
21333 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21336 * Used to derive an HTLC payment key to sender
21338 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21341 * The first to-be-broadcast-by-sender transaction's per commitment point
21343 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21346 * The first to-be-broadcast-by-sender transaction's per commitment point
21348 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21353 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21358 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
21361 * The channel type that this channel will represent. If none is set, we derive the channel
21362 * type from the intersection of our feature bits with our counterparty's feature bits from
21363 * the Init message.
21365 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21367 struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21370 * The channel type that this channel will represent. If none is set, we derive the channel
21371 * type from the intersection of our feature bits with our counterparty's feature bits from
21372 * the Init message.
21374 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21376 void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
21379 * Creates a copy of the OpenChannel
21381 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
21384 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
21386 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
21389 * A temporary channel ID, until the funding outpoint is announced
21391 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
21394 * A temporary channel ID, until the funding outpoint is announced
21396 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21399 * The threshold below which outputs on transactions broadcast by sender will be omitted
21401 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21404 * The threshold below which outputs on transactions broadcast by sender will be omitted
21406 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
21409 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
21411 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21414 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
21416 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
21419 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
21421 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21424 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
21426 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
21429 * The minimum HTLC size incoming to sender, in milli-satoshi
21431 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21434 * The minimum HTLC size incoming to sender, in milli-satoshi
21436 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
21439 * Minimum depth of the funding transaction before the channel is considered open
21441 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21444 * Minimum depth of the funding transaction before the channel is considered open
21446 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
21449 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
21451 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21454 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
21456 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
21459 * The maximum number of inbound HTLCs towards sender
21461 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21464 * The maximum number of inbound HTLCs towards sender
21466 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
21469 * The sender's key controlling the funding transaction
21471 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21474 * The sender's key controlling the funding transaction
21476 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21479 * Used to derive a revocation key for transactions broadcast by counterparty
21481 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21484 * Used to derive a revocation key for transactions broadcast by counterparty
21486 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21489 * A payment key to sender for transactions broadcast by counterparty
21491 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21494 * A payment key to sender for transactions broadcast by counterparty
21496 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21499 * Used to derive a payment key to sender for transactions broadcast by sender
21501 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21504 * Used to derive a payment key to sender for transactions broadcast by sender
21506 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21509 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
21511 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21514 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
21516 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21519 * The first to-be-broadcast-by-sender transaction's per commitment point
21521 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21524 * The first to-be-broadcast-by-sender transaction's per commitment point
21526 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21529 * The channel type that this channel will represent. If none is set, we derive the channel
21530 * type from the intersection of our feature bits with our counterparty's feature bits from
21531 * the Init message.
21533 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
21535 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21537 struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
21540 * The channel type that this channel will represent. If none is set, we derive the channel
21541 * type from the intersection of our feature bits with our counterparty's feature bits from
21542 * the Init message.
21544 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
21546 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21548 void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
21551 * Creates a copy of the AcceptChannel
21553 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
21556 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
21558 void FundingCreated_free(struct LDKFundingCreated this_obj);
21561 * A temporary channel ID, until the funding is established
21563 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
21566 * A temporary channel ID, until the funding is established
21568 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21571 * The funding transaction ID
21573 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
21576 * The funding transaction ID
21578 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21581 * The specific output index funding this channel
21583 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
21586 * The specific output index funding this channel
21588 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
21591 * The signature of the channel initiator (funder) on the initial commitment transaction
21593 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
21596 * The signature of the channel initiator (funder) on the initial commitment transaction
21598 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
21601 * Constructs a new FundingCreated given each field
21603 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);
21606 * Creates a copy of the FundingCreated
21608 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
21611 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
21613 void FundingSigned_free(struct LDKFundingSigned this_obj);
21618 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
21623 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21626 * The signature of the channel acceptor (fundee) on the initial commitment transaction
21628 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
21631 * The signature of the channel acceptor (fundee) on the initial commitment transaction
21633 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
21636 * Constructs a new FundingSigned given each field
21638 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
21641 * Creates a copy of the FundingSigned
21643 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
21646 * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
21648 void ChannelReady_free(struct LDKChannelReady this_obj);
21653 const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32];
21658 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21661 * The per-commitment point of the second commitment transaction
21663 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
21666 * The per-commitment point of the second commitment transaction
21668 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21671 * If set, provides a short_channel_id alias for this channel. The sender will accept payments
21672 * to be forwarded over this SCID and forward them to this messages' recipient.
21674 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
21677 * If set, provides a short_channel_id alias for this channel. The sender will accept payments
21678 * to be forwarded over this SCID and forward them to this messages' recipient.
21680 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
21683 * Constructs a new ChannelReady given each field
21685 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);
21688 * Creates a copy of the ChannelReady
21690 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
21693 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
21695 void Shutdown_free(struct LDKShutdown this_obj);
21700 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
21705 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21708 * The destination of this peer's funds on closing.
21709 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
21711 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
21714 * The destination of this peer's funds on closing.
21715 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
21717 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
21720 * Constructs a new Shutdown given each field
21722 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
21725 * Creates a copy of the Shutdown
21727 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
21730 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
21732 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
21735 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
21738 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
21741 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
21744 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
21747 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
21750 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
21753 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
21756 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
21759 * Constructs a new ClosingSignedFeeRange given each field
21761 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
21764 * Creates a copy of the ClosingSignedFeeRange
21766 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
21769 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
21771 void ClosingSigned_free(struct LDKClosingSigned this_obj);
21776 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
21781 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21784 * The proposed total fee for the closing transaction
21786 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
21789 * The proposed total fee for the closing transaction
21791 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
21794 * A signature on the closing transaction
21796 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
21799 * A signature on the closing transaction
21801 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
21804 * The minimum and maximum fees which the sender is willing to accept, provided only by new
21807 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21809 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
21812 * The minimum and maximum fees which the sender is willing to accept, provided only by new
21815 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21817 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
21820 * Constructs a new ClosingSigned given each field
21822 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);
21825 * Creates a copy of the ClosingSigned
21827 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
21830 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
21832 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
21837 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
21842 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21847 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
21852 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
21855 * The HTLC value in milli-satoshi
21857 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
21860 * The HTLC value in milli-satoshi
21862 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
21865 * The payment hash, the pre-image of which controls HTLC redemption
21867 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
21870 * The payment hash, the pre-image of which controls HTLC redemption
21872 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21875 * The expiry height of the HTLC
21877 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
21880 * The expiry height of the HTLC
21882 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
21885 * Creates a copy of the UpdateAddHTLC
21887 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
21890 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
21892 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
21897 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
21902 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21907 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
21912 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
21915 * The pre-image of the payment hash, allowing HTLC redemption
21917 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
21920 * The pre-image of the payment hash, allowing HTLC redemption
21922 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21925 * Constructs a new UpdateFulfillHTLC given each field
21927 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
21930 * Creates a copy of the UpdateFulfillHTLC
21932 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
21935 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
21937 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
21942 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
21947 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21952 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
21957 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
21960 * Creates a copy of the UpdateFailHTLC
21962 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
21965 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
21967 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
21972 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
21977 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21982 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
21987 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
21992 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
21997 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
22000 * Creates a copy of the UpdateFailMalformedHTLC
22002 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
22005 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
22007 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
22012 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
22017 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22020 * A signature on the commitment transaction
22022 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
22025 * A signature on the commitment transaction
22027 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
22030 * Signatures on the HTLC transactions
22032 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
22035 * Constructs a new CommitmentSigned given each field
22037 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
22040 * Creates a copy of the CommitmentSigned
22042 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
22045 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
22047 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
22052 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
22057 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22060 * The secret corresponding to the per-commitment point
22062 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
22065 * The secret corresponding to the per-commitment point
22067 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22070 * The next sender-broadcast commitment transaction's per-commitment point
22072 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
22075 * The next sender-broadcast commitment transaction's per-commitment point
22077 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22080 * Constructs a new RevokeAndACK given each field
22082 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);
22085 * Creates a copy of the RevokeAndACK
22087 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
22090 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
22092 void UpdateFee_free(struct LDKUpdateFee this_obj);
22097 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
22102 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22105 * Fee rate per 1000-weight of the transaction
22107 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
22110 * Fee rate per 1000-weight of the transaction
22112 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
22115 * Constructs a new UpdateFee given each field
22117 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
22120 * Creates a copy of the UpdateFee
22122 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
22125 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
22127 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
22130 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
22131 * belonging to the recipient
22133 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
22136 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
22137 * belonging to the recipient
22139 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22142 * The sender's per-commitment point for their current commitment transaction
22144 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
22147 * The sender's per-commitment point for their current commitment transaction
22149 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22152 * Constructs a new DataLossProtect given each field
22154 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
22157 * Creates a copy of the DataLossProtect
22159 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
22162 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
22164 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
22169 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
22174 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22177 * The next commitment number for the sender
22179 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
22182 * The next commitment number for the sender
22184 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
22187 * The next commitment number for the recipient
22189 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
22192 * The next commitment number for the recipient
22194 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
22197 * Creates a copy of the ChannelReestablish
22199 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
22202 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
22204 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
22209 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
22214 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22217 * The short channel ID
22219 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
22222 * The short channel ID
22224 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
22227 * A signature by the node key
22229 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
22232 * A signature by the node key
22234 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
22237 * A signature by the funding key
22239 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
22242 * A signature by the funding key
22244 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
22247 * Constructs a new AnnouncementSignatures given each field
22249 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);
22252 * Creates a copy of the AnnouncementSignatures
22254 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
22257 * Frees any resources used by the NetAddress
22259 void NetAddress_free(struct LDKNetAddress this_ptr);
22262 * Creates a copy of the NetAddress
22264 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
22267 * Utility method to constructs a new IPv4-variant NetAddress
22269 struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port);
22272 * Utility method to constructs a new IPv6-variant NetAddress
22274 struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port);
22277 * Utility method to constructs a new OnionV2-variant NetAddress
22279 struct LDKNetAddress NetAddress_onion_v2(struct LDKTwelveBytes a);
22282 * Utility method to constructs a new OnionV3-variant NetAddress
22284 struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
22287 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
22289 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
22292 * Read a NetAddress from a byte array, created by NetAddress_write
22294 struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
22297 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
22299 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
22302 * The advertised features
22304 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
22307 * The advertised features
22309 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
22312 * A strictly monotonic announcement counter, with gaps allowed
22314 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
22317 * A strictly monotonic announcement counter, with gaps allowed
22319 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
22322 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
22325 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
22328 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
22331 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22334 * An RGB color for UI purposes
22336 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
22339 * An RGB color for UI purposes
22341 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
22344 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
22347 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
22350 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
22353 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22356 * List of addresses on which this node is reachable
22358 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
22361 * Creates a copy of the UnsignedNodeAnnouncement
22363 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
22366 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
22368 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
22371 * The signature by the node key
22373 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
22376 * The signature by the node key
22378 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
22381 * The actual content of the announcement
22383 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
22386 * The actual content of the announcement
22388 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
22391 * Constructs a new NodeAnnouncement given each field
22393 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
22396 * Creates a copy of the NodeAnnouncement
22398 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
22401 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
22403 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
22406 * The advertised channel features
22408 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
22411 * The advertised channel features
22413 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
22416 * The genesis hash of the blockchain where the channel is to be opened
22418 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
22421 * The genesis hash of the blockchain where the channel is to be opened
22423 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22426 * The short channel ID
22428 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
22431 * The short channel ID
22433 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
22436 * One of the two node_ids which are endpoints of this channel
22438 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
22441 * One of the two node_ids which are endpoints of this channel
22443 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22446 * The other of the two node_ids which are endpoints of this channel
22448 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
22451 * The other of the two node_ids which are endpoints of this channel
22453 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22456 * The funding key for the first node
22458 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
22461 * The funding key for the first node
22463 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22466 * The funding key for the second node
22468 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
22471 * The funding key for the second node
22473 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22476 * Creates a copy of the UnsignedChannelAnnouncement
22478 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
22481 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
22483 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
22486 * Authentication of the announcement by the first public node
22488 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
22491 * Authentication of the announcement by the first public node
22493 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
22496 * Authentication of the announcement by the second public node
22498 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
22501 * Authentication of the announcement by the second public node
22503 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
22506 * Proof of funding UTXO ownership by the first public node
22508 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
22511 * Proof of funding UTXO ownership by the first public node
22513 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
22516 * Proof of funding UTXO ownership by the second public node
22518 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
22521 * Proof of funding UTXO ownership by the second public node
22523 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
22526 * The actual announcement
22528 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
22531 * The actual announcement
22533 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
22536 * Constructs a new ChannelAnnouncement given each field
22538 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);
22541 * Creates a copy of the ChannelAnnouncement
22543 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
22546 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
22548 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
22551 * The genesis hash of the blockchain where the channel is to be opened
22553 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
22556 * The genesis hash of the blockchain where the channel is to be opened
22558 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22561 * The short channel ID
22563 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22566 * The short channel ID
22568 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
22571 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
22573 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22576 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
22578 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
22583 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22588 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
22591 * The number of blocks such that if:
22592 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
22593 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
22594 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
22595 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
22596 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
22597 * forwarding. Note that the HTLC sender is the one who originally sets this value when
22598 * constructing the route.
22600 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22603 * The number of blocks such that if:
22604 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
22605 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
22606 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
22607 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
22608 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
22609 * forwarding. Note that the HTLC sender is the one who originally sets this value when
22610 * constructing the route.
22612 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
22615 * The minimum HTLC size incoming to sender, in milli-satoshi
22617 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22620 * The minimum HTLC size incoming to sender, in milli-satoshi
22622 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
22625 * The base HTLC fee charged by sender, in milli-satoshi
22627 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22630 * The base HTLC fee charged by sender, in milli-satoshi
22632 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
22635 * The amount to fee multiplier, in micro-satoshi
22637 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
22640 * The amount to fee multiplier, in micro-satoshi
22642 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
22645 * Excess data which was signed as a part of the message which we do not (yet) understand how
22646 * to decode. This is stored to ensure forward-compatibility as new fields are added to the
22649 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
22652 * Creates a copy of the UnsignedChannelUpdate
22654 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
22657 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
22659 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
22662 * A signature of the channel update
22664 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
22667 * A signature of the channel update
22669 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
22672 * The actual channel update
22674 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
22677 * The actual channel update
22679 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
22682 * Constructs a new ChannelUpdate given each field
22684 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
22687 * Creates a copy of the ChannelUpdate
22689 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
22692 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
22694 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
22697 * The genesis hash of the blockchain being queried
22699 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
22702 * The genesis hash of the blockchain being queried
22704 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22707 * The height of the first block for the channel UTXOs being queried
22709 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
22712 * The height of the first block for the channel UTXOs being queried
22714 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
22717 * The number of blocks to include in the query results
22719 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
22722 * The number of blocks to include in the query results
22724 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
22727 * Constructs a new QueryChannelRange given each field
22729 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
22732 * Creates a copy of the QueryChannelRange
22734 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
22737 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
22739 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
22742 * The genesis hash of the blockchain being queried
22744 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
22747 * The genesis hash of the blockchain being queried
22749 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22752 * The height of the first block in the range of the reply
22754 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
22757 * The height of the first block in the range of the reply
22759 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
22762 * The number of blocks included in the range of the reply
22764 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
22767 * The number of blocks included in the range of the reply
22769 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
22772 * True when this is the final reply for a query
22774 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
22777 * True when this is the final reply for a query
22779 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
22782 * The short_channel_ids in the channel range
22784 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
22787 * Constructs a new ReplyChannelRange given each field
22789 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);
22792 * Creates a copy of the ReplyChannelRange
22794 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
22797 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
22799 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
22802 * The genesis hash of the blockchain being queried
22804 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
22807 * The genesis hash of the blockchain being queried
22809 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22812 * The short_channel_ids that are being queried
22814 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
22817 * Constructs a new QueryShortChannelIds given each field
22819 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
22822 * Creates a copy of the QueryShortChannelIds
22824 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
22827 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
22829 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
22832 * The genesis hash of the blockchain that was queried
22834 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
22837 * The genesis hash of the blockchain that was queried
22839 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22842 * Indicates if the query recipient maintains up-to-date channel
22843 * information for the chain_hash
22845 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
22848 * Indicates if the query recipient maintains up-to-date channel
22849 * information for the chain_hash
22851 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
22854 * Constructs a new ReplyShortChannelIdsEnd given each field
22856 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
22859 * Creates a copy of the ReplyShortChannelIdsEnd
22861 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
22864 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
22866 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
22869 * The genesis hash of the blockchain for channel and node information
22871 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
22874 * The genesis hash of the blockchain for channel and node information
22876 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22879 * The starting unix timestamp
22881 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
22884 * The starting unix timestamp
22886 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
22889 * The range of information in seconds
22891 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
22894 * The range of information in seconds
22896 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
22899 * Constructs a new GossipTimestampFilter given each field
22901 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
22904 * Creates a copy of the GossipTimestampFilter
22906 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
22909 * Frees any resources used by the ErrorAction
22911 void ErrorAction_free(struct LDKErrorAction this_ptr);
22914 * Creates a copy of the ErrorAction
22916 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
22919 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
22921 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
22924 * Utility method to constructs a new IgnoreError-variant ErrorAction
22926 struct LDKErrorAction ErrorAction_ignore_error(void);
22929 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
22931 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
22934 * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
22936 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
22939 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
22941 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
22944 * Utility method to constructs a new SendWarningMessage-variant ErrorAction
22946 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
22949 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
22951 void LightningError_free(struct LDKLightningError this_obj);
22954 * A human-readable message describing the error
22956 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
22959 * A human-readable message describing the error
22961 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
22964 * The action which should be taken against the offending peer.
22966 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
22969 * The action which should be taken against the offending peer.
22971 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
22974 * Constructs a new LightningError given each field
22976 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
22979 * Creates a copy of the LightningError
22981 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
22984 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
22986 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
22989 * update_add_htlc messages which should be sent
22991 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
22994 * update_add_htlc messages which should be sent
22996 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
22999 * update_fulfill_htlc messages which should be sent
23001 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23004 * update_fulfill_htlc messages which should be sent
23006 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
23009 * update_fail_htlc messages which should be sent
23011 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23014 * update_fail_htlc messages which should be sent
23016 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
23019 * update_fail_malformed_htlc messages which should be sent
23021 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23024 * update_fail_malformed_htlc messages which should be sent
23026 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
23029 * An update_fee message which should be sent
23031 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23033 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23036 * An update_fee message which should be sent
23038 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23040 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
23043 * Finally, the commitment_signed message which should be sent
23045 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23048 * Finally, the commitment_signed message which should be sent
23050 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
23053 * Constructs a new CommitmentUpdate given each field
23055 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);
23058 * Creates a copy of the CommitmentUpdate
23060 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
23063 * Calls the free function if one is set
23065 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
23068 * Calls the free function if one is set
23070 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
23073 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
23075 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
23078 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
23080 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
23083 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
23085 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
23088 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
23090 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
23093 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
23095 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
23098 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
23100 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
23103 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
23105 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
23108 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
23110 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
23113 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
23115 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
23118 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
23120 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
23123 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
23125 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
23128 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
23130 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
23133 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
23135 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
23138 * Read a FundingCreated from a byte array, created by FundingCreated_write
23140 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
23143 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
23145 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
23148 * Read a FundingSigned from a byte array, created by FundingSigned_write
23150 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
23153 * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
23155 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
23158 * Read a ChannelReady from a byte array, created by ChannelReady_write
23160 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
23163 * Serialize the Init object into a byte array which can be read by Init_read
23165 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
23168 * Read a Init from a byte array, created by Init_write
23170 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
23173 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
23175 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
23178 * Read a OpenChannel from a byte array, created by OpenChannel_write
23180 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
23183 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
23185 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
23188 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
23190 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
23193 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
23195 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
23198 * Read a Shutdown from a byte array, created by Shutdown_write
23200 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
23203 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
23205 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
23208 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
23210 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
23213 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
23215 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
23218 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
23220 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
23223 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
23225 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
23228 * Read a UpdateFee from a byte array, created by UpdateFee_write
23230 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
23233 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
23235 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
23238 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
23240 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
23243 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
23245 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
23248 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
23250 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
23253 * Serialize the Ping object into a byte array which can be read by Ping_read
23255 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
23258 * Read a Ping from a byte array, created by Ping_write
23260 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
23263 * Serialize the Pong object into a byte array which can be read by Pong_read
23265 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
23268 * Read a Pong from a byte array, created by Pong_write
23270 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
23273 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
23275 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
23278 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
23280 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
23283 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
23285 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
23288 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
23290 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
23293 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
23295 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
23298 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
23300 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
23303 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
23305 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
23308 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
23310 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
23313 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
23315 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
23318 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
23320 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
23323 * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
23325 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
23328 * Read a WarningMessage from a byte array, created by WarningMessage_write
23330 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
23333 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
23335 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
23338 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
23340 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
23343 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
23345 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
23348 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
23350 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
23353 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
23355 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
23358 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
23360 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
23363 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
23365 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
23368 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
23370 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
23373 *\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
23375 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
23378 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
23380 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
23383 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
23385 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
23388 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
23390 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
23393 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
23395 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
23398 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
23400 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
23403 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
23405 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
23408 * Calls the free function if one is set
23410 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
23413 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
23415 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
23418 * Constructs a new IgnoringMessageHandler given each field
23420 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
23423 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
23424 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
23426 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
23429 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
23430 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
23432 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
23435 * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
23436 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
23438 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
23441 * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
23442 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
23444 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
23447 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
23449 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
23452 * Constructs a new ErroringMessageHandler
23454 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
23457 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
23458 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
23460 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
23463 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
23464 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
23466 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
23469 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
23471 void MessageHandler_free(struct LDKMessageHandler this_obj);
23474 * A message handler which handles messages specific to channels. Usually this is just a
23475 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
23477 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
23479 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
23482 * A message handler which handles messages specific to channels. Usually this is just a
23483 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
23485 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
23487 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
23490 * A message handler which handles messages updating our knowledge of the network channel
23491 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
23493 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
23495 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
23498 * A message handler which handles messages updating our knowledge of the network channel
23499 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
23501 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
23503 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
23506 * Constructs a new MessageHandler given each field
23508 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
23511 * Creates a copy of a SocketDescriptor
23513 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
23516 * Calls the free function if one is set
23518 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
23521 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
23523 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
23526 * Used to indicate that we probably can't make any future connections to this peer (e.g.
23527 * because we required features that our peer was missing, or vice versa).
23529 * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close
23530 * any channels with this peer or check for new versions of LDK.
23532 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
23534 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
23537 * Used to indicate that we probably can't make any future connections to this peer (e.g.
23538 * because we required features that our peer was missing, or vice versa).
23540 * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close
23541 * any channels with this peer or check for new versions of LDK.
23543 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
23545 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
23548 * Constructs a new PeerHandleError given each field
23550 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
23553 * Creates a copy of the PeerHandleError
23555 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
23558 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
23560 void PeerManager_free(struct LDKPeerManager this_obj);
23563 * Constructs a new PeerManager with the given message handlers and node_id secret key
23564 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
23565 * cryptographically secure random bytes.
23567 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);
23570 * Get the list of node ids for peers which have completed the initial handshake.
23572 * For outbound connections, this will be the same as the their_node_id parameter passed in to
23573 * new_outbound_connection, however entries will only appear once the initial handshake has
23574 * completed and we are sure the remote peer has the private key for the given node_id.
23576 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
23579 * Indicates a new outbound connection has been established to a node with the given node_id
23580 * and an optional remote network address.
23582 * The remote network address adds the option to report a remote IP address back to a connecting
23583 * peer using the init message.
23584 * The user should pass the remote network address of the host they are connected to.
23586 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
23587 * descriptor but must disconnect the connection immediately.
23589 * Returns a small number of bytes to send to the remote node (currently always 50).
23591 * Panics if descriptor is duplicative with some other descriptor which has not yet been
23592 * [`socket_disconnected()`].
23594 * [`socket_disconnected()`]: PeerManager::socket_disconnected
23596 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);
23599 * Indicates a new inbound connection has been established to a node with an optional remote
23602 * The remote network address adds the option to report a remote IP address back to a connecting
23603 * peer using the init message.
23604 * The user should pass the remote network address of the host they are connected to.
23606 * May refuse the connection by returning an Err, but will never write bytes to the remote end
23607 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
23608 * call socket_disconnected for the new descriptor but must disconnect the connection
23611 * Panics if descriptor is duplicative with some other descriptor which has not yet been
23612 * [`socket_disconnected()`].
23614 * [`socket_disconnected()`]: PeerManager::socket_disconnected
23616 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);
23619 * Indicates that there is room to write data to the given socket descriptor.
23621 * May return an Err to indicate that the connection should be closed.
23623 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
23624 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
23625 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
23626 * ready to call `[write_buffer_space_avail`] again if a write call generated here isn't
23629 * [`send_data`]: SocketDescriptor::send_data
23630 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
23632 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
23635 * Indicates that data was read from the given socket descriptor.
23637 * May return an Err to indicate that the connection should be closed.
23639 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
23640 * Thus, however, you should call [`process_events`] after any `read_event` to generate
23641 * [`send_data`] calls to handle responses.
23643 * If `Ok(true)` is returned, further read_events should not be triggered until a
23644 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
23647 * [`send_data`]: SocketDescriptor::send_data
23648 * [`process_events`]: PeerManager::process_events
23650 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);
23653 * Checks for any events generated by our handlers and processes them. Includes sending most
23654 * response messages as well as messages generated by calls to handler functions directly (eg
23655 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
23657 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
23660 * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
23661 * or one of the other clients provided in our language bindings.
23663 * Note that if there are any other calls to this function waiting on lock(s) this may return
23664 * without doing any work. All available events that need handling will be handled before the
23665 * other calls return.
23667 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
23668 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
23669 * [`send_data`]: SocketDescriptor::send_data
23671 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
23674 * Indicates that the given socket descriptor's connection is now closed.
23676 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
23679 * Disconnect a peer given its node id.
23681 * Set `no_connection_possible` to true to prevent any further connection with this peer,
23682 * force-closing any channels we have with it.
23684 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
23685 * peer. Thus, be very careful about reentrancy issues.
23687 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
23689 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
23692 * Disconnects all currently-connected peers. This is useful on platforms where there may be
23693 * an indication that TCP sockets have stalled even if we weren't around to time them out
23694 * using regular ping/pongs.
23696 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
23699 * Send pings to each peer and disconnect those which did not respond to the last round of
23702 * This may be called on any timescale you want, however, roughly once every ten seconds is
23703 * preferred. The call rate determines both how often we send a ping to our peers and how much
23704 * time they have to respond before we disconnect them.
23706 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
23709 * [`send_data`]: SocketDescriptor::send_data
23711 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
23714 * Gets the weight for an HTLC-Success transaction.
23716 uint64_t htlc_success_tx_weight(bool opt_anchors);
23719 * Gets the weight for an HTLC-Timeout transaction.
23721 uint64_t htlc_timeout_tx_weight(bool opt_anchors);
23724 * Build the commitment secret from the seed and the commitment number
23726 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
23729 * Build a closing transaction
23731 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);
23734 * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
23736 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
23739 * Creates a copy of the CounterpartyCommitmentSecrets
23741 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
23744 * Creates a new empty `CounterpartyCommitmentSecrets` structure.
23746 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
23749 * Returns the minimum index of all stored secrets. Note that indexes start
23750 * at 1 << 48 and get decremented by one for each new secret.
23752 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
23755 * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
23756 * was generated in accordance with BOLT 3 and is consistent with previous secrets.
23758 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
23761 * Returns the secret at `idx`.
23762 * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
23764 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23766 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
23769 * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
23771 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
23774 * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
23776 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
23779 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
23780 * from the base secret and the per_commitment_point.
23782 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
23783 * generated (ie our own).
23785 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
23788 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
23789 * from the base point and the per_commitment_key. This is the public equivalent of
23790 * derive_private_key - using only public keys to derive a public key instead of private keys.
23792 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
23793 * generated (ie our own).
23795 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
23798 * Derives a per-commitment-transaction revocation key from its constituent parts.
23800 * Only the cheating participant owns a valid witness to propagate a revoked
23801 * commitment transaction, thus per_commitment_secret always come from cheater
23802 * and revocation_base_secret always come from punisher, which is the broadcaster
23803 * of the transaction spending with this key knowledge.
23805 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
23806 * generated (ie our own).
23808 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
23811 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
23812 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
23813 * public key instead of private keys.
23815 * Only the cheating participant owns a valid witness to propagate a revoked
23816 * commitment transaction, thus per_commitment_point always come from cheater
23817 * and revocation_base_point always come from punisher, which is the broadcaster
23818 * of the transaction spending with this key knowledge.
23820 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
23821 * generated (ie our own).
23823 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
23826 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
23828 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
23831 * The broadcaster's per-commitment public key which was used to derive the other keys.
23833 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
23836 * The broadcaster's per-commitment public key which was used to derive the other keys.
23838 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23841 * The revocation key which is used to allow the broadcaster of the commitment
23842 * transaction to provide their counterparty the ability to punish them if they broadcast
23845 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
23848 * The revocation key which is used to allow the broadcaster of the commitment
23849 * transaction to provide their counterparty the ability to punish them if they broadcast
23852 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23855 * Broadcaster's HTLC Key
23857 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
23860 * Broadcaster's HTLC Key
23862 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23865 * Countersignatory's HTLC Key
23867 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
23870 * Countersignatory's HTLC Key
23872 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23875 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
23877 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
23880 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
23882 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23885 * Constructs a new TxCreationKeys given each field
23887 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);
23890 * Creates a copy of the TxCreationKeys
23892 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
23895 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
23897 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
23900 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
23902 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
23905 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
23907 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
23910 * The public key which is used to sign all commitment transactions, as it appears in the
23911 * on-chain channel lock-in 2-of-2 multisig output.
23913 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
23916 * The public key which is used to sign all commitment transactions, as it appears in the
23917 * on-chain channel lock-in 2-of-2 multisig output.
23919 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23922 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
23923 * revocation keys. This is combined with the per-commitment-secret generated by the
23924 * counterparty to create a secret which the counterparty can reveal to revoke previous
23927 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
23930 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
23931 * revocation keys. This is combined with the per-commitment-secret generated by the
23932 * counterparty to create a secret which the counterparty can reveal to revoke previous
23935 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23938 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
23939 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
23940 * static across every commitment transaction.
23942 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
23945 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
23946 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
23947 * static across every commitment transaction.
23949 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23952 * The base point which is used (with derive_public_key) to derive a per-commitment payment
23953 * public key which receives non-HTLC-encumbered funds which are only available for spending
23954 * after some delay (or can be claimed via the revocation path).
23956 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
23959 * The base point which is used (with derive_public_key) to derive a per-commitment payment
23960 * public key which receives non-HTLC-encumbered funds which are only available for spending
23961 * after some delay (or can be claimed via the revocation path).
23963 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23966 * The base point which is used (with derive_public_key) to derive a per-commitment public key
23967 * which is used to encumber HTLC-in-flight outputs.
23969 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
23972 * The base point which is used (with derive_public_key) to derive a per-commitment public key
23973 * which is used to encumber HTLC-in-flight outputs.
23975 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23978 * Constructs a new ChannelPublicKeys given each field
23980 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);
23983 * Creates a copy of the ChannelPublicKeys
23985 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
23988 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
23990 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
23993 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
23995 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
23998 * Create per-state keys from channel base points and the per-commitment point.
23999 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
24001 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);
24004 * Generate per-state keys from channel static keys.
24005 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
24007 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);
24010 * A script either spendable by the revocation
24011 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
24012 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
24014 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
24017 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
24019 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
24022 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
24023 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
24024 * need to compare this value to whether the commitment transaction in question is that of
24025 * the counterparty or our own.
24027 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
24030 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
24031 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
24032 * need to compare this value to whether the commitment transaction in question is that of
24033 * the counterparty or our own.
24035 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
24038 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
24039 * this divided by 1000.
24041 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
24044 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
24045 * this divided by 1000.
24047 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
24050 * The CLTV lock-time at which this HTLC expires.
24052 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
24055 * The CLTV lock-time at which this HTLC expires.
24057 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
24060 * The hash of the preimage which unlocks this HTLC.
24062 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
24065 * The hash of the preimage which unlocks this HTLC.
24067 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24070 * The position within the commitment transactions' outputs. This may be None if the value is
24071 * below the dust limit (in which case no output appears in the commitment transaction and the
24072 * value is spent to additional transaction fees).
24074 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
24077 * The position within the commitment transactions' outputs. This may be None if the value is
24078 * below the dust limit (in which case no output appears in the commitment transaction and the
24079 * value is spent to additional transaction fees).
24081 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
24084 * Constructs a new HTLCOutputInCommitment given each field
24086 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);
24089 * Creates a copy of the HTLCOutputInCommitment
24091 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
24094 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
24096 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
24099 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
24101 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
24104 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
24105 * does not need to have its previous_output_index filled.
24107 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, const struct LDKTxCreationKeys *NONNULL_PTR keys);
24110 * Gets the redeemscript for a funding output from the two funding public keys.
24111 * Note that the order of funding public keys does not matter.
24113 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
24116 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
24117 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
24118 * transaction which needs signing, and can be used to construct an HTLC transaction which is
24119 * broadcastable given a counterparty HTLC signature.
24121 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
24122 * commitment transaction).
24124 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);
24127 * Gets the witnessScript for an anchor output from the funding public key.
24128 * The witness in the spending input must be:
24129 * <BIP 143 funding_signature>
24130 * After 16 blocks of confirmation, an alternative satisfying witness could be:
24132 * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
24134 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
24137 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
24139 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
24142 * Holder public keys
24144 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24147 * Holder public keys
24149 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
24152 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
24154 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24157 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
24159 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
24162 * Whether the holder is the initiator of this channel.
24163 * This is an input to the commitment number obscure factor computation.
24165 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24168 * Whether the holder is the initiator of this channel.
24169 * This is an input to the commitment number obscure factor computation.
24171 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
24174 * The late-bound counterparty channel transaction parameters.
24175 * These parameters are populated at the point in the protocol where the counterparty provides them.
24177 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24179 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24182 * The late-bound counterparty channel transaction parameters.
24183 * These parameters are populated at the point in the protocol where the counterparty provides them.
24185 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24187 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
24190 * The late-bound funding outpoint
24192 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24194 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24197 * The late-bound funding outpoint
24199 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24201 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
24204 * Are anchors used for this channel. Boolean is serialization backwards-compatible
24206 enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24209 * Are anchors used for this channel. Boolean is serialization backwards-compatible
24211 void ChannelTransactionParameters_set_opt_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
24214 * Constructs a new ChannelTransactionParameters given each field
24216 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);
24219 * Creates a copy of the ChannelTransactionParameters
24221 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
24224 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
24226 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
24229 * Counter-party public keys
24231 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
24234 * Counter-party public keys
24236 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
24239 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
24241 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
24244 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
24246 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
24249 * Constructs a new CounterpartyChannelTransactionParameters given each field
24251 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
24254 * Creates a copy of the CounterpartyChannelTransactionParameters
24256 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
24259 * Whether the late bound parameters are populated.
24261 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
24264 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
24265 * given that the holder is the broadcaster.
24267 * self.is_populated() must be true before calling this function.
24269 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
24272 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
24273 * given that the counterparty is the broadcaster.
24275 * self.is_populated() must be true before calling this function.
24277 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
24280 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
24282 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
24285 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
24287 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
24290 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
24292 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
24295 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
24297 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
24300 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
24302 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
24305 * Get the channel pubkeys for the broadcaster
24307 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24310 * Get the channel pubkeys for the countersignatory
24312 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24315 * Get the contest delay applicable to the transactions.
24316 * Note that the contest delay was selected by the countersignatory.
24318 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24321 * Whether the channel is outbound from the broadcaster.
24323 * The boolean representing the side that initiated the channel is
24324 * an input to the commitment number obscure factor computation.
24326 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24329 * The funding outpoint
24331 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24334 * Whether to use anchors for this channel
24336 MUST_USE_RES bool DirectedChannelTransactionParameters_opt_anchors(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24339 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
24341 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
24344 * Our counterparty's signature for the transaction
24346 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
24349 * Our counterparty's signature for the transaction
24351 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
24354 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
24356 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
24359 * Creates a copy of the HolderCommitmentTransaction
24361 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
24364 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
24366 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
24369 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
24371 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
24374 * Create a new holder transaction with the given counterparty signatures.
24375 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
24377 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);
24380 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
24382 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
24385 * The commitment transaction
24387 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
24390 * The commitment transaction
24392 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
24395 * The txid for the commitment transaction.
24397 * This is provided as a performance optimization, instead of calling transaction.txid()
24400 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
24403 * The txid for the commitment transaction.
24405 * This is provided as a performance optimization, instead of calling transaction.txid()
24408 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24411 * Constructs a new BuiltCommitmentTransaction given each field
24413 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
24416 * Creates a copy of the BuiltCommitmentTransaction
24418 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
24421 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
24423 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
24426 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
24428 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
24431 * Get the SIGHASH_ALL sighash value of the transaction.
24433 * This can be used to verify a signature.
24435 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);
24438 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
24439 * because we are about to broadcast a holder transaction.
24441 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);
24444 * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
24446 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
24449 * Creates a copy of the ClosingTransaction
24451 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
24454 * Checks if two ClosingTransactions contain equal inner contents.
24456 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
24459 * Construct an object of the class
24461 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);
24464 * Trust our pre-built transaction.
24466 * Applies a wrapper which allows access to the transaction.
24468 * This should only be used if you fully trust the builder of this object. It should not
24469 * be used by an external signer - instead use the verify function.
24471 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
24474 * Verify our pre-built transaction.
24476 * Applies a wrapper which allows access to the transaction.
24478 * An external validating signer must call this method before signing
24479 * or using the built transaction.
24481 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
24484 * The value to be sent to the holder, or zero if the output will be omitted
24486 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
24489 * The value to be sent to the counterparty, or zero if the output will be omitted
24491 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
24494 * The destination of the holder's output
24496 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
24499 * The destination of the counterparty's output
24501 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
24504 * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
24506 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
24509 * The pre-built Bitcoin commitment transaction
24511 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
24514 * Get the SIGHASH_ALL sighash value of the transaction.
24516 * This can be used to verify a signature.
24518 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);
24521 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
24522 * because we are about to broadcast a holder transaction.
24524 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);
24527 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
24529 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
24532 * Creates a copy of the CommitmentTransaction
24534 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
24537 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
24539 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
24542 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
24544 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
24547 * The backwards-counting commitment number
24549 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
24552 * The value to be sent to the broadcaster
24554 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
24557 * The value to be sent to the counterparty
24559 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
24562 * The feerate paid per 1000-weight-unit in this commitment transaction.
24564 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
24567 * Trust our pre-built transaction and derived transaction creation public keys.
24569 * Applies a wrapper which allows access to these fields.
24571 * This should only be used if you fully trust the builder of this object. It should not
24572 * be used by an external signer - instead use the verify function.
24574 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
24577 * Verify our pre-built transaction and derived transaction creation public keys.
24579 * Applies a wrapper which allows access to these fields.
24581 * An external validating signer must call this method before signing
24582 * or using the built transaction.
24584 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);
24587 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
24589 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
24592 * The transaction ID of the built Bitcoin transaction
24594 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
24597 * The pre-built Bitcoin commitment transaction
24599 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
24602 * The pre-calculated transaction creation public keys.
24604 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
24607 * Should anchors be used.
24609 MUST_USE_RES bool TrustedCommitmentTransaction_opt_anchors(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
24612 * Get a signature for each HTLC which was included in the commitment transaction (ie for
24613 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
24615 * The returned Vec has one entry for each HTLC, and in the same order.
24617 * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
24619 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);
24622 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
24623 * shared secret first. This prevents on-chain observers from discovering how many commitment
24624 * transactions occurred in a channel before it was closed.
24626 * This function gets the shared secret from relevant channel public keys and can be used to
24627 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
24629 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
24632 * Checks if two InitFeaturess contain equal inner contents.
24633 * This ignores pointers and is_owned flags and looks at the values in fields.
24634 * Two objects with NULL inner values will be considered "equal" here.
24636 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
24639 * Checks if two NodeFeaturess contain equal inner contents.
24640 * This ignores pointers and is_owned flags and looks at the values in fields.
24641 * Two objects with NULL inner values will be considered "equal" here.
24643 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
24646 * Checks if two ChannelFeaturess contain equal inner contents.
24647 * This ignores pointers and is_owned flags and looks at the values in fields.
24648 * Two objects with NULL inner values will be considered "equal" here.
24650 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
24653 * Checks if two InvoiceFeaturess contain equal inner contents.
24654 * This ignores pointers and is_owned flags and looks at the values in fields.
24655 * Two objects with NULL inner values will be considered "equal" here.
24657 bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
24660 * Checks if two ChannelTypeFeaturess contain equal inner contents.
24661 * This ignores pointers and is_owned flags and looks at the values in fields.
24662 * Two objects with NULL inner values will be considered "equal" here.
24664 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
24667 * Creates a copy of the InitFeatures
24669 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
24672 * Creates a copy of the NodeFeatures
24674 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
24677 * Creates a copy of the ChannelFeatures
24679 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
24682 * Creates a copy of the InvoiceFeatures
24684 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
24687 * Creates a copy of the ChannelTypeFeatures
24689 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
24692 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
24694 void InitFeatures_free(struct LDKInitFeatures this_obj);
24697 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
24699 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
24702 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
24704 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
24707 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
24709 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
24712 * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
24714 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
24717 * Create a blank Features with no features set
24719 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
24722 * Creates a Features with the bits set which are known by the implementation
24724 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
24727 * Returns true if this `Features` object contains unknown feature flags which are set as
24730 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24733 * Create a blank Features with no features set
24735 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
24738 * Creates a Features with the bits set which are known by the implementation
24740 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
24743 * Returns true if this `Features` object contains unknown feature flags which are set as
24746 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
24749 * Create a blank Features with no features set
24751 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
24754 * Creates a Features with the bits set which are known by the implementation
24756 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
24759 * Returns true if this `Features` object contains unknown feature flags which are set as
24762 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
24765 * Create a blank Features with no features set
24767 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
24770 * Creates a Features with the bits set which are known by the implementation
24772 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
24775 * Returns true if this `Features` object contains unknown feature flags which are set as
24778 MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
24781 * Create a blank Features with no features set
24783 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
24786 * Creates a Features with the bits set which are known by the implementation
24788 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_known(void);
24791 * Returns true if this `Features` object contains unknown feature flags which are set as
24794 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
24797 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
24799 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
24802 * Read a InitFeatures from a byte array, created by InitFeatures_write
24804 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
24807 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
24809 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
24812 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
24814 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
24817 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
24819 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
24822 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
24824 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
24827 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
24829 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
24832 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
24834 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
24837 * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
24839 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
24842 * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
24844 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
24847 * Set this feature as optional.
24849 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
24852 * Set this feature as required.
24854 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
24857 * Checks if this feature is supported.
24859 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24862 * Set this feature as optional.
24864 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
24867 * Set this feature as required.
24869 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
24872 * Checks if this feature is supported.
24874 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
24877 * Checks if this feature is required.
24879 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24882 * Checks if this feature is required.
24884 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
24887 * Set this feature as optional.
24889 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
24892 * Set this feature as required.
24894 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
24897 * Checks if this feature is supported.
24899 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24902 * Set this feature as optional.
24904 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
24907 * Set this feature as required.
24909 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
24912 * Checks if this feature is supported.
24914 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24917 * Set this feature as optional.
24919 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
24922 * Set this feature as required.
24924 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
24927 * Checks if this feature is supported.
24929 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
24932 * Checks if this feature is required.
24934 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24937 * Checks if this feature is required.
24939 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
24942 * Set this feature as optional.
24944 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
24947 * Set this feature as required.
24949 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
24952 * Checks if this feature is supported.
24954 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24957 * Set this feature as optional.
24959 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
24962 * Set this feature as required.
24964 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
24967 * Checks if this feature is supported.
24969 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
24972 * Checks if this feature is required.
24974 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24977 * Checks if this feature is required.
24979 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
24982 * Set this feature as optional.
24984 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
24987 * Set this feature as required.
24989 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
24992 * Checks if this feature is supported.
24994 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
24997 * Set this feature as optional.
24999 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25002 * Set this feature as required.
25004 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25007 * Checks if this feature is supported.
25009 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25012 * Set this feature as optional.
25014 void InvoiceFeatures_set_variable_length_onion_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25017 * Set this feature as required.
25019 void InvoiceFeatures_set_variable_length_onion_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25022 * Checks if this feature is supported.
25024 MUST_USE_RES bool InvoiceFeatures_supports_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25027 * Checks if this feature is required.
25029 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25032 * Checks if this feature is required.
25034 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25037 * Checks if this feature is required.
25039 MUST_USE_RES bool InvoiceFeatures_requires_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25042 * Set this feature as optional.
25044 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25047 * Set this feature as required.
25049 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25052 * Checks if this feature is supported.
25054 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25057 * Set this feature as optional.
25059 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25062 * Set this feature as required.
25064 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25067 * Checks if this feature is supported.
25069 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25072 * Set this feature as optional.
25074 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25077 * Set this feature as required.
25079 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25082 * Checks if this feature is supported.
25084 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25087 * Checks if this feature is required.
25089 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25092 * Checks if this feature is required.
25094 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25097 * Checks if this feature is required.
25099 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25102 * Set this feature as optional.
25104 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25107 * Set this feature as required.
25109 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25112 * Checks if this feature is supported.
25114 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25117 * Set this feature as optional.
25119 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25122 * Set this feature as required.
25124 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25127 * Checks if this feature is supported.
25129 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25132 * Set this feature as optional.
25134 void InvoiceFeatures_set_payment_secret_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25137 * Set this feature as required.
25139 void InvoiceFeatures_set_payment_secret_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25142 * Checks if this feature is supported.
25144 MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25147 * Checks if this feature is required.
25149 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25152 * Checks if this feature is required.
25154 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25157 * Checks if this feature is required.
25159 MUST_USE_RES bool InvoiceFeatures_requires_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25162 * Set this feature as optional.
25164 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25167 * Set this feature as required.
25169 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25172 * Checks if this feature is supported.
25174 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25177 * Set this feature as optional.
25179 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25182 * Set this feature as required.
25184 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25187 * Checks if this feature is supported.
25189 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25192 * Set this feature as optional.
25194 void InvoiceFeatures_set_basic_mpp_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25197 * Set this feature as required.
25199 void InvoiceFeatures_set_basic_mpp_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25202 * Checks if this feature is supported.
25204 MUST_USE_RES bool InvoiceFeatures_supports_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25207 * Checks if this feature is required.
25209 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25212 * Checks if this feature is required.
25214 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25217 * Checks if this feature is required.
25219 MUST_USE_RES bool InvoiceFeatures_requires_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25222 * Set this feature as optional.
25224 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25227 * Set this feature as required.
25229 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25232 * Checks if this feature is supported.
25234 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25237 * Set this feature as optional.
25239 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25242 * Set this feature as required.
25244 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25247 * Checks if this feature is supported.
25249 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25252 * Checks if this feature is required.
25254 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25257 * Checks if this feature is required.
25259 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25262 * Set this feature as optional.
25264 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25267 * Set this feature as required.
25269 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25272 * Checks if this feature is supported.
25274 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25277 * Set this feature as optional.
25279 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25282 * Set this feature as required.
25284 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25287 * Checks if this feature is supported.
25289 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25292 * Checks if this feature is required.
25294 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25297 * Checks if this feature is required.
25299 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25302 * Set this feature as optional.
25304 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25307 * Set this feature as required.
25309 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25312 * Checks if this feature is supported.
25314 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25317 * Set this feature as optional.
25319 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25322 * Set this feature as required.
25324 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25327 * Checks if this feature is supported.
25329 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25332 * Checks if this feature is required.
25334 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25337 * Checks if this feature is required.
25339 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25342 * Set this feature as optional.
25344 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25347 * Set this feature as required.
25349 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25352 * Checks if this feature is supported.
25354 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25357 * Set this feature as optional.
25359 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25362 * Set this feature as required.
25364 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25367 * Checks if this feature is supported.
25369 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25372 * Set this feature as optional.
25374 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25377 * Set this feature as required.
25379 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25382 * Checks if this feature is supported.
25384 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25387 * Checks if this feature is required.
25389 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25392 * Checks if this feature is required.
25394 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25397 * Checks if this feature is required.
25399 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25402 * Set this feature as optional.
25404 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25407 * Set this feature as required.
25409 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25412 * Checks if this feature is supported.
25414 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25417 * Set this feature as optional.
25419 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25422 * Set this feature as required.
25424 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25427 * Checks if this feature is supported.
25429 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25432 * Set this feature as optional.
25434 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25437 * Set this feature as required.
25439 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25442 * Checks if this feature is supported.
25444 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25447 * Checks if this feature is required.
25449 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25452 * Checks if this feature is required.
25454 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25457 * Checks if this feature is required.
25459 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25462 * Set this feature as optional.
25464 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25467 * Set this feature as required.
25469 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25472 * Checks if this feature is supported.
25474 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25477 * Checks if this feature is required.
25479 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25482 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
25484 void ShutdownScript_free(struct LDKShutdownScript this_obj);
25487 * Creates a copy of the ShutdownScript
25489 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
25492 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
25494 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
25497 * The script that did not meet the requirements from [BOLT #2].
25499 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
25501 struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
25504 * The script that did not meet the requirements from [BOLT #2].
25506 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
25508 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
25511 * Constructs a new InvalidShutdownScript given each field
25513 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
25516 * Creates a copy of the InvalidShutdownScript
25518 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
25521 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
25523 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
25526 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
25528 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
25531 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
25533 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
25536 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
25538 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
25541 * Generates a witness script pubkey from the given segwit version and program.
25543 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
25544 * [`ShutdownScript::new_p2wsh`] instead.
25548 * This function may return an error if `program` is invalid for the segwit `version`.
25550 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessVersion version, struct LDKu8slice program);
25553 * Converts the shutdown script into the underlying [`Script`].
25555 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
25558 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
25560 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25562 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
25565 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
25567 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
25569 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
25572 * Calls the free function if one is set
25574 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
25577 * Calls the free function if one is set
25579 void Type_free(struct LDKType this_ptr);
25582 * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
25584 void NodeId_free(struct LDKNodeId this_obj);
25587 * Creates a copy of the NodeId
25589 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
25592 * Create a new NodeId from a public key
25594 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
25597 * Get the public key slice from this NodeId
25599 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
25602 * Checks if two NodeIds contain equal inner contents.
25604 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
25607 * Serialize the NodeId object into a byte array which can be read by NodeId_read
25609 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
25612 * Read a NodeId from a byte array, created by NodeId_write
25614 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
25617 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
25619 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
25622 * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
25624 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
25627 * Frees any resources used by the NetworkUpdate
25629 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
25632 * Creates a copy of the NetworkUpdate
25634 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
25637 * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
25639 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
25642 * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
25644 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
25647 * Utility method to constructs a new NodeFailure-variant NetworkUpdate
25649 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
25652 * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
25654 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
25657 * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
25659 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
25662 * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
25664 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
25667 * Creates a new tracker of the actual state of the network of channels and nodes,
25668 * assuming an existing Network Graph.
25669 * Chain monitor is used to make sure announced channels exist on-chain,
25670 * channel data is correct, and that the announcement is signed with
25671 * channel owners' keys.
25673 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger);
25676 * Adds a provider used to check new announcements. Does not affect
25677 * existing announcements unless they are updated.
25678 * Add, update or remove the provider would replace the current one.
25680 void P2PGossipSync_add_chain_access(struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_AccessZ chain_access);
25683 * Constructs a new EventHandler which calls the relevant methods on this_arg.
25684 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
25686 struct LDKEventHandler NetworkGraph_as_EventHandler(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
25689 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
25690 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
25692 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
25695 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
25696 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
25698 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
25701 * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
25703 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
25706 * When the last update to the channel direction was issued.
25707 * Value is opaque, as set in the announcement.
25709 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25712 * When the last update to the channel direction was issued.
25713 * Value is opaque, as set in the announcement.
25715 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
25718 * Whether the channel can be currently used for payments (in this one direction).
25720 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25723 * Whether the channel can be currently used for payments (in this one direction).
25725 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
25728 * The difference in CLTV values that you must have when routing through this channel.
25730 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25733 * The difference in CLTV values that you must have when routing through this channel.
25735 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
25738 * The minimum value, which must be relayed to the next hop via the channel
25740 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25743 * The minimum value, which must be relayed to the next hop via the channel
25745 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
25748 * The maximum value which may be relayed to the next hop via the channel.
25750 struct LDKCOption_u64Z ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25753 * The maximum value which may be relayed to the next hop via the channel.
25755 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
25758 * Fees charged when the channel is used for routing
25760 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25763 * Fees charged when the channel is used for routing
25765 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
25768 * Most recent update for the channel received from the network
25769 * Mostly redundant with the data we store in fields explicitly.
25770 * Everything else is useful only for sending out for initial routing sync.
25771 * Not stored if contains excess data to prevent DoS.
25773 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25775 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
25778 * Most recent update for the channel received from the network
25779 * Mostly redundant with the data we store in fields explicitly.
25780 * Everything else is useful only for sending out for initial routing sync.
25781 * Not stored if contains excess data to prevent DoS.
25783 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
25785 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
25788 * Constructs a new ChannelUpdateInfo given each field
25790 MUST_USE_RES struct LDKChannelUpdateInfo ChannelUpdateInfo_new(uint32_t last_update_arg, bool enabled_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg, struct LDKRoutingFees fees_arg, struct LDKChannelUpdate last_update_message_arg);
25793 * Creates a copy of the ChannelUpdateInfo
25795 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
25798 * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
25800 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
25803 * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
25805 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
25808 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
25810 void ChannelInfo_free(struct LDKChannelInfo this_obj);
25813 * Protocol features of a channel communicated during its announcement
25815 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
25818 * Protocol features of a channel communicated during its announcement
25820 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
25823 * Source node of the first direction of a channel
25825 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
25828 * Source node of the first direction of a channel
25830 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
25833 * Details about the first direction of a channel
25835 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25837 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
25840 * Details about the first direction of a channel
25842 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
25844 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
25847 * Source node of the second direction of a channel
25849 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
25852 * Source node of the second direction of a channel
25854 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
25857 * Details about the second direction of a channel
25859 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25861 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
25864 * Details about the second direction of a channel
25866 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
25868 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
25871 * The channel capacity as seen on-chain, if chain lookup is available.
25873 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
25876 * The channel capacity as seen on-chain, if chain lookup is available.
25878 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
25881 * An initial announcement of the channel
25882 * Mostly redundant with the data we store in fields explicitly.
25883 * Everything else is useful only for sending out for initial routing sync.
25884 * Not stored if contains excess data to prevent DoS.
25886 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25888 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
25891 * An initial announcement of the channel
25892 * Mostly redundant with the data we store in fields explicitly.
25893 * Everything else is useful only for sending out for initial routing sync.
25894 * Not stored if contains excess data to prevent DoS.
25896 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
25898 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
25901 * Creates a copy of the ChannelInfo
25903 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
25906 * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
25908 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25910 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
25913 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
25915 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
25918 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
25920 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
25923 * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
25925 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
25928 * Creates a copy of the DirectedChannelInfo
25930 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
25933 * Returns information for the channel.
25935 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
25938 * Returns information for the direction.
25940 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25942 MUST_USE_RES struct LDKChannelUpdateInfo DirectedChannelInfo_direction(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
25945 * Returns the maximum HTLC amount allowed over the channel in the direction.
25947 MUST_USE_RES uint64_t DirectedChannelInfo_htlc_maximum_msat(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
25950 * Returns the [`EffectiveCapacity`] of the channel in the direction.
25952 * This is either the total capacity from the funding transaction, if known, or the
25953 * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
25956 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
25959 * Frees any resources used by the EffectiveCapacity
25961 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
25964 * Creates a copy of the EffectiveCapacity
25966 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
25969 * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
25971 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
25974 * Utility method to constructs a new MaximumHTLC-variant EffectiveCapacity
25976 struct LDKEffectiveCapacity EffectiveCapacity_maximum_htlc(uint64_t amount_msat);
25979 * Utility method to constructs a new Total-variant EffectiveCapacity
25981 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat);
25984 * Utility method to constructs a new Infinite-variant EffectiveCapacity
25986 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
25989 * Utility method to constructs a new Unknown-variant EffectiveCapacity
25991 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
25994 * Returns the effective capacity denominated in millisatoshi.
25996 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
25999 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
26001 void RoutingFees_free(struct LDKRoutingFees this_obj);
26004 * Flat routing fee in satoshis
26006 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
26009 * Flat routing fee in satoshis
26011 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
26014 * Liquidity-based routing fee in millionths of a routed amount.
26015 * In other words, 10000 is 1%.
26017 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
26020 * Liquidity-based routing fee in millionths of a routed amount.
26021 * In other words, 10000 is 1%.
26023 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
26026 * Constructs a new RoutingFees given each field
26028 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
26031 * Checks if two RoutingFeess contain equal inner contents.
26032 * This ignores pointers and is_owned flags and looks at the values in fields.
26033 * Two objects with NULL inner values will be considered "equal" here.
26035 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
26038 * Creates a copy of the RoutingFees
26040 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
26043 * Checks if two RoutingFeess contain equal inner contents.
26045 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
26048 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
26050 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
26053 * Read a RoutingFees from a byte array, created by RoutingFees_write
26055 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
26058 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
26060 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
26063 * Protocol features the node announced support for
26065 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
26068 * Protocol features the node announced support for
26070 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
26073 * When the last known update to the node state was issued.
26074 * Value is opaque, as set in the announcement.
26076 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
26079 * When the last known update to the node state was issued.
26080 * Value is opaque, as set in the announcement.
26082 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
26085 * Color assigned to the node
26087 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
26090 * Color assigned to the node
26092 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
26095 * Moniker assigned to the node.
26096 * May be invalid or malicious (eg control chars),
26097 * should not be exposed to the user.
26099 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
26102 * Moniker assigned to the node.
26103 * May be invalid or malicious (eg control chars),
26104 * should not be exposed to the user.
26106 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26109 * Internet-level addresses via which one can connect to the node
26111 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
26114 * An initial announcement of the node
26115 * Mostly redundant with the data we store in fields explicitly.
26116 * Everything else is useful only for sending out for initial routing sync.
26117 * Not stored if contains excess data to prevent DoS.
26119 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26121 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
26124 * An initial announcement of the node
26125 * Mostly redundant with the data we store in fields explicitly.
26126 * Everything else is useful only for sending out for initial routing sync.
26127 * Not stored if contains excess data to prevent DoS.
26129 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26131 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
26134 * Constructs a new NodeAnnouncementInfo given each field
26136 MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKThirtyTwoBytes alias_arg, struct LDKCVec_NetAddressZ addresses_arg, struct LDKNodeAnnouncement announcement_message_arg);
26139 * Creates a copy of the NodeAnnouncementInfo
26141 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
26144 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
26146 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
26149 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
26151 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
26154 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
26156 void NodeInfo_free(struct LDKNodeInfo this_obj);
26159 * All valid channels a node has announced
26161 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
26164 * Lowest fees enabling routing via any of the enabled, known channels to a node.
26165 * The two fields (flat and proportional fee) are independent,
26166 * meaning they don't have to refer to the same channel.
26168 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26170 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
26173 * Lowest fees enabling routing via any of the enabled, known channels to a node.
26174 * The two fields (flat and proportional fee) are independent,
26175 * meaning they don't have to refer to the same channel.
26177 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26179 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
26182 * More information about a node from node_announcement.
26183 * Optional because we store a Node entry after learning about it from
26184 * a channel announcement, but before receiving a node announcement.
26186 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26188 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
26191 * More information about a node from node_announcement.
26192 * Optional because we store a Node entry after learning about it from
26193 * a channel announcement, but before receiving a node announcement.
26195 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26197 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
26200 * Constructs a new NodeInfo given each field
26202 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
26205 * Creates a copy of the NodeInfo
26207 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
26210 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
26212 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
26215 * Read a NodeInfo from a byte array, created by NodeInfo_write
26217 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
26220 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
26222 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
26225 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
26227 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
26230 * Creates a new, empty, network graph.
26232 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKLogger logger);
26235 * Returns a read-only view of the network graph.
26237 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
26240 * The unix timestamp provided by the most recent rapid gossip sync.
26241 * It will be set by the rapid sync process after every sync completion.
26243 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
26246 * Update the unix timestamp provided by the most recent rapid gossip sync.
26247 * This should be done automatically by the rapid sync process after every sync completion.
26249 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
26252 * For an already known node (from channel announcements), update its stored properties from a
26253 * given node announcement.
26255 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
26256 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
26257 * routing messages from a source using a protocol other than the lightning P2P protocol.
26259 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
26262 * For an already known node (from channel announcements), update its stored properties from a
26263 * given node announcement without verifying the associated signatures. Because we aren't
26264 * given the associated signatures here we cannot relay the node announcement to any of our
26267 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);
26270 * Store or update channel info from a channel announcement.
26272 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
26273 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
26274 * routing messages from a source using a protocol other than the lightning P2P protocol.
26276 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
26277 * the corresponding UTXO exists on chain and is correctly-formatted.
26279 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);
26282 * Store or update channel info from a channel announcement without verifying the associated
26283 * signatures. Because we aren't given the associated signatures here we cannot relay the
26284 * channel announcement to any of our peers.
26286 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
26287 * the corresponding UTXO exists on chain and is correctly-formatted.
26289 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);
26292 * Update channel from partial announcement data received via rapid gossip sync
26294 * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
26295 * rapid gossip sync server)
26297 * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
26299 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);
26302 * Marks a channel in the graph as failed if a corresponding HTLC fail was sent.
26303 * If permanent, removes a channel from the local storage.
26304 * May cause the removal of nodes too, if this was their last channel.
26305 * If not permanent, makes channels unavailable for routing.
26307 void NetworkGraph_channel_failed(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
26310 * Marks a node in the graph as failed.
26312 void NetworkGraph_node_failed(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey _node_id, bool is_permanent);
26315 * Removes information about channels that we haven't heard any updates about in some time.
26316 * This can be used regularly to prune the network graph of channels that likely no longer
26319 * While there is no formal requirement that nodes regularly re-broadcast their channel
26320 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
26321 * pruning occur for updates which are at least two weeks old, which we implement here.
26323 * Note that for users of the `lightning-background-processor` crate this method may be
26324 * automatically called regularly for you.
26326 * This method is only available with the `std` feature. See
26327 * [`NetworkGraph::remove_stale_channels_with_time`] for `no-std` use.
26329 void NetworkGraph_remove_stale_channels(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
26332 * Removes information about channels that we haven't heard any updates about in some time.
26333 * This can be used regularly to prune the network graph of channels that likely no longer
26336 * While there is no formal requirement that nodes regularly re-broadcast their channel
26337 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
26338 * pruning occur for updates which are at least two weeks old, which we implement here.
26340 * This function takes the current unix time as an argument. For users with the `std` feature
26341 * enabled, [`NetworkGraph::remove_stale_channels`] may be preferable.
26343 void NetworkGraph_remove_stale_channels_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
26346 * For an already known (from announcement) channel, update info about one of the directions
26349 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
26350 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
26351 * routing messages from a source using a protocol other than the lightning P2P protocol.
26353 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
26354 * materially in the future will be rejected.
26356 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
26359 * For an already known (from announcement) channel, update info about one of the directions
26360 * of the channel without verifying the associated signatures. Because we aren't given the
26361 * associated signatures here we cannot relay the channel update to any of our peers.
26363 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
26364 * materially in the future will be rejected.
26366 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
26369 * Get network addresses by node id.
26370 * Returns None if the requested node is completely unknown,
26371 * or if node announcement for the node was never received.
26373 MUST_USE_RES struct LDKCOption_CVec_NetAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
26376 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
26378 void RouteHop_free(struct LDKRouteHop this_obj);
26381 * The node_id of the node at this hop.
26383 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
26386 * The node_id of the node at this hop.
26388 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26391 * The node_announcement features of the node at this hop. For the last hop, these may be
26392 * amended to match the features present in the invoice this node generated.
26394 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
26397 * The node_announcement features of the node at this hop. For the last hop, these may be
26398 * amended to match the features present in the invoice this node generated.
26400 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
26403 * The channel that should be used from the previous hop to reach this node.
26405 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
26408 * The channel that should be used from the previous hop to reach this node.
26410 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
26413 * The channel_announcement features of the channel that should be used from the previous hop
26414 * to reach this node.
26416 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
26419 * The channel_announcement features of the channel that should be used from the previous hop
26420 * to reach this node.
26422 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
26425 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
26426 * For the last hop, this should be the full value of the payment (might be more than
26427 * requested if we had to match htlc_minimum_msat).
26429 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
26432 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
26433 * For the last hop, this should be the full value of the payment (might be more than
26434 * requested if we had to match htlc_minimum_msat).
26436 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
26439 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
26440 * expected at the destination, in excess of the current block height.
26442 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
26445 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
26446 * expected at the destination, in excess of the current block height.
26448 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
26451 * Constructs a new RouteHop given each field
26453 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);
26456 * Creates a copy of the RouteHop
26458 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
26461 * Checks if two RouteHops contain equal inner contents.
26463 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
26466 * Checks if two RouteHops contain equal inner contents.
26467 * This ignores pointers and is_owned flags and looks at the values in fields.
26468 * Two objects with NULL inner values will be considered "equal" here.
26470 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
26473 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
26475 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
26478 * Read a RouteHop from a byte array, created by RouteHop_write
26480 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
26483 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
26485 void Route_free(struct LDKRoute this_obj);
26488 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
26489 * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT
26490 * INCLUDING our own, where the last hop is the destination. Thus, this must always be at
26491 * least length one. While the maximum length of any given path is variable, keeping the length
26492 * of any path less or equal to 19 should currently ensure it is viable.
26494 struct LDKCVec_CVec_RouteHopZZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
26497 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
26498 * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT
26499 * INCLUDING our own, where the last hop is the destination. Thus, this must always be at
26500 * least length one. While the maximum length of any given path is variable, keeping the length
26501 * of any path less or equal to 19 should currently ensure it is viable.
26503 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
26506 * The `payment_params` parameter passed to [`find_route`].
26507 * This is used by `ChannelManager` to track information which may be required for retries,
26508 * provided back to you via [`Event::PaymentPathFailed`].
26510 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
26512 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26514 struct LDKPaymentParameters Route_get_payment_params(const struct LDKRoute *NONNULL_PTR this_ptr);
26517 * The `payment_params` parameter passed to [`find_route`].
26518 * This is used by `ChannelManager` to track information which may be required for retries,
26519 * provided back to you via [`Event::PaymentPathFailed`].
26521 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
26523 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26525 void Route_set_payment_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
26528 * Constructs a new Route given each field
26530 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg, struct LDKPaymentParameters payment_params_arg);
26533 * Creates a copy of the Route
26535 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
26538 * Checks if two Routes contain equal inner contents.
26540 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
26543 * Checks if two Routes contain equal inner contents.
26544 * This ignores pointers and is_owned flags and looks at the values in fields.
26545 * Two objects with NULL inner values will be considered "equal" here.
26547 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
26550 * Returns the total amount of fees paid on this [`Route`].
26552 * This doesn't include any extra payment made to the recipient, which can happen in excess of
26553 * the amount passed to [`find_route`]'s `params.final_value_msat`.
26555 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
26558 * Returns the total amount paid on this [`Route`], excluding the fees.
26560 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
26563 * Serialize the Route object into a byte array which can be read by Route_read
26565 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
26568 * Read a Route from a byte array, created by Route_write
26570 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
26573 * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
26575 void RouteParameters_free(struct LDKRouteParameters this_obj);
26578 * The parameters of the failed payment path.
26580 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
26583 * The parameters of the failed payment path.
26585 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
26588 * The amount in msats sent on the failed payment path.
26590 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
26593 * The amount in msats sent on the failed payment path.
26595 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
26598 * The CLTV on the final hop of the failed payment path.
26600 uint32_t RouteParameters_get_final_cltv_expiry_delta(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
26603 * The CLTV on the final hop of the failed payment path.
26605 void RouteParameters_set_final_cltv_expiry_delta(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint32_t val);
26608 * Constructs a new RouteParameters given each field
26610 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);
26613 * Creates a copy of the RouteParameters
26615 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
26618 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
26620 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
26623 * Read a RouteParameters from a byte array, created by RouteParameters_write
26625 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
26628 * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
26630 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
26633 * The node id of the payee.
26635 struct LDKPublicKey PaymentParameters_get_payee_pubkey(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
26638 * The node id of the payee.
26640 void PaymentParameters_set_payee_pubkey(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26643 * Features supported by the payee.
26645 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
26646 * does not contain any features.
26648 * [`for_keysend`]: Self::for_keysend
26650 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26652 struct LDKInvoiceFeatures PaymentParameters_get_features(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
26655 * Features supported by the payee.
26657 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
26658 * does not contain any features.
26660 * [`for_keysend`]: Self::for_keysend
26662 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26664 void PaymentParameters_set_features(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKInvoiceFeatures val);
26667 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
26669 struct LDKCVec_RouteHintZ PaymentParameters_get_route_hints(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
26672 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
26674 void PaymentParameters_set_route_hints(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintZ val);
26677 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
26679 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
26682 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
26684 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
26687 * The maximum total CLTV delta we accept for the route.
26689 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
26692 * The maximum total CLTV delta we accept for the route.
26694 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
26697 * Constructs a new PaymentParameters given each field
26699 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);
26702 * Creates a copy of the PaymentParameters
26704 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
26707 * Checks if two PaymentParameterss contain equal inner contents.
26709 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
26712 * Checks if two PaymentParameterss contain equal inner contents.
26713 * This ignores pointers and is_owned flags and looks at the values in fields.
26714 * Two objects with NULL inner values will be considered "equal" here.
26716 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
26719 * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
26721 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
26724 * Read a PaymentParameters from a byte array, created by PaymentParameters_write
26726 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser);
26729 * Creates a payee with the node id of the given `pubkey`.
26731 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey);
26734 * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
26736 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey);
26739 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
26741 void RouteHint_free(struct LDKRouteHint this_obj);
26743 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
26745 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
26748 * Constructs a new RouteHint given each field
26750 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
26753 * Creates a copy of the RouteHint
26755 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
26758 * Checks if two RouteHints contain equal inner contents.
26760 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
26763 * Checks if two RouteHints contain equal inner contents.
26764 * This ignores pointers and is_owned flags and looks at the values in fields.
26765 * Two objects with NULL inner values will be considered "equal" here.
26767 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
26770 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
26772 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
26775 * Read a RouteHint from a byte array, created by RouteHint_write
26777 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
26780 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
26782 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
26785 * The node_id of the non-target end of the route
26787 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
26790 * The node_id of the non-target end of the route
26792 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26795 * The short_channel_id of this channel
26797 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
26800 * The short_channel_id of this channel
26802 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
26805 * The fees which must be paid to use this channel
26807 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
26810 * The fees which must be paid to use this channel
26812 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
26815 * The difference in CLTV values between this node and the next node.
26817 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
26820 * The difference in CLTV values between this node and the next node.
26822 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
26825 * The minimum value, in msat, which must be relayed to the next hop.
26827 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
26830 * The minimum value, in msat, which must be relayed to the next hop.
26832 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
26835 * The maximum value in msat available for routing with a single HTLC.
26837 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
26840 * The maximum value in msat available for routing with a single HTLC.
26842 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
26845 * Constructs a new RouteHintHop given each field
26847 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);
26850 * Creates a copy of the RouteHintHop
26852 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
26855 * Checks if two RouteHintHops contain equal inner contents.
26857 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
26860 * Checks if two RouteHintHops contain equal inner contents.
26861 * This ignores pointers and is_owned flags and looks at the values in fields.
26862 * Two objects with NULL inner values will be considered "equal" here.
26864 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
26867 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
26869 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
26872 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
26874 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
26877 * Finds a route from us (payer) to the given target node (payee).
26879 * If the payee provided features in their invoice, they should be provided via `params.payee`.
26880 * Without this, MPP will only be used if the payee's features are available in the network graph.
26882 * Private routing paths between a public node and the target may be included in `params.payee`.
26884 * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
26885 * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
26886 * from `network_graph` will be ignored, and only those in `first_hops` will be used.
26888 * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
26889 * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
26890 * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
26894 * May be used to re-compute a [`Route`] when handling a [`Event::PaymentPathFailed`]. Any
26895 * adjustments to the [`NetworkGraph`] and channel scores should be made prior to calling this
26900 * Panics if first_hops contains channels without short_channel_ids;
26901 * [`ChannelManager::list_usable_channels`] will never include such channels.
26903 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
26904 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
26905 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
26907 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
26909 struct LDKCResult_RouteLightningErrorZ find_route(struct LDKPublicKey our_node_pubkey, const struct LDKRouteParameters *NONNULL_PTR route_params, const struct LDKReadOnlyNetworkGraph *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]);
26912 * Construct a route from us (payer) to the target node (payee) via the given hops (which should
26913 * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
26915 * Re-uses logic from `find_route`, so the restrictions described there also apply here.
26917 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 LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, const uint8_t (*random_seed_bytes)[32]);
26920 * Calls the free function if one is set
26922 void Score_free(struct LDKScore this_ptr);
26925 * Calls the free function if one is set
26927 void LockableScore_free(struct LDKLockableScore this_ptr);
26930 * Calls the free function if one is set
26932 void WriteableScore_free(struct LDKWriteableScore this_ptr);
26935 * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
26937 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
26940 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
26942 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
26945 * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
26947 void ChannelUsage_free(struct LDKChannelUsage this_obj);
26950 * The amount to send through the channel, denominated in millisatoshis.
26952 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
26955 * The amount to send through the channel, denominated in millisatoshis.
26957 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
26960 * Total amount, denominated in millisatoshis, already allocated to send through the channel
26961 * as part of a multi-path payment.
26963 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
26966 * Total amount, denominated in millisatoshis, already allocated to send through the channel
26967 * as part of a multi-path payment.
26969 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
26972 * The effective capacity of the channel.
26974 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
26977 * The effective capacity of the channel.
26979 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
26982 * Constructs a new ChannelUsage given each field
26984 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
26987 * Creates a copy of the ChannelUsage
26989 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
26992 * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
26994 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
26997 * Creates a copy of the FixedPenaltyScorer
26999 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
27002 * Creates a new scorer using `penalty_msat`.
27004 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
27007 * Constructs a new Score which calls the relevant methods on this_arg.
27008 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
27010 struct LDKScore FixedPenaltyScorer_as_Score(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
27013 * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
27015 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
27018 * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
27020 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
27023 * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
27025 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
27028 * Frees any resources used by the ProbabilisticScoringParameters, if is_owned is set and inner is non-NULL.
27030 void ProbabilisticScoringParameters_free(struct LDKProbabilisticScoringParameters this_obj);
27033 * A fixed penalty in msats to apply to each channel.
27035 * Default value: 500 msat
27037 uint64_t ProbabilisticScoringParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27040 * A fixed penalty in msats to apply to each channel.
27042 * Default value: 500 msat
27044 void ProbabilisticScoringParameters_set_base_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27047 * A multiplier used in conjunction with the negative `log10` of the channel's success
27048 * probability for a payment to determine the liquidity penalty.
27050 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
27051 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
27052 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
27053 * lower bounding the success probability to `0.01`) when the amount falls within the
27054 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
27055 * result in a `u64::max_value` penalty, however.
27057 * Default value: 40,000 msat
27059 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
27061 uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27064 * A multiplier used in conjunction with the negative `log10` of the channel's success
27065 * probability for a payment to determine the liquidity penalty.
27067 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
27068 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
27069 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
27070 * lower bounding the success probability to `0.01`) when the amount falls within the
27071 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
27072 * result in a `u64::max_value` penalty, however.
27074 * Default value: 40,000 msat
27076 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
27078 void ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27081 * The time required to elapse before any knowledge learned about channel liquidity balances is
27084 * The bounds are defined in terms of offsets and are initially zero. Increasing the offsets
27085 * gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases
27086 * the certainty of the channel liquidity balance.
27088 * Default value: 1 hour
27092 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
27093 * liquidity knowledge will never decay except when the bounds cross.
27095 uint64_t ProbabilisticScoringParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27098 * The time required to elapse before any knowledge learned about channel liquidity balances is
27101 * The bounds are defined in terms of offsets and are initially zero. Increasing the offsets
27102 * gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases
27103 * the certainty of the channel liquidity balance.
27105 * Default value: 1 hour
27109 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
27110 * liquidity knowledge will never decay except when the bounds cross.
27112 void ProbabilisticScoringParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27115 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
27116 * channel's success probability for the payment to determine the amount penalty.
27118 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
27119 * fees plus penalty) for large payments. The penalty is computed as the product of this
27120 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
27121 * success probability.
27123 * `-log10(success_probability) * amount_penalty_multiplier_msat * amount_msat / 2^20`
27125 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
27126 * the amount will result in a penalty of the multiplier. And, as the success probability
27127 * decreases, the negative `log10` weighting will increase dramatically. For higher success
27128 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
27131 * Default value: 256 msat
27133 uint64_t ProbabilisticScoringParameters_get_amount_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27136 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
27137 * channel's success probability for the payment to determine the amount penalty.
27139 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
27140 * fees plus penalty) for large payments. The penalty is computed as the product of this
27141 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
27142 * success probability.
27144 * `-log10(success_probability) * amount_penalty_multiplier_msat * amount_msat / 2^20`
27146 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
27147 * the amount will result in a penalty of the multiplier. And, as the success probability
27148 * decreases, the negative `log10` weighting will increase dramatically. For higher success
27149 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
27152 * Default value: 256 msat
27154 void ProbabilisticScoringParameters_set_amount_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27157 * Constructs a new ProbabilisticScoringParameters given each field
27159 MUST_USE_RES struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_new(uint64_t base_penalty_msat_arg, uint64_t liquidity_penalty_multiplier_msat_arg, uint64_t liquidity_offset_half_life_arg, uint64_t amount_penalty_multiplier_msat_arg);
27162 * Creates a copy of the ProbabilisticScoringParameters
27164 struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_clone(const struct LDKProbabilisticScoringParameters *NONNULL_PTR orig);
27167 * Creates a new scorer using the given scoring parameters for sending payments from a node
27168 * through a network graph.
27170 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringParameters params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
27173 * Dump the contents of this scorer into the configured logger.
27175 * Note that this writes roughly one line per channel for which we have a liquidity estimate,
27176 * which may be a substantial amount of log output.
27178 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
27181 * Creates a "default" ProbabilisticScoringParameters. See struct and individual field documentaiton for details on which values are used.
27183 MUST_USE_RES struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_default(void);
27186 * Constructs a new Score which calls the relevant methods on this_arg.
27187 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
27189 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
27192 * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
27194 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
27197 * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
27199 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
27202 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
27204 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
27207 * Initialize a new FilesystemPersister and set the path to the individual channels'
27210 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
27213 * Get the directory which was provided when this persister was initialized.
27215 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
27218 * Read `ChannelMonitor`s from disk.
27220 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
27223 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
27225 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
27228 * Frees any resources used by the GossipSync
27230 void GossipSync_free(struct LDKGossipSync this_ptr);
27233 * Utility method to constructs a new P2P-variant GossipSync
27235 struct LDKGossipSync GossipSync_p2_p(struct LDKP2PGossipSync a);
27238 * Utility method to constructs a new Rapid-variant GossipSync
27240 struct LDKGossipSync GossipSync_rapid(struct LDKRapidGossipSync a);
27243 * Utility method to constructs a new None-variant GossipSync
27245 struct LDKGossipSync GossipSync_none(void);
27248 * Start a background thread that takes care of responsibilities enumerated in the [top-level
27251 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
27252 * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
27253 * either [`join`] or [`stop`].
27255 * # Data Persistence
27257 * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
27258 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
27259 * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
27260 * provided implementation.
27262 * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
27263 * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
27264 * See the `lightning-persister` crate for LDK's provided implementation.
27266 * Typically, users should either implement [`Persister::persist_manager`] to never return an
27267 * error or call [`join`] and handle any error that may arise. For the latter case,
27268 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
27272 * `event_handler` is responsible for handling events that users should be notified of (e.g.,
27273 * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
27274 * functionality implemented by other handlers.
27275 * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
27277 * # Rapid Gossip Sync
27279 * If rapid gossip sync is meant to run at startup, pass a [`RapidGossipSync`] to `gossip_sync`
27280 * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
27281 * until the [`RapidGossipSync`] instance completes its first sync.
27283 * [top-level documentation]: BackgroundProcessor
27284 * [`join`]: Self::join
27285 * [`stop`]: Self::stop
27286 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
27287 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
27288 * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
27289 * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
27290 * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
27291 * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
27293 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 LDKCOption_WriteableScoreZ scorer);
27296 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
27297 * [`ChannelManager`].
27301 * This function panics if the background thread has panicked such as while persisting or
27304 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
27306 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
27309 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
27310 * [`ChannelManager`].
27314 * This function panics if the background thread has panicked such as while persisting or
27317 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
27319 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
27322 * Frees any resources used by the ParseError
27324 void ParseError_free(struct LDKParseError this_ptr);
27327 * Creates a copy of the ParseError
27329 struct LDKParseError ParseError_clone(const struct LDKParseError *NONNULL_PTR orig);
27332 * Utility method to constructs a new Bech32Error-variant ParseError
27334 struct LDKParseError ParseError_bech32_error(struct LDKBech32Error a);
27337 * Utility method to constructs a new ParseAmountError-variant ParseError
27339 struct LDKParseError ParseError_parse_amount_error(struct LDKError a);
27342 * Utility method to constructs a new MalformedSignature-variant ParseError
27344 struct LDKParseError ParseError_malformed_signature(enum LDKSecp256k1Error a);
27347 * Utility method to constructs a new BadPrefix-variant ParseError
27349 struct LDKParseError ParseError_bad_prefix(void);
27352 * Utility method to constructs a new UnknownCurrency-variant ParseError
27354 struct LDKParseError ParseError_unknown_currency(void);
27357 * Utility method to constructs a new UnknownSiPrefix-variant ParseError
27359 struct LDKParseError ParseError_unknown_si_prefix(void);
27362 * Utility method to constructs a new MalformedHRP-variant ParseError
27364 struct LDKParseError ParseError_malformed_hrp(void);
27367 * Utility method to constructs a new TooShortDataPart-variant ParseError
27369 struct LDKParseError ParseError_too_short_data_part(void);
27372 * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant ParseError
27374 struct LDKParseError ParseError_unexpected_end_of_tagged_fields(void);
27377 * Utility method to constructs a new DescriptionDecodeError-variant ParseError
27379 struct LDKParseError ParseError_description_decode_error(struct LDKError a);
27382 * Utility method to constructs a new PaddingError-variant ParseError
27384 struct LDKParseError ParseError_padding_error(void);
27387 * Utility method to constructs a new IntegerOverflowError-variant ParseError
27389 struct LDKParseError ParseError_integer_overflow_error(void);
27392 * Utility method to constructs a new InvalidSegWitProgramLength-variant ParseError
27394 struct LDKParseError ParseError_invalid_seg_wit_program_length(void);
27397 * Utility method to constructs a new InvalidPubKeyHashLength-variant ParseError
27399 struct LDKParseError ParseError_invalid_pub_key_hash_length(void);
27402 * Utility method to constructs a new InvalidScriptHashLength-variant ParseError
27404 struct LDKParseError ParseError_invalid_script_hash_length(void);
27407 * Utility method to constructs a new InvalidRecoveryId-variant ParseError
27409 struct LDKParseError ParseError_invalid_recovery_id(void);
27412 * Utility method to constructs a new InvalidSliceLength-variant ParseError
27414 struct LDKParseError ParseError_invalid_slice_length(struct LDKStr a);
27417 * Utility method to constructs a new Skip-variant ParseError
27419 struct LDKParseError ParseError_skip(void);
27422 * Frees any resources used by the ParseOrSemanticError
27424 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
27427 * Creates a copy of the ParseOrSemanticError
27429 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
27432 * Utility method to constructs a new ParseError-variant ParseOrSemanticError
27434 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKParseError a);
27437 * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
27439 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKSemanticError a);
27442 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
27444 void Invoice_free(struct LDKInvoice this_obj);
27447 * Checks if two Invoices contain equal inner contents.
27448 * This ignores pointers and is_owned flags and looks at the values in fields.
27449 * Two objects with NULL inner values will be considered "equal" here.
27451 bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
27454 * Creates a copy of the Invoice
27456 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
27459 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
27461 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
27464 * Checks if two SignedRawInvoices contain equal inner contents.
27465 * This ignores pointers and is_owned flags and looks at the values in fields.
27466 * Two objects with NULL inner values will be considered "equal" here.
27468 bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
27471 * Creates a copy of the SignedRawInvoice
27473 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
27476 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
27478 void RawInvoice_free(struct LDKRawInvoice this_obj);
27483 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
27488 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
27491 * Checks if two RawInvoices contain equal inner contents.
27492 * This ignores pointers and is_owned flags and looks at the values in fields.
27493 * Two objects with NULL inner values will be considered "equal" here.
27495 bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
27498 * Creates a copy of the RawInvoice
27500 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
27503 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
27505 void RawDataPart_free(struct LDKRawDataPart this_obj);
27508 * generation time of the invoice
27510 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
27513 * generation time of the invoice
27515 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
27518 * Checks if two RawDataParts contain equal inner contents.
27519 * This ignores pointers and is_owned flags and looks at the values in fields.
27520 * Two objects with NULL inner values will be considered "equal" here.
27522 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
27525 * Creates a copy of the RawDataPart
27527 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
27530 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
27532 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
27535 * Checks if two PositiveTimestamps contain equal inner contents.
27536 * This ignores pointers and is_owned flags and looks at the values in fields.
27537 * Two objects with NULL inner values will be considered "equal" here.
27539 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
27542 * Creates a copy of the PositiveTimestamp
27544 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
27547 * Creates a copy of the SiPrefix
27549 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
27552 * Utility method to constructs a new Milli-variant SiPrefix
27554 enum LDKSiPrefix SiPrefix_milli(void);
27557 * Utility method to constructs a new Micro-variant SiPrefix
27559 enum LDKSiPrefix SiPrefix_micro(void);
27562 * Utility method to constructs a new Nano-variant SiPrefix
27564 enum LDKSiPrefix SiPrefix_nano(void);
27567 * Utility method to constructs a new Pico-variant SiPrefix
27569 enum LDKSiPrefix SiPrefix_pico(void);
27572 * Checks if two SiPrefixs contain equal inner contents.
27573 * This ignores pointers and is_owned flags and looks at the values in fields.
27575 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
27578 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
27579 * This is effectively 10^12 * the prefix multiplier
27581 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
27584 * Creates a copy of the Currency
27586 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
27589 * Utility method to constructs a new Bitcoin-variant Currency
27591 enum LDKCurrency Currency_bitcoin(void);
27594 * Utility method to constructs a new BitcoinTestnet-variant Currency
27596 enum LDKCurrency Currency_bitcoin_testnet(void);
27599 * Utility method to constructs a new Regtest-variant Currency
27601 enum LDKCurrency Currency_regtest(void);
27604 * Utility method to constructs a new Simnet-variant Currency
27606 enum LDKCurrency Currency_simnet(void);
27609 * Utility method to constructs a new Signet-variant Currency
27611 enum LDKCurrency Currency_signet(void);
27614 * Checks if two Currencys contain equal inner contents.
27616 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
27619 * Checks if two Currencys contain equal inner contents.
27620 * This ignores pointers and is_owned flags and looks at the values in fields.
27622 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
27625 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
27627 void Sha256_free(struct LDKSha256 this_obj);
27630 * Creates a copy of the Sha256
27632 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
27635 * Checks if two Sha256s contain equal inner contents.
27637 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
27640 * Checks if two Sha256s contain equal inner contents.
27641 * This ignores pointers and is_owned flags and looks at the values in fields.
27642 * Two objects with NULL inner values will be considered "equal" here.
27644 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
27647 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
27649 void Description_free(struct LDKDescription this_obj);
27652 * Creates a copy of the Description
27654 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
27657 * Checks if two Descriptions contain equal inner contents.
27659 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
27662 * Checks if two Descriptions contain equal inner contents.
27663 * This ignores pointers and is_owned flags and looks at the values in fields.
27664 * Two objects with NULL inner values will be considered "equal" here.
27666 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
27669 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
27671 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
27673 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
27675 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27678 * Constructs a new PayeePubKey given each field
27680 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
27683 * Creates a copy of the PayeePubKey
27685 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
27688 * Checks if two PayeePubKeys contain equal inner contents.
27690 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
27693 * Checks if two PayeePubKeys contain equal inner contents.
27694 * This ignores pointers and is_owned flags and looks at the values in fields.
27695 * Two objects with NULL inner values will be considered "equal" here.
27697 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
27700 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
27702 void ExpiryTime_free(struct LDKExpiryTime this_obj);
27705 * Creates a copy of the ExpiryTime
27707 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
27710 * Checks if two ExpiryTimes contain equal inner contents.
27712 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
27715 * Checks if two ExpiryTimes contain equal inner contents.
27716 * This ignores pointers and is_owned flags and looks at the values in fields.
27717 * Two objects with NULL inner values will be considered "equal" here.
27719 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
27722 * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
27724 void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
27726 uint64_t MinFinalCltvExpiry_get_a(const struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr);
27728 void MinFinalCltvExpiry_set_a(struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr, uint64_t val);
27731 * Constructs a new MinFinalCltvExpiry given each field
27733 MUST_USE_RES struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_new(uint64_t a_arg);
27736 * Creates a copy of the MinFinalCltvExpiry
27738 struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
27741 * Checks if two MinFinalCltvExpirys contain equal inner contents.
27743 uint64_t MinFinalCltvExpiry_hash(const struct LDKMinFinalCltvExpiry *NONNULL_PTR o);
27746 * Checks if two MinFinalCltvExpirys contain equal inner contents.
27747 * This ignores pointers and is_owned flags and looks at the values in fields.
27748 * Two objects with NULL inner values will be considered "equal" here.
27750 bool MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b);
27753 * Frees any resources used by the Fallback
27755 void Fallback_free(struct LDKFallback this_ptr);
27758 * Creates a copy of the Fallback
27760 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
27763 * Utility method to constructs a new SegWitProgram-variant Fallback
27765 struct LDKFallback Fallback_seg_wit_program(struct LDKu5 version, struct LDKCVec_u8Z program);
27768 * Utility method to constructs a new PubKeyHash-variant Fallback
27770 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
27773 * Utility method to constructs a new ScriptHash-variant Fallback
27775 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
27778 * Checks if two Fallbacks contain equal inner contents.
27780 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
27783 * Checks if two Fallbacks contain equal inner contents.
27784 * This ignores pointers and is_owned flags and looks at the values in fields.
27786 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
27789 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
27791 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
27794 * Creates a copy of the InvoiceSignature
27796 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
27799 * Checks if two InvoiceSignatures contain equal inner contents.
27800 * This ignores pointers and is_owned flags and looks at the values in fields.
27801 * Two objects with NULL inner values will be considered "equal" here.
27803 bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b);
27806 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
27808 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
27811 * Creates a copy of the PrivateRoute
27813 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
27816 * Checks if two PrivateRoutes contain equal inner contents.
27818 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
27821 * Checks if two PrivateRoutes contain equal inner contents.
27822 * This ignores pointers and is_owned flags and looks at the values in fields.
27823 * Two objects with NULL inner values will be considered "equal" here.
27825 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
27828 * Disassembles the `SignedRawInvoice` into its three parts:
27830 * 2. hash of the raw invoice
27833 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
27836 * The `RawInvoice` which was signed.
27838 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
27841 * The hash of the `RawInvoice` that was signed.
27843 MUST_USE_RES const uint8_t (*SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
27846 * InvoiceSignature for the invoice.
27848 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
27851 * Recovers the public key used for signing the invoice from the recoverable signature.
27853 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
27856 * Checks if the signature is valid for the included payee public key or if none exists if it's
27857 * valid for the recovered signature (which should always be true?).
27859 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
27862 * Calculate the hash of the encoded `RawInvoice`
27864 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27868 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27870 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27874 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27876 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27880 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27882 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27886 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27888 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27892 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27894 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27898 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27900 MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27904 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27906 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27910 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27912 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27914 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawInvoice_private_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27916 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27918 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
27921 * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
27923 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
27925 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
27928 * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
27929 * the range `0..=MAX_TIMESTAMP`.
27931 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
27933 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
27936 * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
27937 * `0..=MAX_TIMESTAMP`.
27939 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
27941 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
27944 * Returns the Unix timestamp representing the stored time
27946 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
27949 * Returns the duration of the stored time since the Unix epoch
27951 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
27954 * Returns the [`SystemTime`] representing the stored time
27956 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
27959 * Transform the `Invoice` into it's unchecked version
27961 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
27964 * Check that the invoice is signed correctly and that key recovery works
27966 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
27969 * Constructs an `Invoice` from a `SignedRawInvoice` by checking all its invariants.
27971 * use lightning_invoice::*;
27973 * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
27974 * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
27975 * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
27976 * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
27977 * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
27978 * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
27979 * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
27980 * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
27981 * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
27982 * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
27983 * j5r6drg6k6zcqj0fcwg\";
27985 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
27987 * assert!(Invoice::from_signed(signed).is_ok());
27990 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
27993 * Returns the `Invoice`'s timestamp (should equal its creation time)
27995 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
27998 * Returns the `Invoice`'s timestamp as a duration since the Unix epoch
28000 MUST_USE_RES uint64_t Invoice_duration_since_epoch(const struct LDKInvoice *NONNULL_PTR this_arg);
28003 * Returns the hash to which we will receive the preimage on completion of the payment
28005 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
28008 * Get the payee's public key if one was included in the invoice
28010 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28012 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
28015 * Get the payment secret if one was included in the invoice
28017 MUST_USE_RES const uint8_t (*Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
28020 * Get the invoice features if they were included in the invoice
28022 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28024 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
28027 * Recover the payee's public key (only to be used if none was included in the invoice)
28029 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
28032 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
28034 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
28037 * Returns whether the invoice has expired.
28039 MUST_USE_RES bool Invoice_is_expired(const struct LDKInvoice *NONNULL_PTR this_arg);
28042 * Returns whether the expiry time would pass at the given point in time.
28043 * `at_time` is the timestamp as a duration since the Unix epoch.
28045 MUST_USE_RES bool Invoice_would_expire(const struct LDKInvoice *NONNULL_PTR this_arg, uint64_t at_time);
28048 * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
28049 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
28051 MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
28054 * Returns a list of all routes included in the invoice
28056 MUST_USE_RES struct LDKCVec_PrivateRouteZ Invoice_private_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
28059 * Returns a list of all routes included in the invoice as the underlying hints
28061 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_route_hints(const struct LDKInvoice *NONNULL_PTR this_arg);
28064 * Returns the currency for which the invoice was issued
28066 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
28069 * Returns the amount if specified in the invoice as millisatoshis.
28071 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_milli_satoshis(const struct LDKInvoice *NONNULL_PTR this_arg);
28074 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
28075 * returns `CreationError::DescriptionTooLong` otherwise
28077 * Please note that single characters may use more than one byte due to UTF8 encoding.
28079 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
28082 * Returns the underlying description `String`
28084 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
28087 * Construct an `ExpiryTime` from seconds.
28089 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
28092 * Construct an `ExpiryTime` from a `Duration`.
28094 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
28097 * Returns the expiry time in seconds
28099 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
28102 * Returns a reference to the underlying `Duration` (=expiry time)
28104 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
28107 * Creates a new (partial) route from a list of hops
28109 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
28112 * Returns the underlying list of hops
28114 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
28117 * Creates a copy of the CreationError
28119 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
28122 * Utility method to constructs a new DescriptionTooLong-variant CreationError
28124 enum LDKCreationError CreationError_description_too_long(void);
28127 * Utility method to constructs a new RouteTooLong-variant CreationError
28129 enum LDKCreationError CreationError_route_too_long(void);
28132 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
28134 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
28137 * Utility method to constructs a new InvalidAmount-variant CreationError
28139 enum LDKCreationError CreationError_invalid_amount(void);
28142 * Utility method to constructs a new MissingRouteHints-variant CreationError
28144 enum LDKCreationError CreationError_missing_route_hints(void);
28147 * Checks if two CreationErrors contain equal inner contents.
28148 * This ignores pointers and is_owned flags and looks at the values in fields.
28150 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
28153 * Get the string representation of a CreationError object
28155 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
28158 * Creates a copy of the SemanticError
28160 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
28163 * Utility method to constructs a new NoPaymentHash-variant SemanticError
28165 enum LDKSemanticError SemanticError_no_payment_hash(void);
28168 * Utility method to constructs a new MultiplePaymentHashes-variant SemanticError
28170 enum LDKSemanticError SemanticError_multiple_payment_hashes(void);
28173 * Utility method to constructs a new NoDescription-variant SemanticError
28175 enum LDKSemanticError SemanticError_no_description(void);
28178 * Utility method to constructs a new MultipleDescriptions-variant SemanticError
28180 enum LDKSemanticError SemanticError_multiple_descriptions(void);
28183 * Utility method to constructs a new NoPaymentSecret-variant SemanticError
28185 enum LDKSemanticError SemanticError_no_payment_secret(void);
28188 * Utility method to constructs a new MultiplePaymentSecrets-variant SemanticError
28190 enum LDKSemanticError SemanticError_multiple_payment_secrets(void);
28193 * Utility method to constructs a new InvalidFeatures-variant SemanticError
28195 enum LDKSemanticError SemanticError_invalid_features(void);
28198 * Utility method to constructs a new InvalidRecoveryId-variant SemanticError
28200 enum LDKSemanticError SemanticError_invalid_recovery_id(void);
28203 * Utility method to constructs a new InvalidSignature-variant SemanticError
28205 enum LDKSemanticError SemanticError_invalid_signature(void);
28208 * Utility method to constructs a new ImpreciseAmount-variant SemanticError
28210 enum LDKSemanticError SemanticError_imprecise_amount(void);
28213 * Checks if two SemanticErrors contain equal inner contents.
28214 * This ignores pointers and is_owned flags and looks at the values in fields.
28216 bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
28219 * Get the string representation of a SemanticError object
28221 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
28224 * Frees any resources used by the SignOrCreationError
28226 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
28229 * Creates a copy of the SignOrCreationError
28231 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
28234 * Utility method to constructs a new SignError-variant SignOrCreationError
28236 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
28239 * Utility method to constructs a new CreationError-variant SignOrCreationError
28241 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
28244 * Checks if two SignOrCreationErrors contain equal inner contents.
28245 * This ignores pointers and is_owned flags and looks at the values in fields.
28247 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
28250 * Get the string representation of a SignOrCreationError object
28252 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
28255 * Frees any resources used by the InvoicePayer, if is_owned is set and inner is non-NULL.
28257 void InvoicePayer_free(struct LDKInvoicePayer this_obj);
28260 * Calls the free function if one is set
28262 void Payer_free(struct LDKPayer this_ptr);
28265 * Calls the free function if one is set
28267 void Router_free(struct LDKRouter this_ptr);
28270 * Frees any resources used by the Retry
28272 void Retry_free(struct LDKRetry this_ptr);
28275 * Creates a copy of the Retry
28277 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
28280 * Utility method to constructs a new Attempts-variant Retry
28282 struct LDKRetry Retry_attempts(uintptr_t a);
28285 * Utility method to constructs a new Timeout-variant Retry
28287 struct LDKRetry Retry_timeout(uint64_t a);
28290 * Checks if two Retrys contain equal inner contents.
28291 * This ignores pointers and is_owned flags and looks at the values in fields.
28293 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
28296 * Checks if two Retrys contain equal inner contents.
28298 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
28301 * Frees any resources used by the PaymentError
28303 void PaymentError_free(struct LDKPaymentError this_ptr);
28306 * Creates a copy of the PaymentError
28308 struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
28311 * Utility method to constructs a new Invoice-variant PaymentError
28313 struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
28316 * Utility method to constructs a new Routing-variant PaymentError
28318 struct LDKPaymentError PaymentError_routing(struct LDKLightningError a);
28321 * Utility method to constructs a new Sending-variant PaymentError
28323 struct LDKPaymentError PaymentError_sending(struct LDKPaymentSendFailure a);
28326 * Creates an invoice payer that retries failed payment paths.
28328 * Will forward any [`Event::PaymentPathFailed`] events to the decorated `event_handler` once
28329 * `retry` has been exceeded for a given [`Invoice`].
28331 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);
28334 * Pays the given [`Invoice`], caching it for later use in case a retry is needed.
28336 * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
28337 * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
28340 MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice);
28343 * Pays the given zero-value [`Invoice`] using the given amount, caching it for later use in
28344 * case a retry is needed.
28346 * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
28347 * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
28350 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);
28353 * Pays `pubkey` an amount using the hash of the given preimage, caching it for later use in
28354 * case a retry is needed.
28356 * You should ensure that `payment_preimage` is unique and that its `payment_hash` has never
28357 * been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so for you.
28359 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);
28362 * Removes the payment cached by the given payment hash.
28364 * Should be called once a payment has failed or succeeded if not using [`InvoicePayer`] as an
28365 * [`EventHandler`]. Otherwise, calling this method is unnecessary.
28367 void InvoicePayer_remove_cached_payment(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
28370 * Constructs a new EventHandler which calls the relevant methods on this_arg.
28371 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
28373 struct LDKEventHandler InvoicePayer_as_EventHandler(const struct LDKInvoicePayer *NONNULL_PTR this_arg);
28376 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
28377 * See [`PhantomKeysManager`] for more information on phantom node payments.
28379 * `phantom_route_hints` parameter:
28380 * * Contains channel info for all nodes participating in the phantom invoice
28381 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
28382 * participating node
28383 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
28384 * updated when a channel becomes disabled or closes
28385 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
28386 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
28389 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
28390 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
28391 * If `None` is provided for `payment_hash`, then one will be created.
28393 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
28394 * in excess of the current time.
28396 * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom
28397 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
28400 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
28401 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
28402 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
28403 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
28404 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
28406 * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
28408 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);
28411 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
28412 * See [`PhantomKeysManager`] for more information on phantom node payments.
28414 * `phantom_route_hints` parameter:
28415 * * Contains channel info for all nodes participating in the phantom invoice
28416 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
28417 * participating node
28418 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
28419 * updated when a channel becomes disabled or closes
28420 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
28421 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
28424 * `description_hash` is a SHA-256 hash of the description text
28426 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
28427 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
28428 * If `None` is provided for `payment_hash`, then one will be created.
28430 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
28431 * in excess of the current time.
28433 * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom
28434 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
28437 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
28438 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
28439 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
28440 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
28441 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
28443 * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
28445 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);
28448 * Utility to construct an invoice. Generally, unless you want to do something like a custom
28449 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
28450 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
28451 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
28452 * that the payment secret is valid when the invoice is paid.
28454 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
28455 * in excess of the current time.
28457 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);
28460 * Utility to construct an invoice. Generally, unless you want to do something like a custom
28461 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
28462 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
28463 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
28464 * that the payment secret is valid when the invoice is paid.
28465 * Use this variant if you want to pass the `description_hash` to the invoice.
28467 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
28468 * in excess of the current time.
28470 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);
28473 * See [`create_invoice_from_channelmanager_with_description_hash`]
28474 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
28475 * available and the current time is supplied by the caller.
28477 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);
28480 * See [`create_invoice_from_channelmanager`]
28481 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
28482 * available and the current time is supplied by the caller.
28484 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);
28487 * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
28489 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
28492 * Creates a new router using the given [`NetworkGraph`], a [`Logger`], and a randomness source
28493 * `random_seed_bytes`.
28495 MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKThirtyTwoBytes random_seed_bytes);
28498 * Constructs a new Router which calls the relevant methods on this_arg.
28499 * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
28501 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
28504 * Constructs a new Payer which calls the relevant methods on this_arg.
28505 * This copies the `inner` pointer in this_arg and thus the returned Payer must be freed before this_arg is
28507 struct LDKPayer ChannelManager_as_Payer(const struct LDKChannelManager *NONNULL_PTR this_arg);
28510 * Read a SiPrefix object from a string
28512 struct LDKCResult_SiPrefixParseErrorZ SiPrefix_from_str(struct LDKStr s);
28515 * Read a Invoice object from a string
28517 struct LDKCResult_InvoiceParseOrSemanticErrorZ Invoice_from_str(struct LDKStr s);
28520 * Read a SignedRawInvoice object from a string
28522 struct LDKCResult_SignedRawInvoiceParseErrorZ SignedRawInvoice_from_str(struct LDKStr s);
28525 * Get the string representation of a ParseError object
28527 struct LDKStr ParseError_to_str(const struct LDKParseError *NONNULL_PTR o);
28530 * Get the string representation of a ParseOrSemanticError object
28532 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
28535 * Get the string representation of a Invoice object
28537 struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o);
28540 * Get the string representation of a SignedRawInvoice object
28542 struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o);
28545 * Get the string representation of a Currency object
28547 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
28550 * Get the string representation of a SiPrefix object
28552 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
28555 * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
28557 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
28560 * Instantiate a new [`RapidGossipSync`] instance
28562 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph);
28565 * Sync gossip data from a file
28566 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
28568 * `network_graph`: The network graph to apply the updates to
28570 * `sync_path`: Path to the file where the gossip update data is located
28573 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path);
28576 * Returns whether a rapid gossip sync has completed at least once
28578 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
28581 * Frees any resources used by the GraphSyncError
28583 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
28586 * Creates a copy of the GraphSyncError
28588 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
28591 * Utility method to constructs a new DecodeError-variant GraphSyncError
28593 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
28596 * Utility method to constructs a new LightningError-variant GraphSyncError
28598 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
28601 * Update network graph from binary data.
28602 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
28604 * `network_graph`: network graph to be updated
28606 * `update_data`: `&[u8]` binary stream that comprises the update data
28608 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
28610 #endif /* LDK_C_BINDINGS_H */
28612 #include "ldk_ver.h"